aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop/qmpmainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-12-02 11:55:52 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-12-02 11:55:52 +0800
commit81c26b4dd3c3d11471bacfe7a4a83d2a8edac751 (patch)
tree6db653f625bf2765738f3a2169d3344e52626e7d /qmidiplayer-desktop/qmpmainwindow.cpp
parentc34daa26c67f4a879ff541775c099ddc19a1dec5 (diff)
downloadQMidiPlayer-81c26b4dd3c3d11471bacfe7a4a83d2a8edac751.tar.xz
No more creepy blank action buttons that cause crashes if clicked.
If a plugin has been removed and the toolbar is reconfigured afterwards, a blank button will appear in the toolbar, which will cause a crash when clicked.
Diffstat (limited to 'qmidiplayer-desktop/qmpmainwindow.cpp')
-rw-r--r--qmidiplayer-desktop/qmpmainwindow.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp
index 1715539..1df2d8e 100644
--- a/qmidiplayer-desktop/qmpmainwindow.cpp
+++ b/qmidiplayer-desktop/qmpmainwindow.cpp
@@ -625,10 +625,9 @@ void qmpMainWindow::setupWidget()
i->second.setAssignedControl((QReflectiveAction*)nullptr),
i->second.setAssignedControl((QReflectivePushButton*)nullptr);
QList<QWidget*>w=ui->buttonwidget->findChildren<QWidget*>("",Qt::FindDirectChildrenOnly);
- for(unsigned i=0;i<w.size();++i)
- delete w[i];
+ qDeleteAll(w);
QList<QAction*>a=ui->lbFileName->actions();
- for(unsigned i=0;i<a.size();++i)
+ for(int i=0;i<a.size();++i)
{
ui->lbFileName->removeAction(a[i]);
delete a[i];