diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-10 16:27:04 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-07-13 09:59:50 +0000 |
commit | 710e94a886a2cd870debd9f01db4b4fb393f4865 (patch) | |
tree | af21e8654bb93c95d6e48e71f2ec0f1227da85cf | |
parent | 4b7438e7dfea75d881c0412ef34c08382361625e (diff) | |
download | qttools-710e94a886a2cd870debd9f01db4b4fb393f4865.tar.gz |
Qt Designer: Disambiguate signal/slot names in action editor.
Classes ActionListView/ActionTreeView overload the signals/slots
of the item views they inherit with action parameters, making
porting to the new signals&slot connection syntax unnecessarily
difficult. Change the names to contain the word action.
Change-Id: If8b9433e6ec14c5d68ee228a710c70057457324e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
-rw-r--r-- | src/designer/src/lib/shared/actionrepository.cpp | 30 | ||||
-rw-r--r-- | src/designer/src/lib/shared/actionrepository_p.h | 12 |
2 files changed, 22 insertions, 20 deletions
diff --git a/src/designer/src/lib/shared/actionrepository.cpp b/src/designer/src/lib/shared/actionrepository.cpp index e7b6c6267..b4b4e2df9 100644 --- a/src/designer/src/lib/shared/actionrepository.cpp +++ b/src/designer/src/lib/shared/actionrepository.cpp @@ -381,23 +381,23 @@ void ActionTreeView::focusInEvent(QFocusEvent *event) QTreeView::focusInEvent(event); // Make property editor display current action if (QAction *a = currentAction()) - emit currentChanged(a); + emit currentActionChanged(a); } void ActionTreeView::contextMenuEvent(QContextMenuEvent *event) { - emit contextMenuRequested(event, m_model->actionAt(indexAt(event->pos()))); + emit actionContextMenuRequested(event, m_model->actionAt(indexAt(event->pos()))); } void ActionTreeView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { - emit currentChanged(m_model->actionAt(current)); + emit currentActionChanged(m_model->actionAt(current)); QTreeView::currentChanged(current, previous); } void ActionTreeView::slotActivated(const QModelIndex &index) { - emit activated(m_model->actionAt(index)); + emit actionActivated(m_model->actionAt(index)); } void ActionTreeView::startDrag(Qt::DropActions supportedActions) @@ -463,23 +463,23 @@ void ActionListView::focusInEvent(QFocusEvent *event) QListView::focusInEvent(event); // Make property editor display current action if (QAction *a = currentAction()) - emit currentChanged(a); + emit currentActionChanged(a); } void ActionListView::contextMenuEvent(QContextMenuEvent *event) { - emit contextMenuRequested(event, m_model->actionAt(indexAt(event->pos()))); + emit actionContextMenuRequested(event, m_model->actionAt(indexAt(event->pos()))); } void ActionListView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { - emit currentChanged(m_model->actionAt(current)); + emit currentActionChanged(m_model->actionAt(current)); QListView::currentChanged(current, previous); } void ActionListView::slotActivated(const QModelIndex &index) { - emit activated(m_model->actionAt(index)); + emit actionActivated(m_model->actionAt(index)); } void ActionListView::startDrag(Qt::DropActions supportedActions) @@ -497,18 +497,20 @@ ActionView::ActionView(QWidget *parent) : addWidget(m_actionListView); addWidget(m_actionTreeView); // Wire signals - connect(m_actionTreeView, SIGNAL(contextMenuRequested(QContextMenuEvent*,QAction*)), + connect(m_actionTreeView, SIGNAL(actionContextMenuRequested(QContextMenuEvent*,QAction*)), this, SIGNAL(contextMenuRequested(QContextMenuEvent*,QAction*))); - connect(m_actionListView, SIGNAL(contextMenuRequested(QContextMenuEvent*,QAction*)), + connect(m_actionListView, SIGNAL(actionContextMenuRequested(QContextMenuEvent*,QAction*)), this, SIGNAL(contextMenuRequested(QContextMenuEvent*,QAction*))); // make it possible for vs integration to reimplement edit action dialog // [which it shouldn't do actually] - connect(m_actionListView, SIGNAL(activated(QAction*)), this, SIGNAL(activated(QAction*))); - connect(m_actionTreeView, SIGNAL(activated(QAction*)), this, SIGNAL(activated(QAction*))); + connect(m_actionListView, SIGNAL(actionActivated(QAction*)), this, SIGNAL(activated(QAction*))); + connect(m_actionTreeView, SIGNAL(actionActivated(QAction*)), this, SIGNAL(activated(QAction*))); - connect(m_actionListView, SIGNAL(currentChanged(QAction*)),this, SLOT(slotCurrentChanged(QAction*))); - connect(m_actionTreeView, SIGNAL(currentChanged(QAction*)),this, SLOT(slotCurrentChanged(QAction*))); + connect(m_actionListView, SIGNAL(currentActionChanged(QAction*)), + this, SLOT(slotCurrentChanged(QAction*))); + connect(m_actionTreeView, SIGNAL(currentActionChanged(QAction*)), + this, SLOT(slotCurrentChanged(QAction*))); connect(m_model, SIGNAL(resourceImageDropped(QString,QAction*)), this, SIGNAL(resourceImageDropped(QString,QAction*))); diff --git a/src/designer/src/lib/shared/actionrepository_p.h b/src/designer/src/lib/shared/actionrepository_p.h index 76a06720f..0bfe8b370 100644 --- a/src/designer/src/lib/shared/actionrepository_p.h +++ b/src/designer/src/lib/shared/actionrepository_p.h @@ -127,9 +127,9 @@ public slots: void filter(const QString &text); signals: - void contextMenuRequested(QContextMenuEvent *event, QAction *); - void currentChanged(QAction *action); - void activated(QAction *action); + void actionContextMenuRequested(QContextMenuEvent *event, QAction *); + void currentActionChanged(QAction *action); + void actionActivated(QAction *action); protected slots: void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; @@ -161,9 +161,9 @@ public slots: void filter(const QString &text); signals: - void contextMenuRequested(QContextMenuEvent *event, QAction *); - void currentChanged(QAction *action); - void activated(QAction *action); + void actionContextMenuRequested(QContextMenuEvent *event, QAction *); + void currentActionChanged(QAction *action); + void actionActivated(QAction *action); protected slots: void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) Q_DECL_OVERRIDE; |