mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-26 08:01:32 +08:00
Updated README.md to use the new factory function CDockManager::createDockWidget()
This commit is contained in:
parent
f41a6f06fe
commit
0a55bcd586
@ -462,7 +462,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
// Create the dock manager after the ui is setup. Because the
|
// Create the dock manager after the ui is setup. Because the
|
||||||
// parent parameter is a QMainWindow the dock manager registers
|
// parent parameter is a QMainWindow the dock manager registers
|
||||||
// itself as the central widget as such the ui must be set up first.
|
// itself as the central widget as such the ui must be set up first.
|
||||||
m_DockManager = new ads::CDockManager(this);
|
DockManager = new ads::CDockManager(this);
|
||||||
|
|
||||||
// Create example content label - this can be any application specific
|
// Create example content label - this can be any application specific
|
||||||
// widget
|
// widget
|
||||||
@ -473,7 +473,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
// Create a dock widget with the title Label 1 and set the created label
|
// Create a dock widget with the title Label 1 and set the created label
|
||||||
// as the dock widget content
|
// as the dock widget content
|
||||||
ads::CDockWidget* DockWidget = new ads::CDockWidget("Label 1");
|
ads::CDockWidget* DockWidget = DockManager->createDockWidget("Label 1");
|
||||||
DockWidget->setWidget(l);
|
DockWidget->setWidget(l);
|
||||||
|
|
||||||
// Add the toggleViewAction of the dock widget to the menu to give
|
// Add the toggleViewAction of the dock widget to the menu to give
|
||||||
@ -481,7 +481,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->menuView->addAction(DockWidget->toggleViewAction());
|
ui->menuView->addAction(DockWidget->toggleViewAction());
|
||||||
|
|
||||||
// Add the dock widget to the top dock widget area
|
// Add the dock widget to the top dock widget area
|
||||||
m_DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget);
|
DockManager->addDockWidget(ads::TopDockWidgetArea, DockWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
Loading…
Reference in New Issue
Block a user