mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-12 16:20:25 +08:00
Improved autohidedragndrop example to check, if it also works when dragging with multiple auto hide tabs
This commit is contained in:
parent
f964ce2c68
commit
8dcdc8fad2
@ -23,7 +23,7 @@ SOURCES += \
|
||||
droppableitem.cpp
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h
|
||||
mainwindow.h \
|
||||
droppableitem.h
|
||||
|
||||
FORMS += \
|
||||
|
@ -24,6 +24,7 @@ void DroppableItem::dragEnterEvent(QDragEnterEvent* event)
|
||||
|
||||
void DroppableItem::dragLeaveEvent(QDragLeaveEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
unsetCursor();
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
|
||||
CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig);
|
||||
CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideOpenOnDragHover, true);
|
||||
CDockManager::setConfigParam(CDockManager::AutoHideOpenOnDragHoverDelay_ms, 500);
|
||||
DockManager = new CDockManager(this);
|
||||
|
||||
// Set central widget
|
||||
@ -39,16 +40,30 @@ CMainWindow::CMainWindow(QWidget *parent)
|
||||
auto* CentralDockArea = DockManager->setCentralWidget(CentralDockWidget);
|
||||
CentralDockArea->setAllowedAreas(DockWidgetArea::OuterDockAreas);
|
||||
|
||||
DroppableItem* droppableItem = new DroppableItem("Drop text here.");
|
||||
CDockWidget* dropDockWidget = new CDockWidget("Tab");
|
||||
dropDockWidget->setWidget(droppableItem);
|
||||
dropDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||
dropDockWidget->setMinimumSize(200,150);
|
||||
dropDockWidget->setAcceptDrops(true);
|
||||
const auto autoHideContainer = DockManager->addAutoHideDockWidget(SideBarLocation::SideBarLeft, dropDockWidget);
|
||||
autoHideContainer->setSize(480);
|
||||
autoHideContainer->setAcceptDrops(true);
|
||||
ui->menuView->addAction(dropDockWidget->toggleViewAction());
|
||||
{
|
||||
DroppableItem* droppableItem = new DroppableItem("Drop text here.");
|
||||
CDockWidget* dropDockWidget = new CDockWidget("Tab 1");
|
||||
dropDockWidget->setWidget(droppableItem);
|
||||
dropDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||
dropDockWidget->setMinimumSize(200,150);
|
||||
dropDockWidget->setAcceptDrops(true);
|
||||
const auto autoHideContainer = DockManager->addAutoHideDockWidget(SideBarLocation::SideBarLeft, dropDockWidget);
|
||||
autoHideContainer->setSize(480);
|
||||
autoHideContainer->setAcceptDrops(true);
|
||||
ui->menuView->addAction(dropDockWidget->toggleViewAction());
|
||||
}
|
||||
{
|
||||
DroppableItem* droppableItem = new DroppableItem("Drop text here.");
|
||||
CDockWidget* dropDockWidget = new CDockWidget("Tab 2");
|
||||
dropDockWidget->setWidget(droppableItem);
|
||||
dropDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||
dropDockWidget->setMinimumSize(200,150);
|
||||
dropDockWidget->setAcceptDrops(true);
|
||||
const auto autoHideContainer = DockManager->addAutoHideDockWidget(SideBarLocation::SideBarRight, dropDockWidget);
|
||||
autoHideContainer->setSize(480);
|
||||
autoHideContainer->setAcceptDrops(true);
|
||||
ui->menuView->addAction(dropDockWidget->toggleViewAction());
|
||||
}
|
||||
|
||||
QTableWidget* propertiesTable = new QTableWidget();
|
||||
propertiesTable->setColumnCount(3);
|
||||
|
@ -2,6 +2,7 @@ TEMPLATE = subdirs
|
||||
|
||||
SUBDIRS = \
|
||||
autohide \
|
||||
autohidedragndrop \
|
||||
centralwidget \
|
||||
simple \
|
||||
hideshow \
|
||||
|
Loading…
Reference in New Issue
Block a user