mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Merge branch 'master' into autohide_drag
This commit is contained in:
commit
0b3c3f0123
2
.github/workflows/linux-builds.yml
vendored
2
.github/workflows/linux-builds.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get update --fix-missing
|
||||
sudo apt-get install qt5-default
|
||||
sudo apt-get install qtbase5-private-dev
|
||||
sudo apt-get install qtbase5-private-dev qtdeclarative5-dev
|
||||
- name: qmake
|
||||
run: qmake
|
||||
- name: make
|
||||
|
@ -320,7 +320,9 @@ Screenshot Ubuntu:
|
||||
## Build
|
||||
|
||||
The Linux build requires private header files. Make sure that they are installed.
|
||||
The library uses SVG icons, so ensure that Qt SVG support is installed.
|
||||
The library uses SVG icons, so ensure that Qt SVG support is installed. The demo
|
||||
application creates a `QQuickWidget` for testing, so ensure that the required
|
||||
libraries are installed.
|
||||
|
||||
### Qt5 on Ubuntu 18.04 or 20.04
|
||||
|
||||
@ -331,13 +333,13 @@ sudo apt install qt5-default qtbase5-private-dev
|
||||
### Qt5 on Ubuntu 22.04
|
||||
|
||||
```bash
|
||||
sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5
|
||||
sudo apt install qtbase5-dev qtbase5-private-dev qtbase5-dev-tools libqt5svg5 libqt5qml5 qtdeclarative5-dev
|
||||
```
|
||||
|
||||
### Qt6 on Ubuntu 22.04
|
||||
|
||||
```bash
|
||||
sudo apt install qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6
|
||||
sudo apt install qt6-default qt6-base-dev qt6-base-private-dev qt6-tools-dev libqt6svg6 qt6-qtdeclarative
|
||||
```
|
||||
|
||||
Open the `ads.pro` file with QtCreator and start the build, that's it.
|
||||
|
@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.5)
|
||||
project(ads_demo VERSION ${VERSION_SHORT})
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets REQUIRED)
|
||||
find_package(Qt${QT_VERSION_MAJOR} 5.5 COMPONENTS Core Gui Widgets Quick QuickWidgets REQUIRED)
|
||||
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS AxContainer REQUIRED)
|
||||
endif()
|
||||
@ -21,7 +21,9 @@ add_executable(AdvancedDockingSystemDemo WIN32 ${ads_demo_SRCS})
|
||||
target_include_directories(AdvancedDockingSystemDemo PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../src")
|
||||
target_link_libraries(AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::Core
|
||||
Qt${QT_VERSION_MAJOR}::Gui
|
||||
Qt${QT_VERSION_MAJOR}::Widgets)
|
||||
Qt${QT_VERSION_MAJOR}::Widgets
|
||||
Qt${QT_VERSION_MAJOR}::Quick
|
||||
Qt${QT_VERSION_MAJOR}::QuickWidgets)
|
||||
if(WIN32 AND QT_VERSION_MAJOR LESS 6)
|
||||
target_link_libraries(AdvancedDockingSystemDemo PUBLIC Qt${QT_VERSION_MAJOR}::AxContainer)
|
||||
endif()
|
||||
|
@ -62,6 +62,7 @@
|
||||
#include <QPointer>
|
||||
#include <QMap>
|
||||
#include <QElapsedTimer>
|
||||
#include <QQuickWidget>
|
||||
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
|
||||
@ -407,6 +408,17 @@ struct MainWindowPrivate
|
||||
return DockWidget;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create QQuickWidget for test for OpenGL and QQuick
|
||||
*/
|
||||
ads::CDockWidget *createQQuickWidget()
|
||||
{
|
||||
QQuickWidget *widget = new QQuickWidget();
|
||||
ads::CDockWidget *dockWidget = new ads::CDockWidget("Quick");
|
||||
dockWidget->setWidget(widget);
|
||||
return dockWidget;
|
||||
}
|
||||
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
@ -424,7 +436,6 @@ struct MainWindowPrivate
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
//============================================================================
|
||||
@ -559,6 +570,11 @@ void MainWindowPrivate::createContent()
|
||||
// Create image viewer
|
||||
DockWidget = createImageViewer();
|
||||
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
|
||||
|
||||
// Create quick widget
|
||||
DockWidget = createQQuickWidget();
|
||||
DockWidget->setFeature(ads::CDockWidget::DockWidgetClosable, true);
|
||||
DockManager->addDockWidget(ads::LeftDockWidgetArea, DockWidget);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@ ADS_OUT_ROOT = $${OUT_PWD}/..
|
||||
|
||||
TARGET = AdvancedDockingSystemDemo
|
||||
DESTDIR = $${ADS_OUT_ROOT}/lib
|
||||
QT += core gui widgets
|
||||
QT += core gui widgets quick quickwidgets
|
||||
|
||||
include(../ads.pri)
|
||||
|
||||
|
@ -378,6 +378,7 @@ struct FloatingDockContainerPrivate
|
||||
QWidget* MouseEventHandler = nullptr;
|
||||
CFloatingWidgetTitleBar* TitleBar = nullptr;
|
||||
bool IsResizing = false;
|
||||
bool MousePressed = false;
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -1336,12 +1337,12 @@ void CFloatingDockContainer::resizeEvent(QResizeEvent *event)
|
||||
Super::resizeEvent(event);
|
||||
}
|
||||
|
||||
static bool s_mousePressed = false;
|
||||
|
||||
//============================================================================
|
||||
void CFloatingDockContainer::moveEvent(QMoveEvent *event)
|
||||
{
|
||||
Super::moveEvent(event);
|
||||
if (!d->IsResizing && event->spontaneous() && s_mousePressed)
|
||||
if (!d->IsResizing && event->spontaneous() && d->MousePressed)
|
||||
{
|
||||
d->setState(DraggingFloatingWidget);
|
||||
d->updateDropOverlays(QCursor::pos());
|
||||
@ -1357,10 +1358,10 @@ bool CFloatingDockContainer::event(QEvent *e)
|
||||
switch (e->type())
|
||||
{
|
||||
case QEvent::WindowActivate:
|
||||
s_mousePressed = false;
|
||||
d->MousePressed = false;
|
||||
break;
|
||||
case QEvent::WindowDeactivate:
|
||||
s_mousePressed = true;
|
||||
d->MousePressed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user