forked from qt-creator/qt-creator
AdvancedDockingSystem: Avoid using sender()
Change-Id: Iabc97c99046e1ebabddf988c675a51a93875ddf5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
This commit is contained in:
@@ -21,8 +21,6 @@
|
||||
|
||||
namespace ADS {
|
||||
|
||||
static const char *const g_locationProperty = "Location";
|
||||
|
||||
/**
|
||||
* Private data class of CDockWidgetTab class (pimpl)
|
||||
*/
|
||||
@@ -74,8 +72,9 @@ struct AutoHideTabPrivate
|
||||
QAction *createAutoHideToAction(const QString &title, SideBarLocation location, QMenu *menu)
|
||||
{
|
||||
auto action = menu->addAction(title);
|
||||
action->setProperty("Location", location);
|
||||
QObject::connect(action, &QAction::triggered, q, &AutoHideTab::onAutoHideToActionClicked);
|
||||
QObject::connect(action, &QAction::triggered, q, [this, location] {
|
||||
m_dockWidget->setAutoHide(true, location);
|
||||
});
|
||||
action->setEnabled(location != q->sideBarLocation());
|
||||
return action;
|
||||
}
|
||||
@@ -277,12 +276,6 @@ void AutoHideTab::requestCloseDockWidget()
|
||||
d->m_dockWidget->requestCloseDockWidget();
|
||||
}
|
||||
|
||||
void AutoHideTab::onAutoHideToActionClicked()
|
||||
{
|
||||
int location = sender()->property(g_locationProperty).toInt();
|
||||
d->m_dockWidget->setAutoHide(true, (SideBarLocation) location);
|
||||
}
|
||||
|
||||
void AutoHideTab::setSideBar(AutoHideSideBar *sideTabBar)
|
||||
{
|
||||
d->m_sideBar = sideTabBar;
|
||||
|
@@ -38,8 +38,6 @@ private:
|
||||
friend class DockContainerWidget;
|
||||
friend DockContainerWidgetPrivate;
|
||||
|
||||
void onAutoHideToActionClicked();
|
||||
|
||||
protected:
|
||||
void setSideBar(AutoHideSideBar *sideTabBar);
|
||||
void removeFromSideBar();
|
||||
|
@@ -35,8 +35,6 @@
|
||||
|
||||
namespace ADS {
|
||||
|
||||
static const char *const g_locationProperty = "Location";
|
||||
|
||||
/**
|
||||
* Private data class of DockAreaTitleBar class (pimpl)
|
||||
*/
|
||||
@@ -125,11 +123,9 @@ public:
|
||||
QAction *createAutoHideToAction(const QString &title, SideBarLocation location, QMenu *menu)
|
||||
{
|
||||
auto action = menu->addAction(title);
|
||||
action->setProperty("Location", location);
|
||||
QObject::connect(action,
|
||||
&QAction::triggered,
|
||||
q,
|
||||
&DockAreaTitleBar::onAutoHideToActionClicked);
|
||||
QObject::connect(action, &QAction::triggered, q, [this, location] {
|
||||
m_dockArea->toggleAutoHide(location);
|
||||
});
|
||||
return action;
|
||||
}
|
||||
}; // class DockAreaTitleBarPrivate
|
||||
@@ -526,12 +522,6 @@ void DockAreaTitleBar::onAutoHideDockAreaActionClicked()
|
||||
d->m_dockArea->toggleAutoHide();
|
||||
}
|
||||
|
||||
void DockAreaTitleBar::onAutoHideToActionClicked()
|
||||
{
|
||||
int location = sender()->property(g_locationProperty).toInt();
|
||||
d->m_dockArea->toggleAutoHide((SideBarLocation) location);
|
||||
}
|
||||
|
||||
TitleBarButton *DockAreaTitleBar::button(eTitleBarButton which) const
|
||||
{
|
||||
switch (which) {
|
||||
|
@@ -89,7 +89,6 @@ private:
|
||||
void onCurrentTabChanged(int index);
|
||||
void onAutoHideButtonClicked();
|
||||
void onAutoHideDockAreaActionClicked();
|
||||
void onAutoHideToActionClicked();
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
@@ -35,7 +35,6 @@
|
||||
|
||||
namespace ADS {
|
||||
|
||||
static const char *const g_locationProperty = "Location";
|
||||
using TabLabelType = ElidingLabel;
|
||||
|
||||
/**
|
||||
@@ -181,8 +180,9 @@ public:
|
||||
QAction *createAutoHideToAction(const QString &title, SideBarLocation location, QMenu *menu)
|
||||
{
|
||||
auto action = menu->addAction(title);
|
||||
action->setProperty("Location", location);
|
||||
QObject::connect(action, &QAction::triggered, q, &DockWidgetTab::onAutoHideToActionClicked);
|
||||
QObject::connect(action, &QAction::triggered, q, [this, location] {
|
||||
m_dockWidget->toggleAutoHide(location);
|
||||
});
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -656,12 +656,6 @@ void DockWidgetTab::autoHideDockWidget()
|
||||
d->m_dockWidget->setAutoHide(true);
|
||||
}
|
||||
|
||||
void DockWidgetTab::onAutoHideToActionClicked()
|
||||
{
|
||||
int location = sender()->property(g_locationProperty).toInt();
|
||||
d->m_dockWidget->toggleAutoHide((SideBarLocation) location);
|
||||
}
|
||||
|
||||
bool DockWidgetTab::event(QEvent *event)
|
||||
{
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
|
@@ -55,7 +55,6 @@ private:
|
||||
void onDockWidgetFeaturesChanged();
|
||||
void detachDockWidget();
|
||||
void autoHideDockWidget();
|
||||
void onAutoHideToActionClicked();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
|
Reference in New Issue
Block a user