diff --git a/CMakeLists.txt b/CMakeLists.txt index 72271a6..29ca64f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,9 @@ cmake_minimum_required(VERSION 3.5) +if (POLICY CMP0091) + cmake_policy(SET CMP0091 NEW) +endif (POLICY CMP0091) + # By default, the version information is extracted from the git index. However, # we can override this behavior by explicitly setting ADS_VERSION and # skipping the git checks. This is useful for cases where this project is being diff --git a/demo/status_dialog.py b/demo/status_dialog.py index 8c42f15..cf58a38 100644 --- a/demo/status_dialog.py +++ b/demo/status_dialog.py @@ -2,7 +2,7 @@ import os import sys from PyQt5 import uic -from PyQtAds import QtAds +import PyQtAds as QtAds UI_FILE = os.path.join(os.path.dirname(__file__), 'StatusDialog.ui') StatusDialogUI, StatusDialogBase = uic.loadUiType(UI_FILE) diff --git a/doc/user-guide.md b/doc/user-guide.md index a0ceb9d..8615b50 100644 --- a/doc/user-guide.md +++ b/doc/user-guide.md @@ -27,6 +27,7 @@ - [`FloatingContainerForceNativeTitleBar` (Linux only)](#floatingcontainerforcenativetitlebar-linux-only) - [`FloatingContainerForceQWidgetTitleBar` (Linux only)](#floatingcontainerforceqwidgettitlebar-linux-only) - [`MiddleMouseButtonClosesTab`](#middlemousebuttonclosestab) + - [`DisableTabTextEliding`](#disabletabtexteliding) - [Auto-Hide Configuration Flags](#auto-hide-configuration-flags) - [Auto Hide Dock Widgets](#auto-hide-dock-widgets) - [Pinning Auto-Hide Widgets to a certain border](#pinning-auto-hide-widgets-to-a-certain-border) @@ -467,6 +468,10 @@ possible in various web browsers. ![MiddleMouseButtonClosesTab true](cfg_flag_MiddleMouseButtonClosesTab.gif) +### `DisableTabTextEliding` + +Set this flag to disable eliding of tab texts in dock area tabs. + ## Auto-Hide Configuration Flags ### Auto Hide Dock Widgets diff --git a/examples/autohide/main.py b/examples/autohide/main.py index 5fe6a49..48c2927 100644 --- a/examples/autohide/main.py +++ b/examples/autohide/main.py @@ -8,7 +8,7 @@ from PyQt5.QtWidgets import (QApplication, QLabel, QCalendarWidget, QFrame, QTre QTableWidget, QFileSystemModel, QPlainTextEdit, QToolBar, QWidgetAction, QComboBox, QAction, QSizePolicy, QInputDialog) -from PyQtAds import QtAds +import PyQtAds as QtAds UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui') MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE) diff --git a/examples/centralwidget/main.py b/examples/centralwidget/main.py index 5fe6a49..48c2927 100644 --- a/examples/centralwidget/main.py +++ b/examples/centralwidget/main.py @@ -8,7 +8,7 @@ from PyQt5.QtWidgets import (QApplication, QLabel, QCalendarWidget, QFrame, QTre QTableWidget, QFileSystemModel, QPlainTextEdit, QToolBar, QWidgetAction, QComboBox, QAction, QSizePolicy, QInputDialog) -from PyQtAds import QtAds +import PyQtAds as QtAds UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui') MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE) diff --git a/examples/deleteonclose/main.py b/examples/deleteonclose/main.py index 514f1a0..d1504bf 100644 --- a/examples/deleteonclose/main.py +++ b/examples/deleteonclose/main.py @@ -1,6 +1,6 @@ import sys -from PyQtAds import QtAds +import PyQtAds as QtAds from PyQt5.QtGui import QCloseEvent from PyQt5.QtCore import (qDebug, pyqtSlot, QObject, pyqtSignal) from PyQt5.QtWidgets import (QMainWindow, QAction, QTextEdit, QApplication, @@ -70,4 +70,4 @@ if __name__ == '__main__': action.triggered.connect(on_action2_triggered) w.show() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/examples/dockindock/dockindock.py b/examples/dockindock/dockindock.py index 4853b57..5d64fe1 100644 --- a/examples/dockindock/dockindock.py +++ b/examples/dockindock/dockindock.py @@ -3,7 +3,7 @@ import sys from PyQt5.QtWidgets import (QApplication, QWidget, QVBoxLayout, QMessageBox, QInputDialog, QMenu, QLineEdit) from PyQt5.QtGui import QIcon -from PyQtAds import QtAds +import PyQtAds as QtAds from dockindockmanager import DockInDockManager from perspectiveactions import LoadPerspectiveAction, RemovePerspectiveAction @@ -200,4 +200,4 @@ class DockInDockWidget(QWidget): for closed in self.getManager().dockWidgetsMap().values(): if not closed in visible_widgets: - self.dumpStatus(widget=closed, tab=tab, suffix=" (closed)") \ No newline at end of file + self.dumpStatus(widget=closed, tab=tab, suffix=" (closed)") diff --git a/examples/dockindock/dockindockmanager.py b/examples/dockindock/dockindockmanager.py index c6f47cb..224d719 100644 --- a/examples/dockindock/dockindockmanager.py +++ b/examples/dockindock/dockindockmanager.py @@ -1,7 +1,7 @@ from PyQt5.QtWidgets import QAction, QMenu, QInputDialog, QLineEdit from PyQt5.QtCore import QSettings -from PyQtAds import QtAds +import PyQtAds as QtAds CHILD_PREFIX = "Child-" @@ -211,4 +211,4 @@ class MoveDockWidgetAction(QAction): widget.dockManager().removeDockWidget(widget) move_to.addDockWidget(QtAds.CenterDockWidgetArea, widget, move_to.getInsertDefaultPos()) else: - assert False \ No newline at end of file + assert False diff --git a/examples/dockindock/main.py b/examples/dockindock/main.py index 5b6e478..be32b08 100644 --- a/examples/dockindock/main.py +++ b/examples/dockindock/main.py @@ -4,7 +4,7 @@ import atexit from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel from PyQt5.QtCore import Qt -from PyQtAds import QtAds +import PyQtAds as QtAds from perspectives import PerspectivesManager from dockindock import DockInDockWidget @@ -69,4 +69,4 @@ if __name__ == '__main__': w = MainWindow() w.show() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/examples/dockindock/perspectives.py b/examples/dockindock/perspectives.py index ab9dddb..9b6c00d 100644 --- a/examples/dockindock/perspectives.py +++ b/examples/dockindock/perspectives.py @@ -4,7 +4,7 @@ import shutil import atexit from PyQt5.QtCore import pyqtSignal, QSettings, QObject -from PyQtAds import QtAds +import PyQtAds as QtAds from dockindockmanager import DockInDockManager from dockindock import DockInDockWidget @@ -200,4 +200,4 @@ class PerspectivesManager(QObject): except FileNotFoundError: pass if not shutil.copy(settings.fileName(), to_save): - assert False \ No newline at end of file + assert False diff --git a/examples/emptydockarea/main.py b/examples/emptydockarea/main.py index 046d45f..475cc2e 100644 --- a/examples/emptydockarea/main.py +++ b/examples/emptydockarea/main.py @@ -6,7 +6,7 @@ from PyQt5.QtCore import Qt, QSignalBlocker from PyQt5.QtWidgets import (QApplication, QMainWindow, QLabel, QComboBox, QTableWidget, QAction, QWidgetAction, QSizePolicy, QInputDialog) from PyQt5.QtGui import QCloseEvent -from PyQtAds import QtAds +import PyQtAds as QtAds UI_FILE = os.path.join(os.path.dirname(__file__), 'mainwindow.ui') @@ -105,4 +105,4 @@ if __name__ == '__main__': w = CMainWindow() w.show() - app.exec_() \ No newline at end of file + app.exec_() diff --git a/examples/sidebar/main.py b/examples/sidebar/main.py index 27170ba..8005908 100644 --- a/examples/sidebar/main.py +++ b/examples/sidebar/main.py @@ -5,7 +5,7 @@ from PyQt5 import uic from PyQt5.QtCore import Qt, QMargins from PyQt5.QtWidgets import QApplication, QLabel, QVBoxLayout, QPlainTextEdit -from PyQtAds import QtAds +import PyQtAds as QtAds UI_FILE = os.path.join(os.path.dirname(__file__), 'MainWindow.ui') MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE) diff --git a/examples/simple/main.py b/examples/simple/main.py index b21767d..dcacef8 100644 --- a/examples/simple/main.py +++ b/examples/simple/main.py @@ -6,7 +6,7 @@ from PyQt5.QtCore import Qt, QTimer from PyQt5.QtGui import QCloseEvent from PyQt5.QtWidgets import QApplication, QLabel -from PyQtAds import QtAds +import PyQtAds as QtAds UI_FILE = os.path.join(os.path.dirname(__file__), 'MainWindow.ui') MainWindowUI, MainWindowBase = uic.loadUiType(UI_FILE) diff --git a/pyproject.toml b/pyproject.toml index cbe95d1..a9b93bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ # Specify the build system. [build-system] -requires = ["sip >=6.0.2, <6.3", "PyQt-builder >=1.6, <2", "PyQt5==5.15.4", "PyQt5-sip<13,>=12.8"] +requires = ["sip >=6.0.2", "PyQt-builder >=1.6", "PyQt5>=5.15", "PyQt5-sip>=12.8"] build-backend = "sipbuild.api" # Specify the PEP 566 metadata for the project. [tool.sip.metadata] name = "PyQtAds" -version = "4.0.2" +version = "4.4.1" summary = "Python bindings for Qt Advanced Docking System" home-page = "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/" license = "LGPL v2.1" @@ -16,8 +16,10 @@ description-content-type = "text/markdown" [tool.sip.project] tag-prefix = "QtAds" +dunder-init = true [tool.sip.bindings.ads] +pep484-pyi = true define-macros = ["ADS_SHARED_EXPORT"] sip-file = "ads.sip" include-dirs = ["src"] diff --git a/sip/ads.sip b/sip/ads.sip index 70a252a..28c2695 100644 --- a/sip/ads.sip +++ b/sip/ads.sip @@ -1,4 +1,6 @@ %Module(name=PyQtAds, call_super_init=True, keyword_arguments="Optional", use_limited_api=True) +%HideNamespace(name=ads) + %Import QtCore/QtCoremod.sip %DefaultSupertype sip.simplewrapper diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 512aee1..23848d9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,6 +98,7 @@ set_target_properties(${library_name} PROPERTIES CXX_EXTENSIONS OFF VERSION ${VERSION_SHORT} EXPORT_NAME ${library_name} + DEBUG_POSTFIX "d" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/lib" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${ads_PlatformDir}/bin" diff --git a/src/DockManager.h b/src/DockManager.h index 124fe35..c626c00 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -213,6 +213,7 @@ public: //!< If neither this nor FloatingContainerForceNativeTitleBar is set (the default) native titlebars are used except on known bad systems. //! Users can overwrite this by setting the environment variable ADS_UseNativeTitle to "1" or "0". MiddleMouseButtonClosesTab = 0x2000000, //! If the flag is set, the user can use the mouse middle button to close the tab under the mouse + DisableTabTextEliding = 0x4000000, //! Set this flag to disable eliding of tab texts in dock area tabs DefaultDockAreaButtons = DockAreaHasCloseButton | DockAreaHasUndockButton diff --git a/src/DockWidgetTab.cpp b/src/DockWidgetTab.cpp index 669ddf3..040939a 100644 --- a/src/DockWidgetTab.cpp +++ b/src/DockWidgetTab.cpp @@ -245,7 +245,14 @@ DockWidgetTabPrivate::DockWidgetTabPrivate(CDockWidgetTab* _public) : void DockWidgetTabPrivate::createLayout() { TitleLabel = new tTabLabel(); - TitleLabel->setElideMode(Qt::ElideRight); + if (CDockManager::testConfigFlag(CDockManager::DisableTabTextEliding)) + { + TitleLabel->setElideMode(Qt::ElideNone); + } + else + { + TitleLabel->setElideMode(Qt::ElideRight); + } TitleLabel->setText(DockWidget->windowTitle()); TitleLabel->setObjectName("dockWidgetTabLabel"); TitleLabel->setAlignment(Qt::AlignCenter); diff --git a/src/FloatingDockContainer.cpp b/src/FloatingDockContainer.cpp index aceacdd..2ebf4a5 100644 --- a/src/FloatingDockContainer.cpp +++ b/src/FloatingDockContainer.cpp @@ -662,7 +662,6 @@ CFloatingDockContainer::CFloatingDockContainer(CDockManager *DockManager) : #if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) QDockWidget::setWidget(d->DockContainer); - QDockWidget::setFloating(true); QDockWidget::setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);