mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 07:31:33 +08:00
Updated centralwidget example
This commit is contained in:
parent
6eb497fb64
commit
e0f6f3013f
@ -15,6 +15,7 @@
|
|||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QPlainTextEdit>
|
||||||
|
|
||||||
#include "DockAreaWidget.h"
|
#include "DockAreaWidget.h"
|
||||||
#include "DockAreaTitleBar.h"
|
#include "DockAreaTitleBar.h"
|
||||||
@ -31,12 +32,15 @@ CMainWindow::CMainWindow(QWidget *parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
|
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
|
||||||
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
|
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
|
||||||
|
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
|
||||||
DockManager = new CDockManager(this);
|
DockManager = new CDockManager(this);
|
||||||
|
|
||||||
// Set central widget
|
// Set central widget
|
||||||
QCalendarWidget* calendar = new QCalendarWidget();
|
QPlainTextEdit* w = new QPlainTextEdit();
|
||||||
|
w->setPlaceholderText("This is the central editor. Enter your text here.");
|
||||||
|
//w->setStyleSheet("border: none");
|
||||||
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
|
CDockWidget* CentralDockWidget = new CDockWidget("CentralWidget");
|
||||||
CentralDockWidget->setWidget(calendar);
|
CentralDockWidget->setWidget(w);
|
||||||
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
|
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
|
||||||
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
|
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user