From 27b708c26667260f7ab568f6daeaea0be0f7d363 Mon Sep 17 00:00:00 2001 From: Nate Skulic Date: Thu, 28 Sep 2023 19:09:19 -0500 Subject: [PATCH] Improve Python Support. - Make QtAds sip builds functional in Python. - Reduced the unnecessary depth of the package. NOTE: This is a breaking change for python users, where, `from PyQtAds import QtAds` is changed to `import PyQtAds as QtAds` --- demo/status_dialog.py | 2 +- examples/autohide/main.py | 2 +- examples/centralwidget/main.py | 2 +- examples/deleteonclose/main.py | 2 +- examples/dockindock/dockindock.py | 2 +- examples/dockindock/dockindockmanager.py | 2 +- examples/dockindock/main.py | 2 +- examples/dockindock/perspectives.py | 2 +- examples/emptydockarea/main.py | 2 +- examples/sidebar/main.py | 2 +- examples/simple/main.py | 2 +- sip/AutoHideTab.sip | 2 +- sip/ads.sip | 3 ++- 13 files changed, 14 insertions(+), 13 deletions(-) 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/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..8b9297e 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, diff --git a/examples/dockindock/dockindock.py b/examples/dockindock/dockindock.py index 4853b57..4040eda 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 diff --git a/examples/dockindock/dockindockmanager.py b/examples/dockindock/dockindockmanager.py index c6f47cb..b324e36 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-" diff --git a/examples/dockindock/main.py b/examples/dockindock/main.py index 5b6e478..c39b7fe 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 diff --git a/examples/dockindock/perspectives.py b/examples/dockindock/perspectives.py index ab9dddb..d34300e 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 diff --git a/examples/emptydockarea/main.py b/examples/emptydockarea/main.py index 046d45f..b2f563b 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') 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/sip/AutoHideTab.sip b/sip/AutoHideTab.sip index 4d72e7b..5ae6be2 100644 --- a/sip/AutoHideTab.sip +++ b/sip/AutoHideTab.sip @@ -5,7 +5,7 @@ namespace ads { -class CAutoHideTab : CPushButton +class CAutoHideTab : ads::CPushButton { %TypeHeaderCode diff --git a/sip/ads.sip b/sip/ads.sip index 70a252a..f485595 100644 --- a/sip/ads.sip +++ b/sip/ads.sip @@ -1,4 +1,5 @@ -%Module(name=PyQtAds, call_super_init=True, keyword_arguments="Optional", use_limited_api=True) +%Module(name=PyQtAds.ads, call_super_init=True, keyword_arguments="Optional", use_limited_api=True) + %Import QtCore/QtCoremod.sip %DefaultSupertype sip.simplewrapper