Compare commits
26 Commits
fix-python
...
v1.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cbedc06e97 | ||
|
|
b5c2757874 | ||
|
|
fb6e2afd7b | ||
|
|
80bf6032f3 | ||
|
|
ece7b22bec | ||
|
|
72605292b7 | ||
|
|
7318675e84 | ||
|
|
8a51c31663 | ||
|
|
a586a7894b | ||
|
|
31fcbebaff | ||
|
|
392dac5691 | ||
|
|
29744c01c6 | ||
|
|
49e488df24 | ||
|
|
1a3f00eac8 | ||
|
|
c6ea8d5525 | ||
|
|
8f62004f5b | ||
|
|
f698b56dad | ||
|
|
4ed18fdf1d | ||
|
|
6e05f13c77 | ||
|
|
a146cd81b2 | ||
|
|
ac6d845c8d | ||
|
|
77f259a435 | ||
|
|
7ebc3f3533 | ||
|
|
0ee94b425e | ||
|
|
e57b46979d | ||
|
|
683b67abb0 |
@@ -33,10 +33,6 @@
|
|||||||
# Forces the test harness to be built.
|
# Forces the test harness to be built.
|
||||||
# Default=false
|
# Default=false
|
||||||
#
|
#
|
||||||
# -DKDDockWidgets_QTQUICK == IN DEVELOPMENT. DO NOT USE! ==
|
|
||||||
# Build for QtQuick instead of QtWidgets
|
|
||||||
# Default=false
|
|
||||||
#
|
|
||||||
# -DKDDockWidgets_PYTHON_BINDINGS=[true|false]
|
# -DKDDockWidgets_PYTHON_BINDINGS=[true|false]
|
||||||
# Build/Generate python bindings. Always false for Debug builds
|
# Build/Generate python bindings. Always false for Debug builds
|
||||||
# Default=false
|
# Default=false
|
||||||
@@ -73,7 +69,7 @@ endif()
|
|||||||
|
|
||||||
set(${PROJECT_NAME}_VERSION_MAJOR 1)
|
set(${PROJECT_NAME}_VERSION_MAJOR 1)
|
||||||
set(${PROJECT_NAME}_VERSION_MINOR 1)
|
set(${PROJECT_NAME}_VERSION_MINOR 1)
|
||||||
set(${PROJECT_NAME}_VERSION_PATCH 0)
|
set(${PROJECT_NAME}_VERSION_PATCH 1)
|
||||||
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
|
set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
|
||||||
set(${PROJECT_NAME}_SOVERSION "1.1")
|
set(${PROJECT_NAME}_SOVERSION "1.1")
|
||||||
|
|
||||||
@@ -93,8 +89,6 @@ if(${PROJECT_NAME}_DEVELOPER_MODE)
|
|||||||
set(${PROJECT_NAME}_TESTS ON)
|
set(${PROJECT_NAME}_TESTS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#option(${PROJECT_NAME}_QTQUICK "Build for QtQuick instead of QtWidgets" OFF)
|
|
||||||
|
|
||||||
find_package(Qt5Widgets 5.9 REQUIRED)
|
find_package(Qt5Widgets 5.9 REQUIRED)
|
||||||
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
@@ -120,13 +114,7 @@ macro(set_compiler_flags targetName)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
if(${PROJECT_NAME}_QTQUICK)
|
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
|
||||||
find_package(Qt5Quick)
|
|
||||||
find_package(Qt5QuickControls2)
|
|
||||||
add_definitions(-DKDDOCKWIDGETS_QTQUICK)
|
|
||||||
else()
|
|
||||||
add_definitions(-DKDDOCKWIDGETS_QTWIDGETS)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(${PROJECT_NAME}_STATIC)
|
if(${PROJECT_NAME}_STATIC)
|
||||||
set(${PROJECT_NAME}_LIBRARY_MODE "STATIC")
|
set(${PROJECT_NAME}_LIBRARY_MODE "STATIC")
|
||||||
|
|||||||
13
Changelog
13
Changelog
@@ -1,7 +1,8 @@
|
|||||||
* v1.2.0 (unreleased)
|
* v1.1.1 (11 December 2020)
|
||||||
- QtQuick support
|
- Windows: Fixed a crash when clicking on the close button for floating windows in some situations (#110)
|
||||||
|
- Don't show dock/undock icon when dockwidget is not dockable (#99)
|
||||||
|
|
||||||
* v1.1.0 (unreleased)
|
* v1.1.0 (26 October 2020)
|
||||||
- New drop indicator style type: Segmented Indicators
|
- New drop indicator style type: Segmented Indicators
|
||||||
- Windows: Drop Shadow for floating windows
|
- Windows: Drop Shadow for floating windows
|
||||||
- Added AutoHide / SideBar support
|
- Added AutoHide / SideBar support
|
||||||
@@ -12,6 +13,8 @@
|
|||||||
- Added Config::Flag_TitleBarHasMinimizeButton
|
- Added Config::Flag_TitleBarHasMinimizeButton
|
||||||
- Added Config::Flag_TitleBarNoFloatButton
|
- Added Config::Flag_TitleBarNoFloatButton
|
||||||
- Added Config::Flag_AutoHideSupport
|
- Added Config::Flag_AutoHideSupport
|
||||||
|
- Added Config::setTabbingAllowedFunc(TabbingAllowedFunc func)
|
||||||
|
- HDPI improvements, new high-res icons
|
||||||
- Bugfixes:
|
- Bugfixes:
|
||||||
- Windows: Fixed windows not having proper minimum size.
|
- Windows: Fixed windows not having proper minimum size.
|
||||||
- Windows: Fixed moving windows across screens with different DPI (#72)
|
- Windows: Fixed moving windows across screens with different DPI (#72)
|
||||||
@@ -19,9 +22,7 @@
|
|||||||
- Fixed floating window's title not being correct (#74)
|
- Fixed floating window's title not being correct (#74)
|
||||||
- Fixed focus scope not reacting when clicking on current tab (#71)
|
- Fixed focus scope not reacting when clicking on current tab (#71)
|
||||||
- Fixed floating window borders not being rendered correctly on HDPI due to rounding errors.
|
- Fixed floating window borders not being rendered correctly on HDPI due to rounding errors.
|
||||||
|
- cmake/Python - don't require pkg-config, only use if available (#68)
|
||||||
* v1.0.1 (unreleased)
|
|
||||||
- cmake/Python - don't require pkg-config, only use if available (#68)
|
|
||||||
|
|
||||||
* v1.0.0 (2 September 2020)
|
* v1.0.0 (2 September 2020)
|
||||||
- PySide2 bindings
|
- PySide2 bindings
|
||||||
|
|||||||
@@ -170,3 +170,8 @@ to the Qt Project. We can give advanced or standard trainings anywhere
|
|||||||
around the globe on Qt as well as C++, OpenGL, 3D and more.
|
around the globe on Qt as well as C++, OpenGL, 3D and more.
|
||||||
|
|
||||||
Please visit https://www.kdab.com to meet the people who write code like this.
|
Please visit https://www.kdab.com to meet the people who write code like this.
|
||||||
|
|
||||||
|
Stay up-to-date with KDAB product announcements:
|
||||||
|
|
||||||
|
* [KDAB Newsletter](https://news.kdab.com)
|
||||||
|
* [KDAB Blogs](https://www.kdab.com/category/blogs)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ if (NOT ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX)
|
|||||||
SET(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "Custom path to install python bindings.")
|
SET(${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE FILEPATH "Custom path to install python bindings.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "PYTHON INSTALL PREFIX ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
|
message(STATUS "PYTHON INSTALL PREFIX ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}")
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(PATH_SEP "\;")
|
set(PATH_SEP "\;")
|
||||||
@@ -153,5 +153,5 @@ macro(CREATE_PYTHON_BINDINGS
|
|||||||
LINK_FLAGS "-undefined dynamic_lookup")
|
LINK_FLAGS "-undefined dynamic_lookup")
|
||||||
endif()
|
endif()
|
||||||
install(TARGETS ${TARGET_NAME}
|
install(TARGETS ${TARGET_NAME}
|
||||||
LIBRARY DESTINATION ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${TARGET_NAME})
|
LIBRARY DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/${TARGET_NAME})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from conans import ConanFile, CMake, tools
|
|||||||
|
|
||||||
class KDDockWidgetsConan(ConanFile):
|
class KDDockWidgetsConan(ConanFile):
|
||||||
name = "kddockwidgets"
|
name = "kddockwidgets"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
default_user = "kdab"
|
default_user = "kdab"
|
||||||
default_channel = "stable"
|
default_channel = "stable"
|
||||||
license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt",
|
license = ("https://raw.githubusercontent.com/KDAB/KDDockWidgets/master/LICENSES/GPL-2.0-only.txt",
|
||||||
|
|||||||
@@ -1,3 +1,15 @@
|
|||||||
|
kddockwidgets (1.1.1) release candidate; urgency=high
|
||||||
|
|
||||||
|
* 1.1.1 final
|
||||||
|
|
||||||
|
-- Allen Winter <allen.winter@kdab.com> Fri, 11 Dec 2020 12:00:00 -0500
|
||||||
|
|
||||||
|
kddockwidgets (1.1.0) release candidate; urgency=high
|
||||||
|
|
||||||
|
* 1.1.0 final
|
||||||
|
|
||||||
|
-- Allen Winter <allen.winter@kdab.com> Mon, 26 Oct 2020 12:00:00 -0500
|
||||||
|
|
||||||
kddockwidgets (1.0.0) release candidate; urgency=high
|
kddockwidgets (1.0.0) release candidate; urgency=high
|
||||||
|
|
||||||
* 1.0.0 final
|
* 1.0.0 final
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
Format: 1.0
|
Format: 1.0
|
||||||
Source: kddockwidgets
|
Source: kddockwidgets
|
||||||
Version: 1.0.0
|
Version: 1.1.1-1
|
||||||
Binary: kddockwidgets
|
Binary: kddockwidgets
|
||||||
Maintainer: Allen Winter <allen.winter@kdab.com>
|
Maintainer: Allen Winter <allen.winter@kdab.com>
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Build-Depends: debhelper (>=9), cdbs, cmake, qt5-default, qtbase5-dev, libqt5x11extras5-dev
|
Build-Depends: debhelper (>=9), cdbs, cmake, qt5-default, qtbase5-dev, libqt5x11extras5-dev
|
||||||
|
|
||||||
Files:
|
Files:
|
||||||
00000000000000000000000000000000 00000 kddockwidgets-1.0.0.tar.gz
|
00000000000000000000000000000000 00000 kddockwidgets-1.1.1.tar.gz
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Name: kddockwidgets
|
Name: kddockwidgets
|
||||||
Version: 1.0.0
|
Version: 1.1.1
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: KDAB's Dock Widget Framework for Qt
|
Summary: KDAB's Dock Widget Framework for Qt
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
@@ -88,7 +88,11 @@ cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release
|
|||||||
%{_libdir}/libkddockwidgets_multisplitter.so
|
%{_libdir}/libkddockwidgets_multisplitter.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Sep 02 2020 Allen Winter <allen.winter@kdb.com> 1.0.0
|
* Fri Dec 11 2020 Allen Winter <allen.winter@kdab.com> 1.1.1
|
||||||
|
1.1.1 final
|
||||||
|
* Mon Oct 26 2020 Allen Winter <allen.winter@kdab.com> 1.1.0
|
||||||
|
1.1.0 final
|
||||||
|
* Wed Sep 02 2020 Allen Winter <allen.winter@kdab.com> 1.0.0
|
||||||
1.0.0 final
|
1.0.0 final
|
||||||
* Thu Aug 06 2020 Allen Winter <allen.winter@kdb.com> 0.99.9
|
* Thu Aug 06 2020 Allen Winter <allen.winter@kdab.com> 0.99.9
|
||||||
1.0.0 release candidate
|
1.0.0 release candidate
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ create_python_bindings(
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make moduled import from build dir works
|
# Make module import from build dir work
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/__init__.py)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/__init__.py)
|
||||||
|
|
||||||
# install
|
# install
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/PyKDDockWidgets)
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/__init__.py DESTINATION ${${PROJECT_NAME}_PYTHON_BINDINGS_INSTALL_PREFIX}/PyKDDockWidgets)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<!-- this is used in a public virtual pure function we need to declare it
|
<!-- this is used in a public virtual pure function we need to declare it
|
||||||
otherwise shiboken will ignore the function and will fail to create a wrapper -->
|
otherwise shiboken will ignore the function and will fail to create a wrapper -->
|
||||||
<primitive-type name="DropAreaWithCentralFrame"/>
|
<primitive-type name="DropAreaWithCentralFrame"/>
|
||||||
|
<primitive-type name="SideBar"/>
|
||||||
|
|
||||||
<!-- Some plublic enum and flags -->
|
<!-- Some plublic enum and flags -->
|
||||||
<enum-type name="Location"/>
|
<enum-type name="Location"/>
|
||||||
@@ -19,6 +20,9 @@
|
|||||||
<enum-type name="RestoreOption" flags="RestoreOptions"/>
|
<enum-type name="RestoreOption" flags="RestoreOptions"/>
|
||||||
<enum-type name="DefaultSizeMode"/>
|
<enum-type name="DefaultSizeMode"/>
|
||||||
<enum-type name="FrameOption" flags="FrameOptions"/>
|
<enum-type name="FrameOption" flags="FrameOptions"/>
|
||||||
|
<enum-type name="DropIndicatorType"/>
|
||||||
|
<enum-type name="SideBarLocation"/>
|
||||||
|
<enum-type name="TitleBarButtonType"/>
|
||||||
|
|
||||||
<!-- our classes
|
<!-- our classes
|
||||||
For class we can use two types:
|
For class we can use two types:
|
||||||
@@ -32,6 +36,7 @@
|
|||||||
<!-- this class contains a internal enum, so it should be declared
|
<!-- this class contains a internal enum, so it should be declared
|
||||||
inside of the object-type -->
|
inside of the object-type -->
|
||||||
<enum-type name="Option" flags="Options" />
|
<enum-type name="Option" flags="Options" />
|
||||||
|
<enum-type name="IconPlace" flags="IconPlaces" />
|
||||||
</object-type>
|
</object-type>
|
||||||
|
|
||||||
<object-type name="DockWidget" />
|
<object-type name="DockWidget" />
|
||||||
|
|||||||
@@ -168,19 +168,23 @@ if(CMAKE_COMPILER_IS_GNUCXX OR IS_CLANG_BUILD)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${PROJECT_NAME}_QTQUICK)
|
if(${PROJECT_NAME}_QTQUICK)
|
||||||
target_link_libraries(kddockwidgets PUBLIC Qt5::Widgets Qt5::Quick Qt5::QuickControls2 kddockwidgets_multisplitter PRIVATE Qt5::GuiPrivate)
|
target_link_libraries(kddockwidgets PUBLIC Qt5::Widgets Qt5::Quick Qt5::QuickControls2 kddockwidgets_multisplitter)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(kddockwidgets PUBLIC Qt5::Widgets kddockwidgets_multisplitter PRIVATE Qt5::GuiPrivate)
|
target_link_libraries(kddockwidgets PUBLIC Qt5::Widgets kddockwidgets_multisplitter)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
target_link_libraries(kddockwidgets PRIVATE Dwmapi)
|
target_link_libraries(kddockwidgets PRIVATE Qt5::GuiPrivate Dwmapi)
|
||||||
elseif(NOT APPLE)
|
elseif(NOT APPLE)
|
||||||
find_package(Qt5X11Extras)
|
find_package(Qt5X11Extras)
|
||||||
target_link_libraries(kddockwidgets PUBLIC Qt5::X11Extras)
|
target_link_libraries(kddockwidgets PUBLIC Qt5::X11Extras)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(kddockwidgets PROPERTIES VERSION ${${PROJECT_NAME}_SOVERSION})
|
set_target_properties(kddockwidgets PROPERTIES
|
||||||
|
SOVERSION ${${PROJECT_NAME}_SOVERSION}
|
||||||
|
VERSION ${${PROJECT_NAME}_VERSION}
|
||||||
|
)
|
||||||
|
|
||||||
#version libraries on Windows
|
#version libraries on Windows
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(postfix ${${PROJECT_NAME}_VERSION_MAJOR})
|
set(postfix ${${PROJECT_NAME}_VERSION_MAJOR})
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public:
|
|||||||
QQmlEngine *m_qmlEngine = nullptr;
|
QQmlEngine *m_qmlEngine = nullptr;
|
||||||
DockWidgetFactoryFunc m_dockWidgetFactoryFunc = nullptr;
|
DockWidgetFactoryFunc m_dockWidgetFactoryFunc = nullptr;
|
||||||
MainWindowFactoryFunc m_mainWindowFactoryFunc = nullptr;
|
MainWindowFactoryFunc m_mainWindowFactoryFunc = nullptr;
|
||||||
|
TabbingAllowedFunc m_tabbingAllowedFunc = nullptr;
|
||||||
FrameworkWidgetFactory *m_frameworkWidgetFactory;
|
FrameworkWidgetFactory *m_frameworkWidgetFactory;
|
||||||
Flags m_flags = Flag_Default;
|
Flags m_flags = Flag_Default;
|
||||||
qreal m_draggedWindowOpacity = Q_QNAN;
|
qreal m_draggedWindowOpacity = Q_QNAN;
|
||||||
@@ -153,6 +154,16 @@ qreal Config::draggedWindowOpacity() const
|
|||||||
return d->m_draggedWindowOpacity;
|
return d->m_draggedWindowOpacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Config::setTabbingAllowedFunc(TabbingAllowedFunc func)
|
||||||
|
{
|
||||||
|
d->m_tabbingAllowedFunc = func;
|
||||||
|
}
|
||||||
|
|
||||||
|
TabbingAllowedFunc Config::tabbingAllowedFunc() const
|
||||||
|
{
|
||||||
|
return d->m_tabbingAllowedFunc;
|
||||||
|
}
|
||||||
|
|
||||||
void Config::setQmlEngine(QQmlEngine *qmlEngine)
|
void Config::setQmlEngine(QQmlEngine *qmlEngine)
|
||||||
{
|
{
|
||||||
if (d->m_qmlEngine) {
|
if (d->m_qmlEngine) {
|
||||||
|
|||||||
73
src/Config.h
73
src/Config.h
@@ -35,6 +35,14 @@ class FrameworkWidgetFactory;
|
|||||||
typedef KDDockWidgets::DockWidgetBase* (*DockWidgetFactoryFunc)(const QString &name);
|
typedef KDDockWidgets::DockWidgetBase* (*DockWidgetFactoryFunc)(const QString &name);
|
||||||
typedef KDDockWidgets::MainWindowBase* (*MainWindowFactoryFunc)(const QString &name);
|
typedef KDDockWidgets::MainWindowBase* (*MainWindowFactoryFunc)(const QString &name);
|
||||||
|
|
||||||
|
/// @brief Function to allow the user more granularity to disallow dock widgets to tab together
|
||||||
|
/// @param source The dock widgets being dragged
|
||||||
|
/// @param target The dock widgets within an existing docked tab group
|
||||||
|
/// @return true if the docking is allowed.
|
||||||
|
/// @sa setTabbingAllowedFunc
|
||||||
|
typedef bool (*TabbingAllowedFunc)(const QVector<DockWidgetBase*> &source,
|
||||||
|
const QVector<DockWidgetBase*> &target);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Singleton to allow to choose certain behaviours of the framework.
|
* @brief Singleton to allow to choose certain behaviours of the framework.
|
||||||
*
|
*
|
||||||
@@ -53,29 +61,29 @@ public:
|
|||||||
|
|
||||||
///@brief Flag enum to tune certain behaviours, the defaults are Flag_Default
|
///@brief Flag enum to tune certain behaviours, the defaults are Flag_Default
|
||||||
enum Flag {
|
enum Flag {
|
||||||
Flag_None = 0, ///> No option set
|
Flag_None = 0, ///< No option set
|
||||||
Flag_NativeTitleBar = 1, ///> Enables the Native OS title bar on OSes that support it (Windows 10, macOS), ignored otherwise. This is mutually exclusive with Flag_AeroSnap
|
Flag_NativeTitleBar = 1, ///< Enables the Native OS title bar on OSes that support it (Windows 10, macOS), ignored otherwise. This is mutually exclusive with Flag_AeroSnap
|
||||||
Flag_AeroSnapWithClientDecos = 2, ///> Deprecated. This is now default and cannot be turned off. Moving a window on Windows 10 uses native moving, as that works well across screens with different HDPI settings. There's no reason to use manual client/Qt window moving.
|
Flag_AeroSnapWithClientDecos = 2, ///< Deprecated. This is now default and cannot be turned off. Moving a window on Windows 10 uses native moving, as that works well across screens with different HDPI settings. There's no reason to use manual client/Qt window moving.
|
||||||
Flag_AlwaysTitleBarWhenFloating = 4, ///> Floating windows will have a title bar even if Flag_HideTitleBarWhenTabsVisible is specified. Unneeded if Flag_HideTitleBarWhenTabsVisible isn't specified, as that's the default already.
|
Flag_AlwaysTitleBarWhenFloating = 4, ///< Floating windows will have a title bar even if Flag_HideTitleBarWhenTabsVisible is specified. Unneeded if Flag_HideTitleBarWhenTabsVisible isn't specified, as that's the default already.
|
||||||
Flag_HideTitleBarWhenTabsVisible = 8, ///> Hides the title bar if there's tabs visible. The empty space in the tab bar becomes draggable.
|
Flag_HideTitleBarWhenTabsVisible = 8, ///< Hides the title bar if there's tabs visible. The empty space in the tab bar becomes draggable.
|
||||||
Flag_AlwaysShowTabs = 16, ///> Always show tabs, even if there's only one,
|
Flag_AlwaysShowTabs = 16, ///< Always show tabs, even if there's only one,
|
||||||
Flag_AllowReorderTabs = 32, /// Allows user to re-order tabs by dragging them
|
Flag_AllowReorderTabs = 32, ///< Allows user to re-order tabs by dragging them
|
||||||
Flag_TabsHaveCloseButton = 64, /// Tabs will have a close button. Equivalent to QTabWidget::setTabsClosable(true).
|
Flag_TabsHaveCloseButton = 64, ///< Tabs will have a close button. Equivalent to QTabWidget::setTabsClosable(true).
|
||||||
Flag_DoubleClickMaximizes = 128, /// Double clicking the titlebar will maximize a floating window instead of re-docking it
|
Flag_DoubleClickMaximizes = 128, ///< Double clicking the titlebar will maximize a floating window instead of re-docking it
|
||||||
Flag_TitleBarHasMaximizeButton = 256, /// The title bar will have a maximize/restore button when floating. This is mutually-exclusive with the floating button (since many apps behave that way).
|
Flag_TitleBarHasMaximizeButton = 256, ///< The title bar will have a maximize/restore button when floating. This is mutually-exclusive with the floating button (since many apps behave that way).
|
||||||
Flag_TitleBarIsFocusable = 512, /// You can click the title bar and it will focus the last focused widget in the focus scope. If no previously focused widget then it focuses the user's dock widget guest, which should accept focus or use a focus proxy.
|
Flag_TitleBarIsFocusable = 512, ///< You can click the title bar and it will focus the last focused widget in the focus scope. If no previously focused widget then it focuses the user's dock widget guest, which should accept focus or use a focus proxy.
|
||||||
Flag_LazyResize = 1024, /// The dock widgets are resized in a lazy manner. The actual resize only happens when you release the mouse button.
|
Flag_LazyResize = 1024, ///< The dock widgets are resized in a lazy manner. The actual resize only happens when you release the mouse button.
|
||||||
|
|
||||||
// These two are internal, for testing purposes across platforms. Use Flag_DontUseUtilityFloatingWindows instead.
|
// These two are internal, for testing purposes across platforms. Use Flag_DontUseUtilityFloatingWindows instead.
|
||||||
Flag_internal_DontUseQtToolWindowsForFloatingWindows = 0x800, ///> FloatingWindows will use Qt::Window instead of Qt::Tool. Internal, use Flag_DontUseUtilityFloatingWindows instead.
|
Flag_internal_DontUseQtToolWindowsForFloatingWindows = 0x800, ///< FloatingWindows will use Qt::Window instead of Qt::Tool. Internal, use Flag_DontUseUtilityFloatingWindows instead.
|
||||||
Flag_internal_DontUseParentForFloatingWindows = 0x1000, ///> FloatingWindows won't have a parent top-level. Internal, use Flag_DontUseUtilityFloatingWindows instead.
|
Flag_internal_DontUseParentForFloatingWindows = 0x1000, ///< FloatingWindows won't have a parent top-level. Internal, use Flag_DontUseUtilityFloatingWindows instead.
|
||||||
|
|
||||||
Flag_DontUseUtilityFloatingWindows = Flag_internal_DontUseQtToolWindowsForFloatingWindows | Flag_internal_DontUseParentForFloatingWindows,
|
Flag_DontUseUtilityFloatingWindows = Flag_internal_DontUseQtToolWindowsForFloatingWindows | Flag_internal_DontUseParentForFloatingWindows,
|
||||||
Flag_TitleBarHasMinimizeButton = 0x2000 | Flag_DontUseUtilityFloatingWindows, ///> The title bar will have a minimize button when floating. This implies Flag_DontUseUtilityFloatingWindows too, otherwise they wouldn't appear in the task bar.
|
Flag_TitleBarHasMinimizeButton = 0x2000 | Flag_DontUseUtilityFloatingWindows, ///< The title bar will have a minimize button when floating. This implies Flag_DontUseUtilityFloatingWindows too, otherwise they wouldn't appear in the task bar.
|
||||||
Flag_TitleBarNoFloatButton = 0x4000, ///> The TitleBar won't show the float button
|
Flag_TitleBarNoFloatButton = 0x4000, ///< The TitleBar won't show the float button
|
||||||
Flag_AutoHideSupport = 0x8000 | Flag_TitleBarNoFloatButton, ///> Supports minimizing dock widgets to the side-bar.
|
Flag_AutoHideSupport = 0x8000 | Flag_TitleBarNoFloatButton, ///< Supports minimizing dock widgets to the side-bar.
|
||||||
///> By default it also turns off the float button, but you can remove Flag_TitleBarNoFloatButton to have both.
|
///< By default it also turns off the float button, but you can remove Flag_TitleBarNoFloatButton to have both.
|
||||||
Flag_Default = Flag_AeroSnapWithClientDecos ///> The defaults
|
Flag_Default = Flag_AeroSnapWithClientDecos ///< The defaults
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(Flags, Flag)
|
Q_DECLARE_FLAGS(Flags, Flag)
|
||||||
|
|
||||||
@@ -150,6 +158,33 @@ public:
|
|||||||
///By default it's 1.0, fully opaque
|
///By default it's 1.0, fully opaque
|
||||||
qreal draggedWindowOpacity() const;
|
qreal draggedWindowOpacity() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Allows the user to intercept a docking attempt to center (tabbed) and disallow it.
|
||||||
|
*
|
||||||
|
* Whenever the user tries to tab two widgets together, the framework will call @p func. If
|
||||||
|
* it returns true, then tabbing is allowed, otherwise not.
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* @code
|
||||||
|
* #include <kddockwidgets/Config.h>
|
||||||
|
* (...)
|
||||||
|
*
|
||||||
|
* auto func = [] (const KDDockWidgets::DockWidgetBase::List &source,
|
||||||
|
* const KDDockWidgets::DockWidgetBase::List &target)
|
||||||
|
* {
|
||||||
|
* // disallows dockFoo to be tabbed with dockBar.
|
||||||
|
* return !(source.contains(dockFoo) && target.contains(dockBar));
|
||||||
|
* }
|
||||||
|
* @endcode
|
||||||
|
* KDDockWidgets::Config::self()->setTabbingAllowedFunc(func);
|
||||||
|
*/
|
||||||
|
void setTabbingAllowedFunc(TabbingAllowedFunc func);
|
||||||
|
|
||||||
|
///@brief Used internally by the framework. Returns the function which was passed to setTabbingAllowedFunc()
|
||||||
|
///By default it's nullptr.
|
||||||
|
///@sa setTabbingAllowedFunc().
|
||||||
|
TabbingAllowedFunc tabbingAllowedFunc() const;
|
||||||
|
|
||||||
///@brief Sets the QQmlEngine to use. Applicable only when using QtQuick.
|
///@brief Sets the QQmlEngine to use. Applicable only when using QtQuick.
|
||||||
void setQmlEngine(QQmlEngine *);
|
void setQmlEngine(QQmlEngine *);
|
||||||
QQmlEngine* qmlEngine() const;
|
QQmlEngine* qmlEngine() const;
|
||||||
|
|||||||
@@ -146,6 +146,8 @@ DockWidgetBase::DockWidgetBase(const QString &name, Options options)
|
|||||||
|
|
||||||
if (name.isEmpty())
|
if (name.isEmpty())
|
||||||
qWarning() << Q_FUNC_INFO << "Name can't be null";
|
qWarning() << Q_FUNC_INFO << "Name can't be null";
|
||||||
|
|
||||||
|
setAttribute(Qt::WA_PendingMoveEvent, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
DockWidgetBase::~DockWidgetBase()
|
DockWidgetBase::~DockWidgetBase()
|
||||||
@@ -528,7 +530,7 @@ FloatingWindow *DockWidgetBase::morphIntoFloatingWindow()
|
|||||||
if (geo.isNull()) {
|
if (geo.isNull()) {
|
||||||
geo = geometry();
|
geo = geometry();
|
||||||
|
|
||||||
if (!testAttribute(Qt::WA_Moved)) { // If user already moved it, we don't interfere
|
if (!testAttribute(Qt::WA_PendingMoveEvent)) { // If user already moved it, we don't interfere
|
||||||
const QPoint center = d->defaultCenterPosForFloating();
|
const QPoint center = d->defaultCenterPosForFloating();
|
||||||
if (!center.isNull())
|
if (!center.isNull())
|
||||||
geo.moveCenter(center);
|
geo.moveCenter(center);
|
||||||
|
|||||||
@@ -233,10 +233,11 @@ QIcon DefaultWidgetFactory::iconForButtonType(TitleBarButtonType type, qreal dpr
|
|||||||
const bool isFractional = int(dpr) != dpr;
|
const bool isFractional = int(dpr) != dpr;
|
||||||
if (isFractional) {
|
if (isFractional) {
|
||||||
// We don't support 1.5x yet.
|
// We don't support 1.5x yet.
|
||||||
// Linux is the only one affected as Windows and macOS use integral factors.
|
|
||||||
// Problem with Linux is that rendering is off due to a rounding bug only fixed in 5.15.2
|
// Problem with Linux is that rendering is off due to a rounding bug only fixed in 5.15.2
|
||||||
// Will enable for fractional later.
|
// Will enable for fractional later.
|
||||||
// QTBUG-86170
|
// QTBUG-86170
|
||||||
|
// Mostly affects Linux. Unless you're using Qt::HighDpiScaleFactorRoundingPolicy::PassThrough, in which case it will
|
||||||
|
// affect other OSes too.
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ public:
|
|||||||
|
|
||||||
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
#ifdef KDDOCKWIDGETS_QTWIDGETS
|
||||||
///@brief Called internally by the framework to create a title bar button
|
///@brief Called internally by the framework to create a title bar button
|
||||||
///@parent the button's parent
|
///@p parent the button's parent
|
||||||
virtual QAbstractButton* createTitleBarButton(QWidget *parent, TitleBarButtonType) const = 0;
|
virtual QAbstractButton* createTitleBarButton(QWidget *parent, TitleBarButtonType) const = 0;
|
||||||
#else
|
#else
|
||||||
// QtQuick will have some other base class for buttons
|
// QtQuick will have some other base class for buttons
|
||||||
|
|||||||
@@ -228,6 +228,11 @@ DockWidgetBase *FloatingWindow::singleDockWidget() const
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const DockWidgetBase::List FloatingWindow::dockWidgets() const
|
||||||
|
{
|
||||||
|
return m_dropArea->dockWidgets();
|
||||||
|
}
|
||||||
|
|
||||||
const Frame::List FloatingWindow::frames() const
|
const Frame::List FloatingWindow::frames() const
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_dropArea);
|
Q_ASSERT(m_dropArea);
|
||||||
@@ -270,6 +275,14 @@ MultiSplitter *FloatingWindow::multiSplitter() const
|
|||||||
|
|
||||||
bool FloatingWindow::isInDragArea(QPoint globalPoint) const
|
bool FloatingWindow::isInDragArea(QPoint globalPoint) const
|
||||||
{
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// A click near the border will still send a Qt::NonClientMousePressEvent. We shouldn't
|
||||||
|
// interpret that as a drag, as it's for a native resize.
|
||||||
|
// Keep track of how we handled the WM_NCHITTEST
|
||||||
|
if (m_lastHitTest != 0 && m_lastHitTest != HTCAPTION)
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
return dragRect().contains(globalPoint);
|
return dragRect().contains(globalPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,10 +400,10 @@ void FloatingWindow::updateTitleAndIcon()
|
|||||||
m_titleBar->setTitle(title);
|
m_titleBar->setTitle(title);
|
||||||
m_titleBar->setIcon(icon);
|
m_titleBar->setIcon(icon);
|
||||||
|
|
||||||
if (KDDockWidgets::usesNativeTitleBar()) {
|
// Even without a native title bar it's nice to set the window title/icon, so it shows
|
||||||
setWindowTitle(title);
|
// in the taskbar (when minimization is supported), or Alt-Tab (in supporting Window Managers)
|
||||||
setWindowIcon(icon);
|
setWindowTitle(title);
|
||||||
}
|
setWindowIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FloatingWindow::onCloseEvent(QCloseEvent *e)
|
void FloatingWindow::onCloseEvent(QCloseEvent *e)
|
||||||
|
|||||||
@@ -49,9 +49,15 @@ public:
|
|||||||
std::unique_ptr<WindowBeingDragged> makeWindow() override;
|
std::unique_ptr<WindowBeingDragged> makeWindow() override;
|
||||||
DockWidgetBase *singleDockWidget() const override;
|
DockWidgetBase *singleDockWidget() const override;
|
||||||
|
|
||||||
|
const QVector<DockWidgetBase*> dockWidgets() const;
|
||||||
const Frame::List frames() const;
|
const Frame::List frames() const;
|
||||||
DropArea *dropArea() const { return m_dropArea; }
|
DropArea *dropArea() const { return m_dropArea; }
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
void setLastHitTest(int hitTest) {
|
||||||
|
m_lastHitTest = hitTest;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
/**
|
/**
|
||||||
* @brief Returns the title bar.
|
* @brief Returns the title bar.
|
||||||
*
|
*
|
||||||
@@ -148,6 +154,9 @@ private:
|
|||||||
bool m_updatingTitleBarVisibility = false;
|
bool m_updatingTitleBarVisibility = false;
|
||||||
QMetaObject::Connection m_layoutDestroyedConnection;
|
QMetaObject::Connection m_layoutDestroyedConnection;
|
||||||
QAbstractNativeEventFilter *m_nchittestFilter = nullptr;
|
QAbstractNativeEventFilter *m_nchittestFilter = nullptr;
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
int m_lastHitTest = 0;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,6 +198,12 @@ bool TitleBar::supportsFloatingButton() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (DockWidgetBase *dw = singleDockWidget()) {
|
||||||
|
// Don't show the dock/undock button if the window is not dockable
|
||||||
|
if (dw->options() & DockWidgetBase::Option_NotDockable)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// If we have a floating window with nested dock widgets we can't re-attach, because we don't
|
// If we have a floating window with nested dock widgets we can't re-attach, because we don't
|
||||||
// know where to
|
// know where to
|
||||||
return !m_floatingWindow || m_floatingWindow->hasSingleFrame();
|
return !m_floatingWindow || m_floatingWindow->hasSingleFrame();
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ class QHBoxLayout;
|
|||||||
class QLabel;
|
class QLabel;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
class TestCommon;
|
||||||
|
|
||||||
namespace KDDockWidgets {
|
namespace KDDockWidgets {
|
||||||
|
|
||||||
class DockWidgetBase;
|
class DockWidgetBase;
|
||||||
@@ -127,6 +129,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend class TestDocks;
|
friend class TestDocks;
|
||||||
|
friend class ::TestCommon;
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ bool WidgetResizeHandler::handleWindowsNativeEvent(FloatingWindow *w, const QByt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w->setLastHitTest(*result);
|
||||||
return *result != 0;
|
return *result != 0;
|
||||||
} else if (msg->message == WM_NCLBUTTONDBLCLK) {
|
} else if (msg->message == WM_NCLBUTTONDBLCLK) {
|
||||||
if ((Config::self().flags() & Config::Flag_DoubleClickMaximizes)) {
|
if ((Config::self().flags() & Config::Flag_DoubleClickMaximizes)) {
|
||||||
|
|||||||
@@ -99,8 +99,14 @@ void ClassicIndicators::updateIndicatorsVisibility(bool visible)
|
|||||||
|
|
||||||
|
|
||||||
// Only allow to dock to center if the affinities match
|
// Only allow to dock to center if the affinities match
|
||||||
|
auto tabbingAllowedFunc = Config::self().tabbingAllowedFunc();
|
||||||
m_tabIndicatorVisible = m_innerIndicatorsVisible && m_windowBeingDragged &&
|
m_tabIndicatorVisible = m_innerIndicatorsVisible && m_windowBeingDragged &&
|
||||||
DockRegistry::self()->affinitiesMatch(m_hoveredFrame->affinities(), m_windowBeingDragged->affinities());
|
DockRegistry::self()->affinitiesMatch(m_hoveredFrame->affinities(), m_windowBeingDragged->affinities());
|
||||||
|
if (m_tabIndicatorVisible && tabbingAllowedFunc) {
|
||||||
|
const DockWidgetBase::List source = m_windowBeingDragged->floatingWindow()->dockWidgets();
|
||||||
|
const DockWidgetBase::List target = m_hoveredFrame->dockWidgets();
|
||||||
|
m_tabIndicatorVisible = tabbingAllowedFunc(source, target);
|
||||||
|
}
|
||||||
|
|
||||||
Q_EMIT innerIndicatorsVisibleChanged();
|
Q_EMIT innerIndicatorsVisibleChanged();
|
||||||
Q_EMIT outterIndicatorsVisibleChanged();
|
Q_EMIT outterIndicatorsVisibleChanged();
|
||||||
|
|||||||
@@ -98,7 +98,11 @@ target_include_directories(kddockwidgets_multisplitter
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(kddockwidgets_multisplitter PROPERTIES VERSION ${${PROJECT_NAME}_SOVERSION})
|
set_target_properties(kddockwidgets_multisplitter PROPERTIES
|
||||||
|
SOVERSION ${${PROJECT_NAME}_SOVERSION}
|
||||||
|
VERSION ${${PROJECT_NAME}_VERSION}
|
||||||
|
)
|
||||||
|
|
||||||
#version libraries on Windows
|
#version libraries on Windows
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set(postfix ${${PROJECT_NAME}_VERSION_MAJOR})
|
set(postfix ${${PROJECT_NAME}_VERSION_MAJOR})
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
#ifdef KDDOCKWIDGETS_QTQUICK
|
#ifdef KDDOCKWIDGETS_QTQUICK
|
||||||
# include <QQmlEngine>
|
# include <QQmlEngine>
|
||||||
# include <QQuickStyle>
|
# include <QQuickStyle>
|
||||||
|
#else
|
||||||
|
# include "DockWidget.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace KDDockWidgets;
|
using namespace KDDockWidgets;
|
||||||
@@ -67,6 +69,7 @@ private Q_SLOTS:
|
|||||||
void tst_ghostSeparator();
|
void tst_ghostSeparator();
|
||||||
void tst_detachFromMainWindow();
|
void tst_detachFromMainWindow();
|
||||||
void tst_detachPos();
|
void tst_detachPos();
|
||||||
|
void tst_nonDockable();
|
||||||
};
|
};
|
||||||
|
|
||||||
void TestCommon::tst_simple1()
|
void TestCommon::tst_simple1()
|
||||||
@@ -221,6 +224,32 @@ void TestCommon::tst_detachPos()
|
|||||||
delete dock1->window();
|
delete dock1->window();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestCommon::tst_nonDockable()
|
||||||
|
{
|
||||||
|
{ // First test without Option_NotDockable
|
||||||
|
auto dock = new DockWidgetType("1");
|
||||||
|
dock->show();
|
||||||
|
|
||||||
|
TitleBar *tb = dock->titleBar();
|
||||||
|
QVERIFY(tb->isVisible());
|
||||||
|
QVERIFY(tb->isFloatButtonVisible());
|
||||||
|
|
||||||
|
delete dock->window();
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Test that when using Option_NotDockable we don't get a dock/undock icon
|
||||||
|
auto dock = new DockWidgetType("1", DockWidgetBase::Option_NotDockable);
|
||||||
|
dock->show();
|
||||||
|
|
||||||
|
TitleBar *tb = dock->titleBar();
|
||||||
|
QVERIFY(tb->isVisible());
|
||||||
|
QVERIFY(!tb->isFloatButtonVisible());
|
||||||
|
|
||||||
|
delete dock->window();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (!qpaPassedAsArgument(argc, argv)) {
|
if (!qpaPassedAsArgument(argc, argv)) {
|
||||||
@@ -229,10 +258,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
TestCommon test;
|
if (shouldSkipTests())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
TestCommon test;
|
||||||
return QTest::qExec(&test, argc, argv);
|
return QTest::qExec(&test, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "tst_common.moc"
|
#include "tst_common.moc"
|
||||||
|
|||||||
@@ -5370,16 +5370,10 @@ void TestDocks::tst_floatingAction()
|
|||||||
|
|
||||||
QCOMPARE(spy1.count(), 1);
|
QCOMPARE(spy1.count(), 1);
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
|
||||||
QCOMPARE(spy2.count(), 1);
|
|
||||||
QCOMPARE(spy21.count(), 1);
|
|
||||||
#else
|
|
||||||
// On earlier Qt versions this is flaky, but technically correct.
|
// On earlier Qt versions this is flaky, but technically correct.
|
||||||
// Windows can get hidden while being reparented and floating changes momentarily.
|
// Windows can get hidden while being reparented and floating changes momentarily.
|
||||||
// This works well on 5.15 though.
|
|
||||||
QVERIFY(spy2.count() == 1 || spy2.count() == 3);
|
QVERIFY(spy2.count() == 1 || spy2.count() == 3);
|
||||||
QVERIFY(spy21.count() == 1 || spy21.count() == 3);
|
QVERIFY(spy21.count() == 1 || spy21.count() == 3);
|
||||||
#endif
|
|
||||||
QCOMPARE(spy11.count(), 1);
|
QCOMPARE(spy11.count(), 1);
|
||||||
|
|
||||||
QVERIFY(!dock1->isFloating());
|
QVERIFY(!dock1->isFloating());
|
||||||
@@ -6047,6 +6041,7 @@ void TestDocks::tst_honourUserGeometry()
|
|||||||
EnsureTopLevelsDeleted e;
|
EnsureTopLevelsDeleted e;
|
||||||
auto m1 = createMainWindow(QSize(1000, 1000), MainWindowOption_None);
|
auto m1 = createMainWindow(QSize(1000, 1000), MainWindowOption_None);
|
||||||
auto dw1 = new DockWidget(QStringLiteral("1"));
|
auto dw1 = new DockWidget(QStringLiteral("1"));
|
||||||
|
QVERIFY(!dw1->testAttribute(Qt::WA_PendingMoveEvent));
|
||||||
|
|
||||||
const QPoint pt(10, 10);
|
const QPoint pt(10, 10);
|
||||||
dw1->move(pt);
|
dw1->move(pt);
|
||||||
@@ -6227,8 +6222,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
KDDockWidgets::TestDocks test;
|
if (shouldSkipTests())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
KDDockWidgets::TestDocks test;
|
||||||
return QTest::qExec(&test, argc, argv);
|
return QTest::qExec(&test, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,17 @@ struct DockDescriptor {
|
|||||||
KDDockWidgets::AddingOption option;
|
KDDockWidgets::AddingOption option;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline bool shouldSkipTests()
|
||||||
|
{
|
||||||
|
// Skip mac+offscreen on Qt <= 5.15.0 due to a QPA crash, fixed in 5.15.1
|
||||||
|
#if defined(Q_OS_MACOS) && QT_VERSION <= QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
if (qApp->platformName() == QLatin1String("offscreen"))
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
struct EnsureTopLevelsDeleted
|
struct EnsureTopLevelsDeleted
|
||||||
{
|
{
|
||||||
EnsureTopLevelsDeleted()
|
EnsureTopLevelsDeleted()
|
||||||
|
|||||||
Reference in New Issue
Block a user