From 13853573ea51f9f0e682f7d005ca4443398512ae Mon Sep 17 00:00:00 2001 From: Walter Bormans Date: Fri, 22 Jan 2021 06:18:34 +0100 Subject: [PATCH] Additional Qt keyword conversion. (#299) This comit is an addtion to pull request #295. Not all Qt keywords were included. Co-authored-by: Walter Bormans --- src/DockAreaTabBar.cpp | 18 +++++++++--------- src/DockAreaTabBar.h | 6 +++--- src/DockAreaTitleBar.cpp | 2 +- src/DockAreaTitleBar.h | 6 +++--- src/DockAreaWidget.cpp | 8 ++++---- src/DockAreaWidget.h | 8 ++++---- src/DockContainerWidget.cpp | 6 +++--- src/DockFocusController.cpp | 4 ++-- src/DockFocusController.h | 4 ++-- src/DockManager.cpp | 26 +++++++++++++------------- src/DockWidget.cpp | 18 +++++++++--------- src/DockWidgetTab.cpp | 6 +++--- src/DockWidgetTab.h | 6 +++--- src/ElidingLabel.cpp | 6 +++--- src/ElidingLabel.h | 2 +- src/FloatingDragPreview.cpp | 2 +- src/FloatingDragPreview.h | 4 ++-- 17 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/DockAreaTabBar.cpp b/src/DockAreaTabBar.cpp index 842e3da..d06313a 100644 --- a/src/DockAreaTabBar.cpp +++ b/src/DockAreaTabBar.cpp @@ -180,11 +180,11 @@ void CDockAreaTabBar::setCurrentIndex(int index) return; } - emit currentChanging(index); + Q_EMIT currentChanging(index); d->CurrentIndex = index; d->updateTabs(); updateGeometry(); - emit currentChanged(index); + Q_EMIT currentChanged(index); } @@ -206,7 +206,7 @@ void CDockAreaTabBar::insertTab(int Index, CDockWidgetTab* Tab) connect(Tab, SIGNAL(moved(const QPoint&)), this, SLOT(onTabWidgetMoved(const QPoint&))); connect(Tab, SIGNAL(elidedChanged(bool)), this, SIGNAL(elidedChanged(bool))); Tab->installEventFilter(this); - emit tabInserted(Index); + Q_EMIT tabInserted(Index); if (Index <= d->CurrentIndex) { setCurrentIndex(d->CurrentIndex + 1); @@ -266,7 +266,7 @@ void CDockAreaTabBar::removeTab(CDockWidgetTab* Tab) } } - emit removingTab(RemoveIndex); + Q_EMIT removingTab(RemoveIndex); d->TabsLayout->removeWidget(Tab); Tab->disconnect(this); Tab->removeEventFilter(this); @@ -320,7 +320,7 @@ void CDockAreaTabBar::onTabClicked() return; } setCurrentIndex(index); - emit tabBarClicked(index); + Q_EMIT tabBarClicked(index); } @@ -409,7 +409,7 @@ void CDockAreaTabBar::onTabWidgetMoved(const QPoint& GlobalPos) d->TabsLayout->removeWidget(MovingTab); d->TabsLayout->insertWidget(toIndex, MovingTab); ADS_PRINT("tabMoved from " << fromIndex << " to " << toIndex); - emit tabMoved(fromIndex, toIndex); + Q_EMIT tabMoved(fromIndex, toIndex); setCurrentIndex(toIndex); } else @@ -432,7 +432,7 @@ void CDockAreaTabBar::closeTab(int Index) { return; } - emit tabCloseRequested(Index); + Q_EMIT tabCloseRequested(Index); } @@ -449,12 +449,12 @@ bool CDockAreaTabBar::eventFilter(QObject *watched, QEvent *event) switch (event->type()) { case QEvent::Hide: - emit tabClosed(d->TabsLayout->indexOf(Tab)); + Q_EMIT tabClosed(d->TabsLayout->indexOf(Tab)); updateGeometry(); break; case QEvent::Show: - emit tabOpened(d->TabsLayout->indexOf(Tab)); + Q_EMIT tabOpened(d->TabsLayout->indexOf(Tab)); updateGeometry(); break; diff --git a/src/DockAreaTabBar.h b/src/DockAreaTabBar.h index c8f71d2..781f5e9 100644 --- a/src/DockAreaTabBar.h +++ b/src/DockAreaTabBar.h @@ -58,7 +58,7 @@ private: friend struct DockAreaTabBarPrivate; friend class CDockAreaTitleBar; -private slots: +private Q_SLOTS: void onTabClicked(); void onTabCloseRequested(); void onCloseOtherTabsRequested(); @@ -140,7 +140,7 @@ public: */ virtual QSize sizeHint() const override; -public slots: +public Q_SLOTS: /** * This property sets the index of the tab bar's visible tab */ @@ -152,7 +152,7 @@ public slots: */ void closeTab(int Index); -signals: +Q_SIGNALS: /** * This signal is emitted when the tab bar's current tab is about to be changed. The new * current has the given index, or -1 if there isn't a new one. diff --git a/src/DockAreaTitleBar.cpp b/src/DockAreaTitleBar.cpp index 8d13690..7fbb01a 100644 --- a/src/DockAreaTitleBar.cpp +++ b/src/DockAreaTitleBar.cpp @@ -382,7 +382,7 @@ void CDockAreaTitleBar::onTabsMenuActionTriggered(QAction* Action) { int Index = Action->data().toInt(); d->TabBar->setCurrentIndex(Index); - emit tabBarClicked(Index); + Q_EMIT tabBarClicked(Index); } diff --git a/src/DockAreaTitleBar.h b/src/DockAreaTitleBar.h index 279f779..37f3a91 100644 --- a/src/DockAreaTitleBar.h +++ b/src/DockAreaTitleBar.h @@ -54,7 +54,7 @@ private: DockAreaTitleBarPrivate* d; ///< private data (pimpl) friend struct DockAreaTitleBarPrivate; -private slots: +private Q_SLOTS: void onTabsMenuAboutToShow(); void onCloseButtonClicked(); void onUndockButtonClicked(); @@ -88,7 +88,7 @@ protected: */ virtual void contextMenuEvent(QContextMenuEvent *event) override; -public slots: +public Q_SLOTS: /** * Call this slot to tell the title bar that it should update the tabs menu * the next time it is shown. @@ -148,7 +148,7 @@ public: */ int indexOf(QWidget *widget) const; -signals: +Q_SIGNALS: /** * This signal is emitted if a tab in the tab bar is clicked by the user * or if the user clicks on a tab item in the title bar tab menu. diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 2f32cdb..01914aa 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -378,7 +378,7 @@ CDockAreaWidget::CDockAreaWidget(CDockManager* DockManager, CDockContainerWidget d->ContentsLayout = new DockAreaLayout(d->Layout); if (d->DockManager) { - emit d->DockManager->dockAreaCreated(this); + Q_EMIT d->DockManager->dockAreaCreated(this); } } @@ -604,11 +604,11 @@ void CDockAreaWidget::setCurrentIndex(int index) return; } - emit currentChanging(index); + Q_EMIT currentChanging(index); TabBar->setCurrentIndex(index); d->ContentsLayout->setCurrentIndex(index); d->ContentsLayout->currentWidget()->show(); - emit currentChanged(index); + Q_EMIT currentChanged(index); } @@ -888,7 +888,7 @@ void CDockAreaWidget::toggleView(bool Open) { setVisible(Open); - emit viewToggled(Open); + Q_EMIT viewToggled(Open); } diff --git a/src/DockAreaWidget.h b/src/DockAreaWidget.h index ac7dcb5..a702370 100644 --- a/src/DockAreaWidget.h +++ b/src/DockAreaWidget.h @@ -67,7 +67,7 @@ private: friend class CDockManager; void onDockWidgetFeaturesChanged(); -private slots: +private Q_SLOTS: void onTabCloseRequested(int Index); /** @@ -138,7 +138,7 @@ protected: */ void markTitleBarMenuOutdated(); -protected slots: +protected Q_SLOTS: void toggleView(bool Open); public: @@ -312,7 +312,7 @@ public: */ bool isCentralWidgetArea() const; -public slots: +public Q_SLOTS: /** * This activates the tab for the given tab index. * If the dock widget for the given tab is not visible, the this function @@ -330,7 +330,7 @@ public slots: */ void closeOtherAreas(); -signals: +Q_SIGNALS: /** * This signal is emitted when user clicks on a tab at an index. */ diff --git a/src/DockContainerWidget.cpp b/src/DockContainerWidget.cpp index 107180c..0868c86 100644 --- a/src/DockContainerWidget.cpp +++ b/src/DockContainerWidget.cpp @@ -284,13 +284,13 @@ public: void emitDockAreasRemoved() { onVisibleDockAreaCountChanged(); - emit _this->dockAreasRemoved(); + Q_EMIT _this->dockAreasRemoved(); } void emitDockAreasAdded() { onVisibleDockAreaCountChanged(); - emit _this->dockAreasAdded(); + Q_EMIT _this->dockAreasAdded(); } /** @@ -341,7 +341,7 @@ public: CDockAreaWidget* DockArea = qobject_cast(_this->sender()); VisibleDockAreaCount += Visible ? 1 : -1; onVisibleDockAreaCountChanged(); - emit _this->dockAreaViewToggled(DockArea, Visible); + Q_EMIT _this->dockAreaViewToggled(DockArea, Visible); } }; // struct DockContainerWidgetPrivate diff --git a/src/DockFocusController.cpp b/src/DockFocusController.cpp index 6f3318a..c36f91b 100644 --- a/src/DockFocusController.cpp +++ b/src/DockFocusController.cpp @@ -174,7 +174,7 @@ void DockFocusControllerPrivate::updateDockWidgetFocus(CDockWidget* DockWidget) ForceFocusChangedSignal = false; if (DockWidget->isVisible()) { - emit DockManager->focusedDockWidgetChanged(old, DockWidget); + Q_EMIT DockManager->focusedDockWidgetChanged(old, DockWidget); } else { @@ -193,7 +193,7 @@ void CDockFocusController::onDockWidgetVisibilityChanged(bool Visible) disconnect(Sender, SIGNAL(visibilityChanged(bool)), this, SLOT(onDockWidgetVisibilityChanged(bool))); if (DockWidget && Visible) { - emit d->DockManager->focusedDockWidgetChanged(d->OldFocusedDockWidget, DockWidget); + Q_EMIT d->DockManager->focusedDockWidgetChanged(d->OldFocusedDockWidget, DockWidget); } } diff --git a/src/DockFocusController.h b/src/DockFocusController.h index f6b0af5..0a354ef 100644 --- a/src/DockFocusController.h +++ b/src/DockFocusController.h @@ -30,7 +30,7 @@ private: DockFocusControllerPrivate* d; ///< private data (pimpl) friend struct DockFocusControllerPrivate; -private slots: +private Q_SLOTS: void onApplicationFocusChanged(QWidget *old, QWidget *now); void onFocusedDockAreaViewToggled(bool Open); void onStateRestored(); @@ -83,7 +83,7 @@ public: */ CDockWidget* focusedDockWidget() const; -public slots: +public Q_SLOTS: /** * Request a focus change to the given dock widget */ diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 9ef4a08..4b14f9a 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -343,7 +343,7 @@ void DockManagerPrivate::restoreDockWidgetsOpenState() if (DockWidget->property(internal::DirtyProperty).toBool()) { DockWidget->flagAsUnassigned(); - emit DockWidget->viewToggled(false); + Q_EMIT DockWidget->viewToggled(false); } else { @@ -582,7 +582,7 @@ bool CDockManager::eventFilter(QObject *obj, QEvent *e) void CDockManager::registerFloatingWidget(CFloatingDockContainer* FloatingWidget) { d->FloatingWidgets.append(FloatingWidget); - emit floatingWidgetCreated(FloatingWidget); + Q_EMIT floatingWidgetCreated(FloatingWidget); ADS_PRINT("d->FloatingWidgets.count() " << d->FloatingWidgets.count()); } @@ -699,14 +699,14 @@ bool CDockManager::restoreState(const QByteArray &state, int version) hide(); } d->RestoringState = true; - emit restoringState(); + Q_EMIT restoringState(); bool Result = d->restoreState(state, version); d->RestoringState = false; if (!IsHidden) { show(); } - emit stateRestored(); + Q_EMIT stateRestored(); return Result; } @@ -732,7 +732,7 @@ CFloatingDockContainer* CDockManager::addDockWidgetFloating(CDockWidget* Dockwid { d->UninitializedFloatingWidgets.append(FloatingWidget); } - emit dockWidgetAdded(Dockwidget); + Q_EMIT dockWidgetAdded(Dockwidget); return FloatingWidget; } @@ -761,7 +761,7 @@ CDockAreaWidget* CDockManager::addDockWidget(DockWidgetArea area, d->DockWidgetsMap.insert(Dockwidget->objectName(), Dockwidget); auto Container = DockAreaWidget ? DockAreaWidget->dockContainer(): this; auto AreaOfAddedDockWidget = Container->addDockWidget(area, Dockwidget, DockAreaWidget); - emit dockWidgetAdded(Dockwidget); + Q_EMIT dockWidgetAdded(Dockwidget); return AreaOfAddedDockWidget; } @@ -803,11 +803,11 @@ CDockWidget* CDockManager::findDockWidget(const QString& ObjectName) const //============================================================================ void CDockManager::removeDockWidget(CDockWidget* Dockwidget) { - emit dockWidgetAboutToBeRemoved(Dockwidget); + Q_EMIT dockWidgetAboutToBeRemoved(Dockwidget); d->DockWidgetsMap.remove(Dockwidget->objectName()); CDockContainerWidget::removeDockWidget(Dockwidget); Dockwidget->setDockManager(nullptr); - emit dockWidgetRemoved(Dockwidget); + Q_EMIT dockWidgetRemoved(Dockwidget); } //============================================================================ @@ -821,7 +821,7 @@ QMap CDockManager::dockWidgetsMap() const void CDockManager::addPerspective(const QString& UniquePrespectiveName) { d->Perspectives.insert(UniquePrespectiveName, saveState()); - emit perspectiveListChanged(); + Q_EMIT perspectiveListChanged(); } @@ -843,8 +843,8 @@ void CDockManager::removePerspectives(const QStringList& Names) if (Count) { - emit perspectivesRemoved(); - emit perspectiveListChanged(); + Q_EMIT perspectivesRemoved(); + Q_EMIT perspectiveListChanged(); } } @@ -865,9 +865,9 @@ void CDockManager::openPerspective(const QString& PerspectiveName) return; } - emit openingPerspective(PerspectiveName); + Q_EMIT openingPerspective(PerspectiveName); restoreState(Iterator.value()); - emit perspectiveOpened(PerspectiveName); + Q_EMIT perspectiveOpened(PerspectiveName); } diff --git a/src/DockWidget.cpp b/src/DockWidget.cpp index 8b66218..1d251a0 100644 --- a/src/DockWidget.cpp +++ b/src/DockWidget.cpp @@ -338,7 +338,7 @@ void CDockWidget::setFeatures(DockWidgetFeatures features) return; } d->Features = features; - emit featuresChanged(d->Features); + Q_EMIT featuresChanged(d->Features); d->TabWidget->onDockWidgetFeaturesChanged(); if(CDockAreaWidget* DockArea = dockAreaWidget()) DockArea->onDockWidgetFeaturesChanged(); @@ -538,9 +538,9 @@ void CDockWidget::toggleViewInternal(bool Open) if (!Open) { - emit closed(); + Q_EMIT closed(); } - emit viewToggled(Open); + Q_EMIT viewToggled(Open); } @@ -580,11 +580,11 @@ bool CDockWidget::event(QEvent *e) switch (e->type()) { case QEvent::Hide: - emit visibilityChanged(false); + Q_EMIT visibilityChanged(false); break; case QEvent::Show: - emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0); + Q_EMIT visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0); break; case QEvent::WindowTitleChange : @@ -602,7 +602,7 @@ bool CDockWidget::event(QEvent *e) { d->DockArea->markTitleBarMenuOutdated();//update tabs menu } - emit titleChanged(title); + Q_EMIT titleChanged(title); } break; @@ -785,7 +785,7 @@ void CDockWidget::emitTopLevelChanged(bool Floating) if (Floating != d->IsFloatingTopLevel) { d->IsFloatingTopLevel = Floating; - emit topLevelChanged(d->IsFloatingTopLevel); + Q_EMIT topLevelChanged(d->IsFloatingTopLevel); } } @@ -843,7 +843,7 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose) { if (!ForceClose) { - emit closeRequested(); + Q_EMIT closeRequested(); } if (!ForceClose && features().testFlag(CDockWidget::CustomCloseHandling)) @@ -869,7 +869,7 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose) } } deleteDockWidget(); - emit closed(); + Q_EMIT closed(); } else { diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp index 94dcd87..2f1113f 100644 --- a/src/DockWidgetTab.cpp +++ b/src/DockWidgetTab.cpp @@ -353,7 +353,7 @@ void CDockWidgetTab::mousePressEvent(QMouseEvent* ev) ev->accept(); d->saveDragStartMousePosition(internal::globalPositionOf(ev)); d->DragState = DraggingMousePressed; - emit clicked(); + Q_EMIT clicked(); return; } Super::mousePressEvent(ev); @@ -377,7 +377,7 @@ void CDockWidgetTab::mouseReleaseEvent(QMouseEvent* ev) // End of tab moving, emit signal if (d->DockArea) { - emit moved(internal::globalPositionOf(ev)); + Q_EMIT moved(internal::globalPositionOf(ev)); } break; @@ -538,7 +538,7 @@ void CDockWidgetTab::setActiveTab(bool active) update(); updateGeometry(); - emit activeTabChanged(); + Q_EMIT activeTabChanged(); } diff --git a/src/DockWidgetTab.h b/src/DockWidgetTab.h index 6135cc7..7ee45e3 100644 --- a/src/DockWidgetTab.h +++ b/src/DockWidgetTab.h @@ -60,7 +60,7 @@ private: friend class CDockManager; void onDockWidgetFeaturesChanged(); -private slots: +private Q_SLOTS: void detachDockWidget(); protected: @@ -175,10 +175,10 @@ public: */ void setIconSize(const QSize& Size); -public slots: +public Q_SLOTS: virtual void setVisible(bool visible) override; -signals: +Q_SIGNALS: void activeTabChanged(); void clicked(); void closeRequested(); diff --git a/src/ElidingLabel.cpp b/src/ElidingLabel.cpp index 75dc289..1aab918 100644 --- a/src/ElidingLabel.cpp +++ b/src/ElidingLabel.cpp @@ -74,7 +74,7 @@ void ElidingLabelPrivate::elideText(int Width) IsElided = str != Text; if(IsElided != WasElided) { - emit _this->elidedChanged(IsElided); + Q_EMIT _this->elidedChanged(IsElided); } _this->QLabel::setText(str); } @@ -136,7 +136,7 @@ void CElidingLabel::mouseReleaseEvent(QMouseEvent* event) return; } - emit clicked(); + Q_EMIT clicked(); } @@ -144,7 +144,7 @@ void CElidingLabel::mouseReleaseEvent(QMouseEvent* event) void CElidingLabel::mouseDoubleClickEvent( QMouseEvent *ev ) { Q_UNUSED(ev) - emit doubleClicked(); + Q_EMIT doubleClicked(); Super::mouseDoubleClickEvent(ev); } diff --git a/src/ElidingLabel.h b/src/ElidingLabel.h index 7db7de5..894dcb0 100644 --- a/src/ElidingLabel.h +++ b/src/ElidingLabel.h @@ -84,7 +84,7 @@ public: // reimplements QLabel ---------------------------------------------- void setText(const QString &text); QString text() const; -signals: +Q_SIGNALS: /** * This signal is emitted if the user clicks on the label (i.e. pressed * down then released while the mouse cursor is inside the label) diff --git a/src/FloatingDragPreview.cpp b/src/FloatingDragPreview.cpp index 8d222d3..c6ceb1a 100644 --- a/src/FloatingDragPreview.cpp +++ b/src/FloatingDragPreview.cpp @@ -60,7 +60,7 @@ struct FloatingDragPreviewPrivate void cancelDragging() { Canceled = true; - emit _this->draggingCanceled(); + Q_EMIT _this->draggingCanceled(); DockManager->containerOverlay()->hideOverlay(); DockManager->dockAreaOverlay()->hideOverlay(); _this->close(); diff --git a/src/FloatingDragPreview.h b/src/FloatingDragPreview.h index d8c14b1..3822480 100644 --- a/src/FloatingDragPreview.h +++ b/src/FloatingDragPreview.h @@ -32,7 +32,7 @@ private: FloatingDragPreviewPrivate* d; friend struct FloatingDragPreviewPrivate; -private slots: +private Q_SLOTS: /** * Cancel non opaque undocking if application becomes inactive */ @@ -92,7 +92,7 @@ public: // implements IFloatingWidget ----------------------------------------- */ virtual void finishDragging() override; -signals: +Q_SIGNALS: /** * This signal is emitted, if dragging has been canceled by escape key * or by active application switching via task manager