mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +08:00
Added test for CDockWidget::setWindowTitle function
This commit is contained in:
parent
0d242297ff
commit
e6e83d5775
@ -165,6 +165,7 @@ struct MainWindowPrivate
|
|||||||
QWidgetAction* PerspectiveListAction = nullptr;
|
QWidgetAction* PerspectiveListAction = nullptr;
|
||||||
QComboBox* PerspectiveComboBox = nullptr;
|
QComboBox* PerspectiveComboBox = nullptr;
|
||||||
ads::CDockManager* DockManager = nullptr;
|
ads::CDockManager* DockManager = nullptr;
|
||||||
|
ads::CDockWidget* WindowTitleTestDockWidget = nullptr;
|
||||||
|
|
||||||
MainWindowPrivate(CMainWindow* _public) : _this(_public) {}
|
MainWindowPrivate(CMainWindow* _public) : _this(_public) {}
|
||||||
|
|
||||||
@ -382,6 +383,7 @@ void MainWindowPrivate::createContent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
DockWidget = createLongTextLabelDockWidget();
|
DockWidget = createLongTextLabelDockWidget();
|
||||||
|
WindowTitleTestDockWidget = DockWidget;
|
||||||
DockWidget->setFeature(ads::CDockWidget::DockWidgetFocusable, false);
|
DockWidget->setFeature(ads::CDockWidget::DockWidgetFocusable, false);
|
||||||
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
|
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
|
||||||
auto FileSystemWidget = createFileSystemTreeDockWidget();
|
auto FileSystemWidget = createFileSystemTreeDockWidget();
|
||||||
@ -496,6 +498,9 @@ void MainWindowPrivate::createActions()
|
|||||||
ui.menuTests->addSeparator();
|
ui.menuTests->addSeparator();
|
||||||
a = ui.menuTests->addAction("Show Status Dialog");
|
a = ui.menuTests->addAction("Show Status Dialog");
|
||||||
_this->connect(a, SIGNAL(triggered()), SLOT(showStatusDialog()));
|
_this->connect(a, SIGNAL(triggered()), SLOT(showStatusDialog()));
|
||||||
|
|
||||||
|
a = ui.menuTests->addAction("Toggle Label 0 Window Title");
|
||||||
|
_this->connect(a, SIGNAL(triggered()), SLOT(toggleDockWidgetWindowTitle()));
|
||||||
ui.menuTests->addSeparator();
|
ui.menuTests->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -745,3 +750,20 @@ void CMainWindow::showStatusDialog()
|
|||||||
Dialog.exec();
|
Dialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//============================================================================
|
||||||
|
void CMainWindow::toggleDockWidgetWindowTitle()
|
||||||
|
{
|
||||||
|
QString Title = d->WindowTitleTestDockWidget->windowTitle();
|
||||||
|
int i = Title.indexOf(" (Test)");
|
||||||
|
if (-1 == i)
|
||||||
|
{
|
||||||
|
Title += " (Test)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Title = Title.left(i);
|
||||||
|
}
|
||||||
|
d->WindowTitleTestDockWidget->setWindowTitle(Title);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ private slots:
|
|||||||
void createTable();
|
void createTable();
|
||||||
void onEditorCloseRequested();
|
void onEditorCloseRequested();
|
||||||
void showStatusDialog();
|
void showStatusDialog();
|
||||||
|
void toggleDockWidgetWindowTitle();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user