diff options
Diffstat (limited to 'examples/widgets/widgetsgallery/widgetgallery.py')
-rw-r--r-- | examples/widgets/widgetsgallery/widgetgallery.py | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/examples/widgets/widgetsgallery/widgetgallery.py b/examples/widgets/widgetsgallery/widgetgallery.py index d96241106..d43ab26a5 100644 --- a/examples/widgets/widgetsgallery/widgetgallery.py +++ b/examples/widgets/widgetsgallery/widgetgallery.py @@ -3,13 +3,21 @@ import sys -from PySide6.QtWidgets import * +from PySide6.QtCore import (QDateTime, QDir, QLibraryInfo, QSysInfo, Qt, + QTimer, Slot, qVersion) from PySide6.QtGui import (QCursor, QDesktopServices, QGuiApplication, QIcon, QKeySequence, QShortcut, QStandardItem, - QStandardItemModel, QScreen, QWindow) -from PySide6.QtCore import (QDateTime, QDir, QLibraryInfo, QMetaObject, - QSysInfo, QTextStream, QTimer, Qt, qVersion) - + QStandardItemModel) +from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, + QCommandLinkButton, QDateTimeEdit, QDial, + QDialog, QDialogButtonBox, QFileSystemModel, + QGridLayout, QGroupBox, QHBoxLayout, QLabel, + QLineEdit, QListView, QMenu, QPlainTextEdit, + QProgressBar, QPushButton, QRadioButton, + QScrollBar, QSizePolicy, QSlider, QSpinBox, + QStyleFactory, QTableWidget, QTabWidget, + QTextBrowser, QTextEdit, QToolBox, QToolButton, + QTreeView, QVBoxLayout, QWidget) POEM = """Twinkle, twinkle, little star, How I wonder what you are. @@ -156,8 +164,8 @@ class WidgetGallery(QDialog): top_layout.addStretch(1) top_layout.addWidget(disable_widgets_checkbox) - dialog_buttonbox = QDialogButtonBox(QDialogButtonBox.Help | - QDialogButtonBox.Close) + dialog_buttonbox = QDialogButtonBox(QDialogButtonBox.Help + | QDialogButtonBox.Close) init_widget(dialog_buttonbox, "dialogButtonBox") dialog_buttonbox.helpRequested.connect(launch_module_help) dialog_buttonbox.rejected.connect(self.reject) @@ -180,9 +188,11 @@ class WidgetGallery(QDialog): self.windowHandle().screenChanged.connect(self.update_systeminfo) self.update_systeminfo() + @Slot(str) def change_style(self, style_name): QApplication.setStyle(QStyleFactory.create(style_name)) + @Slot() def advance_progressbar(self): cur_val = self._progress_bar.value() max_val = self._progress_bar.maximum() @@ -379,6 +389,7 @@ class WidgetGallery(QDialog): timer.start(1000) return result + @Slot() def update_systeminfo(self): """Display system information""" system_info = SYSTEMINFO.format(sys.version, @@ -387,6 +398,7 @@ class WidgetGallery(QDialog): screen_info(self)) self._systeminfo_textbrowser.setHtml(system_info) + @Slot() def help_on_current_widget(self): """Display help on widget under mouse""" w = QApplication.widgetAt(QCursor.pos(self.screen())) |