diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2023-01-30 14:42:41 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-01-30 14:39:53 +0000 |
commit | 922fb4aeb7b36e9c5d22fc6280416e8cb7a0f5a3 (patch) | |
tree | c297584e7c38de9c102b05bcb9d675b06cf6140a /src | |
parent | 25df84a1b67f5403a5efa61834dc8df7d7d45490 (diff) | |
download | qttools-922fb4aeb7b36e9c5d22fc6280416e8cb7a0f5a3.tar.gz |
QtResourceEditor: Remove private slots - part 6
Change-Id: I6bf537115431247d14a17463ef2897d21af3ff69
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3dcf1490cb2bce34cb1f7777dfe836310f305817)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/designer/src/lib/shared/iconselector.cpp | 31 | ||||
-rw-r--r-- | src/designer/src/lib/shared/iconselector_p.h | 10 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qtresourceeditordialog.cpp | 114 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qtresourceeditordialog_p.h | 35 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qtresourcemodel.cpp | 4 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qtresourcemodel_p.h | 2 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qtresourceview.cpp | 41 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qtresourceview_p.h | 13 |
8 files changed, 108 insertions, 142 deletions
diff --git a/src/designer/src/lib/shared/iconselector.cpp b/src/designer/src/lib/shared/iconselector.cpp index a41da22ac..d8e57e3ad 100644 --- a/src/designer/src/lib/shared/iconselector.cpp +++ b/src/designer/src/lib/shared/iconselector.cpp @@ -90,10 +90,12 @@ void LanguageResourceDialogPrivate::init(LanguageResourceDialog *p) QLayout *layout = new QVBoxLayout(p); layout->addWidget(m_browser); layout->addWidget(m_dialogButtonBox); - QObject::connect(m_dialogButtonBox, SIGNAL(accepted()), p, SLOT(slotAccepted())); + QObject::connect(m_dialogButtonBox, &QDialogButtonBox::accepted, p, [this] { slotAccepted(); }); QObject::connect(m_dialogButtonBox, &QDialogButtonBox::rejected, p, &QDialog::reject); - QObject::connect(m_browser, SIGNAL(currentPathChanged(QString)), p, SLOT(slotPathChanged(QString))); - QObject::connect(m_browser, SIGNAL(pathActivated(QString)), p, SLOT(slotAccepted())); + QObject::connect(m_browser, &QDesignerResourceBrowserInterface::currentPathChanged, + p, [this](const QString &fileName) { slotPathChanged(fileName); }); + QObject::connect(m_browser, &QDesignerResourceBrowserInterface::pathActivated, + p, [this] { slotAccepted(); }); p->setModal(true); p->setWindowTitle(LanguageResourceDialog::tr("Choose Resource")); p->setWindowFlags(p->windowFlags() & ~Qt::WindowContextHelpButtonHint); @@ -444,13 +446,18 @@ IconSelector::IconSelector(QWidget *parent) : d_ptr->m_iconButton->setMenu(setMenu); - connect(d_ptr->m_stateComboBox, SIGNAL(activated(int)), this, SLOT(slotStateActivated())); - connect(d_ptr->m_iconButton, SIGNAL(clicked()), this, SLOT(slotSetActivated())); - connect(setResourceAction, SIGNAL(triggered()), this, SLOT(slotSetResourceActivated())); - connect(setFileAction, SIGNAL(triggered()), this, SLOT(slotSetFileActivated())); - connect(d_ptr->m_resetAction, SIGNAL(triggered()), this, SLOT(slotResetActivated())); - connect(d_ptr->m_resetAllAction, SIGNAL(triggered()), this, SLOT(slotResetAllActivated())); - + connect(d_ptr->m_stateComboBox, &QComboBox::activated, + this, [this] { d_ptr->slotStateActivated(); }); + connect(d_ptr->m_iconButton, &QAbstractButton::clicked, + this, [this] { d_ptr->slotSetActivated(); }); + connect(setResourceAction, &QAction::triggered, + this, [this] { d_ptr->slotSetResourceActivated(); }); + connect(setFileAction, &QAction::triggered, + this, [this] { d_ptr->slotSetFileActivated(); }); + connect(d_ptr->m_resetAction, &QAction::triggered, + this, [this] { d_ptr->slotResetActivated(); }); + connect(d_ptr->m_resetAllAction, &QAction::triggered, + this, [this] { d_ptr->slotResetAllActivated(); }); d_ptr->slotUpdate(); } @@ -480,14 +487,14 @@ void IconSelector::setFormEditor(QDesignerFormEditorInterface *core) void IconSelector::setIconCache(DesignerIconCache *iconCache) { d_ptr->m_iconCache = iconCache; - connect(iconCache, SIGNAL(reloaded()), this, SLOT(slotUpdate())); + connect(iconCache, &DesignerIconCache::reloaded, this, [this] { d_ptr->slotUpdate(); }); d_ptr->slotUpdate(); } void IconSelector::setPixmapCache(DesignerPixmapCache *pixmapCache) { d_ptr->m_pixmapCache = pixmapCache; - connect(pixmapCache, SIGNAL(reloaded()), this, SLOT(slotUpdate())); + connect(pixmapCache, &DesignerPixmapCache::reloaded, this, [this] { d_ptr->slotUpdate(); }); d_ptr->slotUpdate(); } diff --git a/src/designer/src/lib/shared/iconselector_p.h b/src/designer/src/lib/shared/iconselector_p.h index aefb9a7ad..6315314e6 100644 --- a/src/designer/src/lib/shared/iconselector_p.h +++ b/src/designer/src/lib/shared/iconselector_p.h @@ -56,8 +56,6 @@ private: QScopedPointer<class LanguageResourceDialogPrivate> d_ptr; Q_DECLARE_PRIVATE(LanguageResourceDialog) Q_DISABLE_COPY_MOVE(LanguageResourceDialog) - Q_PRIVATE_SLOT(d_func(), void slotAccepted()) - Q_PRIVATE_SLOT(d_func(), void slotPathChanged(QString)) }; @@ -89,14 +87,6 @@ private: QScopedPointer<class IconSelectorPrivate> d_ptr; Q_DECLARE_PRIVATE(IconSelector) Q_DISABLE_COPY_MOVE(IconSelector) - - Q_PRIVATE_SLOT(d_func(), void slotStateActivated()) - Q_PRIVATE_SLOT(d_func(), void slotSetActivated()) - Q_PRIVATE_SLOT(d_func(), void slotSetResourceActivated()) - Q_PRIVATE_SLOT(d_func(), void slotSetFileActivated()) - Q_PRIVATE_SLOT(d_func(), void slotResetActivated()) - Q_PRIVATE_SLOT(d_func(), void slotResetAllActivated()) - Q_PRIVATE_SLOT(d_func(), void slotUpdate()) }; // IconThemeEditor: Let's the user input theme icon names and shows a preview label. diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp index 5c318d563..ee584e79a 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -1871,30 +1871,32 @@ QtResourceEditorDialog::QtResourceEditorDialog(QDesignerFormEditorInterface *cor setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowTitle(tr("Edit Resources")); - connect(d_ptr->m_qrcManager, SIGNAL(qrcFileInserted(QtQrcFile*)), - this, SLOT(slotQrcFileInserted(QtQrcFile*))); - connect(d_ptr->m_qrcManager, SIGNAL(qrcFileMoved(QtQrcFile*,QtQrcFile*)), - this, SLOT(slotQrcFileMoved(QtQrcFile*))); - connect(d_ptr->m_qrcManager, SIGNAL(qrcFileRemoved(QtQrcFile*)), - this, SLOT(slotQrcFileRemoved(QtQrcFile*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourcePrefixInserted(QtResourcePrefix*)), - this, SLOT(slotResourcePrefixInserted(QtResourcePrefix*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourcePrefixMoved(QtResourcePrefix*,QtResourcePrefix*)), - this, SLOT(slotResourcePrefixMoved(QtResourcePrefix*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourcePrefixChanged(QtResourcePrefix*,QString)), - this, SLOT(slotResourcePrefixChanged(QtResourcePrefix*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourceLanguageChanged(QtResourcePrefix*,QString)), - this, SLOT(slotResourceLanguageChanged(QtResourcePrefix*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourcePrefixRemoved(QtResourcePrefix*)), - this, SLOT(slotResourcePrefixRemoved(QtResourcePrefix*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourceFileInserted(QtResourceFile*)), - this, SLOT(slotResourceFileInserted(QtResourceFile*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourceFileMoved(QtResourceFile*,QtResourceFile*)), - this, SLOT(slotResourceFileMoved(QtResourceFile*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourceAliasChanged(QtResourceFile*,QString)), - this, SLOT(slotResourceAliasChanged(QtResourceFile*))); - connect(d_ptr->m_qrcManager, SIGNAL(resourceFileRemoved(QtResourceFile*)), - this, SLOT(slotResourceFileRemoved(QtResourceFile*))); + connect(d_ptr->m_qrcManager, &QtQrcManager::qrcFileInserted, + this, [this](QtQrcFile *file) { d_ptr->slotQrcFileInserted(file); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::qrcFileMoved, + this, [this](QtQrcFile *file) { d_ptr->slotQrcFileMoved(file); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::qrcFileRemoved, + this, [this](QtQrcFile *file) { d_ptr->slotQrcFileRemoved(file); }); + + connect(d_ptr->m_qrcManager, &QtQrcManager::resourcePrefixInserted, + this, [this](QtResourcePrefix *prefix) { d_ptr->slotResourcePrefixInserted(prefix); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourcePrefixMoved, + this, [this](QtResourcePrefix *prefix) { d_ptr->slotResourcePrefixMoved(prefix); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourcePrefixChanged, + this, [this](QtResourcePrefix *prefix) { d_ptr->slotResourcePrefixChanged(prefix); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourceLanguageChanged, + this, [this](QtResourcePrefix *prefix) { d_ptr->slotResourceLanguageChanged(prefix); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourcePrefixRemoved, + this, [this](QtResourcePrefix *prefix) { d_ptr->slotResourcePrefixRemoved(prefix); }); + + connect(d_ptr->m_qrcManager, &QtQrcManager::resourceFileInserted, + this, [this](QtResourceFile *file) { d_ptr->slotResourceFileInserted(file); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourceFileMoved, + this, [this](QtResourceFile *file) { d_ptr->slotResourceFileMoved(file); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourceAliasChanged, + this, [this](QtResourceFile *file) { d_ptr->slotResourceAliasChanged(file); }); + connect(d_ptr->m_qrcManager, &QtQrcManager::resourceFileRemoved, + this, [this](QtResourceFile *file) { d_ptr->slotResourceFileRemoved(file); }); QIcon upIcon = qdesigner_internal::createIconSet(QString::fromUtf8("up.png")); QIcon downIcon = qdesigner_internal::createIconSet(QString::fromUtf8("down.png")); @@ -1931,27 +1933,41 @@ QtResourceEditorDialog::QtResourceEditorDialog(QDesignerFormEditorInterface *cor d_ptr->m_ui.addResourceButton->setDefaultAction(d_ptr->m_addResourceFileAction); d_ptr->m_ui.removeResourceButton->setDefaultAction(d_ptr->m_removeAction); - connect(d_ptr->m_newQrcFileAction, SIGNAL(triggered()), this, SLOT(slotNewQrcFile())); - connect(d_ptr->m_importQrcFileAction, SIGNAL(triggered()), this, SLOT(slotImportQrcFile())); - connect(d_ptr->m_removeQrcFileAction, SIGNAL(triggered()), this, SLOT(slotRemoveQrcFile())); - connect(d_ptr->m_moveUpQrcFileAction, SIGNAL(triggered()), this, SLOT(slotMoveUpQrcFile())); - connect(d_ptr->m_moveDownQrcFileAction, SIGNAL(triggered()), this, SLOT(slotMoveDownQrcFile())); - - connect(d_ptr->m_newPrefixAction, SIGNAL(triggered()), this, SLOT(slotNewPrefix())); - connect(d_ptr->m_addResourceFileAction, SIGNAL(triggered()), this, SLOT(slotAddFiles())); - connect(d_ptr->m_changePrefixAction, SIGNAL(triggered()), this, SLOT(slotChangePrefix())); - connect(d_ptr->m_changeLanguageAction, SIGNAL(triggered()), this, SLOT(slotChangeLanguage())); - connect(d_ptr->m_changeAliasAction, SIGNAL(triggered()), this, SLOT(slotChangeAlias())); - connect(d_ptr->m_clonePrefixAction, SIGNAL(triggered()), this, SLOT(slotClonePrefix())); - connect(d_ptr->m_removeAction, SIGNAL(triggered()), this, SLOT(slotRemove())); - connect(d_ptr->m_moveUpAction, SIGNAL(triggered()), this, SLOT(slotMoveUp())); - connect(d_ptr->m_moveDownAction, SIGNAL(triggered()), this, SLOT(slotMoveDown())); + connect(d_ptr->m_newQrcFileAction, &QAction::triggered, + this, [this] { d_ptr->slotNewQrcFile(); }); + connect(d_ptr->m_importQrcFileAction, &QAction::triggered, + this, [this] { d_ptr->slotImportQrcFile(); }); + connect(d_ptr->m_removeQrcFileAction, &QAction::triggered, + this, [this] { d_ptr->slotRemoveQrcFile(); }); + connect(d_ptr->m_moveUpQrcFileAction, &QAction::triggered, + this, [this] { d_ptr->slotMoveUpQrcFile(); }); + connect(d_ptr->m_moveDownQrcFileAction, &QAction::triggered, + this, [this] { d_ptr->slotMoveDownQrcFile(); }); + + connect(d_ptr->m_newPrefixAction, &QAction::triggered, + this, [this] { d_ptr->slotNewPrefix(); }); + connect(d_ptr->m_addResourceFileAction, &QAction::triggered, + this, [this] { d_ptr->slotAddFiles(); }); + connect(d_ptr->m_changePrefixAction, &QAction::triggered, + this, [this] { d_ptr->slotChangePrefix(); }); + connect(d_ptr->m_changeLanguageAction, &QAction::triggered, + this, [this] { d_ptr->slotChangeLanguage(); }); + connect(d_ptr->m_changeAliasAction, &QAction::triggered, + this, [this] { d_ptr->slotChangeAlias(); }); + connect(d_ptr->m_clonePrefixAction, &QAction::triggered, + this, [this] { d_ptr->slotClonePrefix(); }); + connect(d_ptr->m_removeAction, &QAction::triggered, + this, [this] { d_ptr->slotRemove(); }); + connect(d_ptr->m_moveUpAction, &QAction::triggered, + this, [this] { d_ptr->slotMoveUp(); }); + connect(d_ptr->m_moveDownAction, &QAction::triggered, + this, [this] { d_ptr->slotMoveDown(); }); d_ptr->m_ui.qrcFileList->setContextMenuPolicy(Qt::CustomContextMenu); - connect(d_ptr->m_ui.qrcFileList, SIGNAL(customContextMenuRequested(QPoint)), - this, SLOT(slotListWidgetContextMenuRequested(QPoint))); - connect(d_ptr->m_ui.qrcFileList, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), - this, SLOT(slotCurrentQrcFileChanged(QListWidgetItem*))); + connect(d_ptr->m_ui.qrcFileList, &QListWidget::customContextMenuRequested, + this, [this](const QPoint &point) { d_ptr->slotListWidgetContextMenuRequested(point); }); + connect(d_ptr->m_ui.qrcFileList, &QListWidget::currentItemChanged, + this, [this](QListWidgetItem *item) { d_ptr->slotCurrentQrcFileChanged(item); }); d_ptr->m_treeModel = new QStandardItemModel(this); d_ptr->m_treeModel->setColumnCount(2); @@ -1964,12 +1980,12 @@ QtResourceEditorDialog::QtResourceEditorDialog(QDesignerFormEditorInterface *cor d_ptr->m_ui.resourceTreeView, &QTreeView::resizeColumnToContents); d_ptr->m_ui.resourceTreeView->setTextElideMode(Qt::ElideLeft); - connect(d_ptr->m_ui.resourceTreeView, SIGNAL(customContextMenuRequested(QPoint)), - this, SLOT(slotTreeViewContextMenuRequested(QPoint))); - connect(d_ptr->m_treeModel, SIGNAL(itemChanged(QStandardItem*)), - this, SLOT(slotTreeViewItemChanged(QStandardItem*))); - connect(d_ptr->m_treeSelection, SIGNAL(currentChanged(QModelIndex,QModelIndex)), - this, SLOT(slotCurrentTreeViewItemChanged(QModelIndex))); + connect(d_ptr->m_ui.resourceTreeView, &QTreeView::customContextMenuRequested, + this, [this](const QPoint &point) { d_ptr->slotTreeViewContextMenuRequested(point); }); + connect(d_ptr->m_treeModel, &QStandardItemModel::itemChanged, + this, [this](QStandardItem *item) { d_ptr->slotTreeViewItemChanged(item); }); + connect(d_ptr->m_treeSelection, &QItemSelectionModel::currentChanged, + this, [this](const QModelIndex &index) { d_ptr->slotCurrentTreeViewItemChanged(index); }); d_ptr->m_ui.resourceTreeView->setColumnWidth(0, 200); diff --git a/src/designer/src/lib/shared/qtresourceeditordialog_p.h b/src/designer/src/lib/shared/qtresourceeditordialog_p.h index 4873d5ab2..cc832a881 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog_p.h +++ b/src/designer/src/lib/shared/qtresourceeditordialog_p.h @@ -49,41 +49,6 @@ private: QScopedPointer<class QtResourceEditorDialogPrivate> d_ptr; Q_DECLARE_PRIVATE(QtResourceEditorDialog) Q_DISABLE_COPY_MOVE(QtResourceEditorDialog) - - Q_PRIVATE_SLOT(d_func(), void slotQrcFileInserted(QtQrcFile *)) - Q_PRIVATE_SLOT(d_func(), void slotQrcFileMoved(QtQrcFile *)) - Q_PRIVATE_SLOT(d_func(), void slotQrcFileRemoved(QtQrcFile *)) - Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixInserted(QtResourcePrefix *)) - Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixMoved(QtResourcePrefix *)) - Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixChanged(QtResourcePrefix *)) - Q_PRIVATE_SLOT(d_func(), void slotResourceLanguageChanged(QtResourcePrefix *)) - Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixRemoved(QtResourcePrefix *)) - Q_PRIVATE_SLOT(d_func(), void slotResourceFileInserted(QtResourceFile *)) - Q_PRIVATE_SLOT(d_func(), void slotResourceFileMoved(QtResourceFile *)) - Q_PRIVATE_SLOT(d_func(), void slotResourceAliasChanged(QtResourceFile *)) - Q_PRIVATE_SLOT(d_func(), void slotResourceFileRemoved(QtResourceFile *)) - - Q_PRIVATE_SLOT(d_func(), void slotCurrentQrcFileChanged(QListWidgetItem *)) - Q_PRIVATE_SLOT(d_func(), void slotCurrentTreeViewItemChanged(const QModelIndex &)) - Q_PRIVATE_SLOT(d_func(), void slotListWidgetContextMenuRequested(const QPoint &)) - Q_PRIVATE_SLOT(d_func(), void slotTreeViewContextMenuRequested(const QPoint &)) - Q_PRIVATE_SLOT(d_func(), void slotTreeViewItemChanged(QStandardItem *)) - - Q_PRIVATE_SLOT(d_func(), void slotNewQrcFile()) - Q_PRIVATE_SLOT(d_func(), void slotImportQrcFile()) - Q_PRIVATE_SLOT(d_func(), void slotRemoveQrcFile()) - Q_PRIVATE_SLOT(d_func(), void slotMoveUpQrcFile()) - Q_PRIVATE_SLOT(d_func(), void slotMoveDownQrcFile()) - - Q_PRIVATE_SLOT(d_func(), void slotNewPrefix()) - Q_PRIVATE_SLOT(d_func(), void slotAddFiles()) - Q_PRIVATE_SLOT(d_func(), void slotChangePrefix()) - Q_PRIVATE_SLOT(d_func(), void slotChangeLanguage()) - Q_PRIVATE_SLOT(d_func(), void slotChangeAlias()) - Q_PRIVATE_SLOT(d_func(), void slotClonePrefix()) - Q_PRIVATE_SLOT(d_func(), void slotRemove()) - Q_PRIVATE_SLOT(d_func(), void slotMoveUp()) - Q_PRIVATE_SLOT(d_func(), void slotMoveDown()) }; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/qtresourcemodel.cpp b/src/designer/src/lib/shared/qtresourcemodel.cpp index f24147cae..056f4e448 100644 --- a/src/designer/src/lib/shared/qtresourcemodel.cpp +++ b/src/designer/src/lib/shared/qtresourcemodel.cpp @@ -420,8 +420,8 @@ QtResourceModel::QtResourceModel(QObject *parent) : d_ptr->q_ptr = this; d_ptr->m_fileWatcher = new QFileSystemWatcher(this); - connect(d_ptr->m_fileWatcher, SIGNAL(fileChanged(QString)), - this, SLOT(slotFileChanged(QString))); + connect(d_ptr->m_fileWatcher, &QFileSystemWatcher::fileChanged, + this, [this](const QString &fileName) { d_ptr->slotFileChanged(fileName); }); } QtResourceModel::~QtResourceModel() diff --git a/src/designer/src/lib/shared/qtresourcemodel_p.h b/src/designer/src/lib/shared/qtresourcemodel_p.h index 110b4f292..43afe5c50 100644 --- a/src/designer/src/lib/shared/qtresourcemodel_p.h +++ b/src/designer/src/lib/shared/qtresourcemodel_p.h @@ -98,8 +98,6 @@ private: QScopedPointer<class QtResourceModelPrivate> d_ptr; Q_DECLARE_PRIVATE(QtResourceModel) Q_DISABLE_COPY_MOVE(QtResourceModel) - - Q_PRIVATE_SLOT(d_func(), void slotFileChanged(const QString &)) }; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp index acf21e15b..464ab55c4 100644 --- a/src/designer/src/lib/shared/qtresourceview.cpp +++ b/src/designer/src/lib/shared/qtresourceview.cpp @@ -533,20 +533,23 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare QIcon editIcon = QIcon::fromTheme(QStringLiteral("document-properties"), qdesigner_internal::createIconSet(QStringLiteral("edit.png"))); d_ptr->m_editResourcesAction = new QAction(editIcon, tr("Edit Resources..."), this); d_ptr->m_toolBar->addAction(d_ptr->m_editResourcesAction); - connect(d_ptr->m_editResourcesAction, SIGNAL(triggered()), this, SLOT(slotEditResources())); + connect(d_ptr->m_editResourcesAction, &QAction::triggered, + this, [this] { d_ptr->slotEditResources(); }); d_ptr->m_editResourcesAction->setEnabled(false); QIcon refreshIcon = QIcon::fromTheme(QStringLiteral("view-refresh"), qdesigner_internal::createIconSet(QStringLiteral("reload.png"))); d_ptr->m_reloadResourcesAction = new QAction(refreshIcon, tr("Reload"), this); d_ptr->m_toolBar->addAction(d_ptr->m_reloadResourcesAction); - connect(d_ptr->m_reloadResourcesAction, SIGNAL(triggered()), this, SLOT(slotReloadResources())); + connect(d_ptr->m_reloadResourcesAction, &QAction::triggered, + this, [this] { d_ptr->slotReloadResources(); }); d_ptr->m_reloadResourcesAction->setEnabled(false); #if QT_CONFIG(clipboard) QIcon copyIcon = QIcon::fromTheme(QStringLiteral("edit-copy"), qdesigner_internal::createIconSet(QStringLiteral("editcopy.png"))); d_ptr->m_copyResourcePathAction = new QAction(copyIcon, tr("Copy Path"), this); - connect(d_ptr->m_copyResourcePathAction, SIGNAL(triggered()), this, SLOT(slotCopyResourcePath())); + connect(d_ptr->m_copyResourcePathAction, &QAction::triggered, + this, [this] { d_ptr->slotCopyResourcePath(); }); d_ptr->m_copyResourcePathAction->setEnabled(false); #endif @@ -554,7 +557,8 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare QHBoxLayout *filterLayout = new QHBoxLayout(d_ptr->m_filterWidget); filterLayout->setContentsMargins(0, 0, 0, 0); QLineEdit *filterLineEdit = new QLineEdit(d_ptr->m_filterWidget); - connect(filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(slotFilterChanged(QString))); + connect(filterLineEdit, &QLineEdit::textChanged, + this, [this](const QString &text) { d_ptr->slotFilterChanged(text); }); filterLineEdit->setPlaceholderText(tr("Filter")); filterLineEdit->setClearButtonEnabled(true); filterLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored)); @@ -581,15 +585,15 @@ QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *pare d_ptr->m_listWidget->setIconSize(QSize(48, 48)); d_ptr->m_listWidget->setGridSize(QSize(64, 64)); - connect(d_ptr->m_treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), - this, SLOT(slotCurrentPathChanged(QTreeWidgetItem*))); - connect(d_ptr->m_listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), - this, SLOT(slotCurrentResourceChanged(QListWidgetItem*))); - connect(d_ptr->m_listWidget, SIGNAL(itemActivated(QListWidgetItem*)), - this, SLOT(slotResourceActivated(QListWidgetItem*))); + connect(d_ptr->m_treeWidget, &QTreeWidget::currentItemChanged, + this, [this](QTreeWidgetItem *item) { d_ptr->slotCurrentPathChanged(item); }); + connect(d_ptr->m_listWidget, &QListWidget::currentItemChanged, + this, [this](QListWidgetItem *item) { d_ptr->slotCurrentResourceChanged(item); }); + connect(d_ptr->m_listWidget, &QListWidget::itemActivated, + this, [this](QListWidgetItem *item) { d_ptr->slotResourceActivated(item); }); d_ptr->m_listWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(d_ptr->m_listWidget, SIGNAL(customContextMenuRequested(QPoint)), - this, SLOT(slotListWidgetContextMenuRequested(QPoint))); + connect(d_ptr->m_listWidget, &QListWidget::customContextMenuRequested, + this, [this](const QPoint &point) { d_ptr->slotListWidgetContextMenuRequested(point); }); } QtResourceView::~QtResourceView() @@ -668,10 +672,8 @@ void QtResourceView::setSettingsKey(const QString &key) void QtResourceView::setResourceModel(QtResourceModel *model) { - if (d_ptr->m_resourceModel) { - disconnect(d_ptr->m_resourceModel, SIGNAL(resourceSetActivated(QtResourceSet*,bool)), - this, SLOT(slotResourceSetActivated(QtResourceSet*))); - } + if (d_ptr->m_resourceModel) + disconnect(d_ptr->m_resourceModel, &QtResourceModel::resourceSetActivated, this, nullptr); // clear here d_ptr->m_treeWidget->clear(); @@ -682,8 +684,8 @@ void QtResourceView::setResourceModel(QtResourceModel *model) if (!d_ptr->m_resourceModel) return; - connect(d_ptr->m_resourceModel, SIGNAL(resourceSetActivated(QtResourceSet*,bool)), - this, SLOT(slotResourceSetActivated(QtResourceSet*))); + connect(d_ptr->m_resourceModel, &QtResourceModel::resourceSetActivated, + this, [this](QtResourceSet *resource) { d_ptr->slotResourceSetActivated(resource); }); // fill new here d_ptr->slotResourceSetActivated(d_ptr->m_resourceModel->currentResourceSet()); @@ -814,7 +816,8 @@ QtResourceViewDialog::QtResourceViewDialog(QDesignerFormEditorInterface *core, Q connect(d_ptr->m_box, &QDialogButtonBox::accepted, this, &QDialog::accept); connect(d_ptr->m_box, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(d_ptr->m_view, &QtResourceView::resourceActivated, this, &QDialog::accept); - connect(d_ptr->m_view, SIGNAL(resourceSelected(QString)), this, SLOT(slotResourceSelected(QString))); + connect(d_ptr->m_view, &QtResourceView::resourceSelected, + this, [this](const QString &resource) { d_ptr->slotResourceSelected(resource); }); d_ptr->setOkButtonEnabled(false); d_ptr->m_view->setResourceModel(core->resourceModel()); diff --git a/src/designer/src/lib/shared/qtresourceview_p.h b/src/designer/src/lib/shared/qtresourceview_p.h index 4cfae4c64..7d2ed6235 100644 --- a/src/designer/src/lib/shared/qtresourceview_p.h +++ b/src/designer/src/lib/shared/qtresourceview_p.h @@ -63,21 +63,9 @@ protected: bool event(QEvent *event) override; private: - QScopedPointer<class QtResourceViewPrivate> d_ptr; Q_DECLARE_PRIVATE(QtResourceView) Q_DISABLE_COPY_MOVE(QtResourceView) - Q_PRIVATE_SLOT(d_func(), void slotResourceSetActivated(QtResourceSet *)) - Q_PRIVATE_SLOT(d_func(), void slotCurrentPathChanged(QTreeWidgetItem *)) - Q_PRIVATE_SLOT(d_func(), void slotCurrentResourceChanged(QListWidgetItem *)) - Q_PRIVATE_SLOT(d_func(), void slotResourceActivated(QListWidgetItem *)) - Q_PRIVATE_SLOT(d_func(), void slotEditResources()) - Q_PRIVATE_SLOT(d_func(), void slotReloadResources()) -#if QT_CONFIG(clipboard) - Q_PRIVATE_SLOT(d_func(), void slotCopyResourcePath()) -#endif - Q_PRIVATE_SLOT(d_func(), void slotListWidgetContextMenuRequested(const QPoint &pos)) - Q_PRIVATE_SLOT(d_func(), void slotFilterChanged(const QString &pattern)) }; class QDESIGNER_SHARED_EXPORT QtResourceViewDialog : public QDialog @@ -97,7 +85,6 @@ private: QScopedPointer<class QtResourceViewDialogPrivate> d_ptr; Q_DECLARE_PRIVATE(QtResourceViewDialog) Q_DISABLE_COPY_MOVE(QtResourceViewDialog) - Q_PRIVATE_SLOT(d_func(), void slotResourceSelected(const QString &)) }; QT_END_NAMESPACE |