2021-07-14 03:46:41 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
#
|
|
|
|
# The MIT License (MIT)
|
|
|
|
#
|
|
|
|
# Copyright (c) <2013-2014> <Colin Duquesnoy>
|
|
|
|
# Modified by Alex Huszagh
|
2016-10-26 18:44:37 +00:00
|
|
|
#
|
2021-07-14 03:46:41 +00:00
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the 'Software'), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
2016-10-26 18:44:37 +00:00
|
|
|
#
|
2021-07-14 03:46:41 +00:00
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
# THE SOFTWARE.
|
|
|
|
|
|
|
|
'''
|
|
|
|
example
|
|
|
|
=======
|
|
|
|
'''
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import logging
|
2021-07-14 21:57:20 +00:00
|
|
|
import os
|
2021-07-14 03:46:41 +00:00
|
|
|
import sys
|
2016-10-26 18:44:37 +00:00
|
|
|
|
|
|
|
from PyQt5 import QtCore, QtGui, QtWidgets
|
2021-07-14 03:46:41 +00:00
|
|
|
import breeze_resources
|
|
|
|
|
|
|
|
# Create our arguments.
|
|
|
|
parser = argparse.ArgumentParser(description='Configurations for the Qt5 application.')
|
|
|
|
parser.add_argument(
|
|
|
|
'--stylesheet',
|
|
|
|
help='''stylesheet name''',
|
|
|
|
default='native'
|
|
|
|
)
|
2021-07-15 01:22:33 +00:00
|
|
|
# Know working styles include:
|
|
|
|
# 1. Fusion
|
|
|
|
# 2. Windows
|
|
|
|
parser.add_argument(
|
|
|
|
'--style',
|
|
|
|
help='''application style, which is different than the stylesheet''',
|
|
|
|
default='native'
|
|
|
|
)
|
2021-07-14 03:46:41 +00:00
|
|
|
parser.add_argument(
|
|
|
|
'--font-size',
|
|
|
|
help='''font size for the application''',
|
|
|
|
type=float,
|
|
|
|
default=-1
|
|
|
|
)
|
|
|
|
parser.add_argument(
|
|
|
|
'--font-family',
|
|
|
|
help='''the font family'''
|
|
|
|
)
|
2021-07-14 21:57:20 +00:00
|
|
|
parser.add_argument(
|
|
|
|
'--scale',
|
|
|
|
help='''scale factor for the UI''',
|
|
|
|
type=float,
|
|
|
|
default=1,
|
|
|
|
)
|
2016-10-26 18:44:37 +00:00
|
|
|
|
2021-07-14 03:46:41 +00:00
|
|
|
class Ui:
|
|
|
|
'''Main class for the user interface.'''
|
|
|
|
|
|
|
|
def setup(self, MainWindow):
|
|
|
|
MainWindow.setObjectName('MainWindow')
|
2016-10-26 18:44:37 +00:00
|
|
|
MainWindow.resize(1068, 824)
|
|
|
|
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.centralwidget.setObjectName('centralwidget')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.centralwidget)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalLayout_5.setObjectName('verticalLayout_5')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
|
|
|
|
self.tabWidget.setTabPosition(QtWidgets.QTabWidget.East)
|
|
|
|
self.tabWidget.setTabsClosable(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget.setObjectName('tabWidget')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tab = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tab.setObjectName('tab')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout = QtWidgets.QGridLayout(self.tab)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout.setObjectName('gridLayout')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.groupBox = QtWidgets.QGroupBox(self.tab)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.groupBox.setObjectName('groupBox')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalLayout_3.setObjectName('verticalLayout_3')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.toolBox = QtWidgets.QToolBox(self.groupBox)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.toolBox.setObjectName('toolBox')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.page = QtWidgets.QWidget()
|
|
|
|
self.page.setGeometry(QtCore.QRect(0, 0, 718, 227))
|
2021-07-14 03:46:41 +00:00
|
|
|
self.page.setObjectName('page')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_4 = QtWidgets.QGridLayout(self.page)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_4.setObjectName('gridLayout_4')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.lineEdit = QtWidgets.QLineEdit(self.page)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.lineEdit.setObjectName('lineEdit')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_4.addWidget(self.lineEdit, 0, 0, 1, 1)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.toolBox.addItem(self.page, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.page_2 = QtWidgets.QWidget()
|
|
|
|
self.page_2.setGeometry(QtCore.QRect(0, 0, 718, 227))
|
2021-07-14 03:46:41 +00:00
|
|
|
self.page_2.setObjectName('page_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_5 = QtWidgets.QGridLayout(self.page_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_5.setObjectName('gridLayout_5')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.listWidget = QtWidgets.QListWidget(self.page_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.listWidget.setObjectName('listWidget')
|
2016-10-26 18:44:37 +00:00
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
item = QtWidgets.QListWidgetItem()
|
|
|
|
self.listWidget.addItem(item)
|
|
|
|
self.gridLayout_5.addWidget(self.listWidget, 0, 0, 1, 1)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.toolBox.addItem(self.page_2, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_3.addWidget(self.toolBox)
|
|
|
|
self.gridLayout.addWidget(self.groupBox, 1, 0, 1, 1)
|
|
|
|
self.tabWidget_2 = QtWidgets.QTabWidget(self.tab)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget_2.setObjectName('tabWidget_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tab_3 = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tab_3.setObjectName('tab_3')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_3)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_6.setObjectName('gridLayout_6')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.checkableButton = QtWidgets.QPushButton(self.tab_3)
|
|
|
|
self.checkableButton.setCheckable(True)
|
|
|
|
self.checkableButton.setChecked(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.checkableButton.setObjectName('checkableButton')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_6.addWidget(self.checkableButton, 1, 0, 1, 1)
|
|
|
|
self.pushButton = QtWidgets.QPushButton(self.tab_3)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.pushButton.setObjectName('pushButton')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.pushButton.setToolTip('Sample Tooltip1')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_6.addWidget(self.pushButton, 0, 0, 1, 1)
|
|
|
|
self.pushButton_5 = QtWidgets.QPushButton(self.tab_3)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.pushButton_5.setObjectName('pushButton_5')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_6.addWidget(self.pushButton_5, 2, 0, 1, 1)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget_2.addTab(self.tab_3, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tab_5 = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tab_5.setObjectName('tab_5')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_7 = QtWidgets.QGridLayout(self.tab_5)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_7.setObjectName('gridLayout_7')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tableWidget = QtWidgets.QTableWidget(self.tab_5)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tableWidget.setObjectName('tableWidget')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tableWidget.setColumnCount(2)
|
|
|
|
self.tableWidget.setRowCount(4)
|
|
|
|
item = QtWidgets.QTableWidgetItem()
|
|
|
|
self.tableWidget.setVerticalHeaderItem(0, item)
|
|
|
|
item = QtWidgets.QTableWidgetItem()
|
|
|
|
self.tableWidget.setVerticalHeaderItem(1, item)
|
|
|
|
item = QtWidgets.QTableWidgetItem()
|
|
|
|
self.tableWidget.setVerticalHeaderItem(2, item)
|
|
|
|
item = QtWidgets.QTableWidgetItem()
|
|
|
|
self.tableWidget.setVerticalHeaderItem(3, item)
|
|
|
|
item = QtWidgets.QTableWidgetItem()
|
|
|
|
self.tableWidget.setHorizontalHeaderItem(0, item)
|
|
|
|
item = QtWidgets.QTableWidgetItem()
|
|
|
|
self.tableWidget.setHorizontalHeaderItem(1, item)
|
|
|
|
self.gridLayout_7.addWidget(self.tableWidget, 0, 0, 1, 1)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget_2.addTab(self.tab_5, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tab_4 = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tab_4.setObjectName('tab_4')
|
2021-07-16 19:30:46 +00:00
|
|
|
self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.tab_4)
|
|
|
|
self.calendar = QtWidgets.QCalendarWidget(self.tab_4)
|
|
|
|
self.calendar.setGridVisible(True)
|
|
|
|
self.verticalLayout_6.addWidget(self.calendar)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget_2.addTab(self.tab_4, '')
|
2021-07-16 19:30:46 +00:00
|
|
|
self.tab_5v2 = QtWidgets.QWidget()
|
|
|
|
self.tab_5v2.setObjectName('tab_5v2')
|
|
|
|
self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.tab_5v2)
|
|
|
|
self.tableWidget_2 = QtWidgets.QTableWidget(self.tab_5v2)
|
|
|
|
self.tableWidget_2.setColumnCount(100)
|
|
|
|
self.tableWidget_2.setRowCount(1)
|
|
|
|
item = QtWidgets.QTableWidgetItem(f'Row 1')
|
|
|
|
self.tableWidget_2.setVerticalHeaderItem(0, item)
|
|
|
|
for index in range(100):
|
|
|
|
item = QtWidgets.QTableWidgetItem(f'Column {index + 1}')
|
|
|
|
self.tableWidget_2.setHorizontalHeaderItem(index, item)
|
|
|
|
self.verticalLayout_7.addWidget(self.tableWidget_2)
|
|
|
|
self.tabWidget_2.addTab(self.tab_5v2, '')
|
|
|
|
self.tab_6v2 = QtWidgets.QWidget()
|
|
|
|
self.tab_6v2.setObjectName('tab_6v2')
|
|
|
|
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.tab_6v2)
|
|
|
|
splitter = QtWidgets.QSplitter(self.tab_6v2)
|
|
|
|
splitter.addWidget(QtWidgets.QListWidget(self.tab_6v2))
|
|
|
|
tree = QtWidgets.QTreeWidget(self.tab_6v2)
|
|
|
|
item_12 = QtWidgets.QTreeWidgetItem(tree, ['Row 1'])
|
|
|
|
splitter.addWidget(tree)
|
|
|
|
splitter.addWidget(QtWidgets.QTextEdit(self.tab_6v2))
|
|
|
|
self.verticalLayout_8.addWidget(splitter)
|
|
|
|
self.tabWidget_2.addTab(self.tab_6v2, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout.addWidget(self.tabWidget_2, 0, 0, 1, 1)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget.addTab(self.tab, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.tab_2 = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tab_2.setObjectName('tab_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_2 = QtWidgets.QGridLayout(self.tab_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_2.setObjectName('gridLayout_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.groupBox_2 = QtWidgets.QGroupBox(self.tab_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.groupBox_2.setObjectName('groupBox_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalLayout_4.setObjectName('verticalLayout_4')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.label = QtWidgets.QLabel(self.groupBox_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.label.setObjectName('label')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_4.addWidget(self.label)
|
|
|
|
self.radioButton = QtWidgets.QRadioButton(self.groupBox_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.radioButton.setObjectName('radioButton')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_4.addWidget(self.radioButton)
|
|
|
|
self.checkBox = QtWidgets.QCheckBox(self.groupBox_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.checkBox.setObjectName('checkBox')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_4.addWidget(self.checkBox)
|
|
|
|
self.checkBox_2 = QtWidgets.QCheckBox(self.groupBox_2)
|
|
|
|
self.checkBox_2.setTristate(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.checkBox_2.setObjectName('checkBox_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_4.addWidget(self.checkBox_2)
|
2021-07-13 18:30:57 +00:00
|
|
|
self.checkBox_3 = QtWidgets.QCheckBox(self.groupBox_2)
|
|
|
|
self.checkBox_3.setEnabled(False)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.checkBox_3.setObjectName('checkBox_3')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.verticalLayout_4.addWidget(self.checkBox_3)
|
2016-10-26 18:44:37 +00:00
|
|
|
self.treeWidget = QtWidgets.QTreeWidget(self.groupBox_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.treeWidget.setObjectName('treeWidget')
|
2016-10-26 18:44:37 +00:00
|
|
|
item_0 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
2018-12-03 13:04:04 +00:00
|
|
|
item_1 = QtWidgets.QTreeWidgetItem(self.treeWidget)
|
|
|
|
item_2 = QtWidgets.QTreeWidgetItem(item_1)
|
2021-07-14 03:46:41 +00:00
|
|
|
item_2.setText(0, 'subitem')
|
2021-07-15 20:43:27 +00:00
|
|
|
item_3 = QtWidgets.QTreeWidgetItem(item_2, ['Row 2.1'])
|
2021-07-16 02:09:27 +00:00
|
|
|
item_3.setFlags(item_3.flags() | QtCore.Qt.ItemIsUserCheckable)
|
|
|
|
item_3.setCheckState(0, QtCore.Qt.Unchecked)
|
2021-07-15 20:43:27 +00:00
|
|
|
item_4 = QtWidgets.QTreeWidgetItem(item_2, ['Row 2.2'])
|
|
|
|
item_5 = QtWidgets.QTreeWidgetItem(item_4, ['Row 2.2.1'])
|
|
|
|
item_6 = QtWidgets.QTreeWidgetItem(item_5, ['Row 2.2.1.1'])
|
|
|
|
item_7 = QtWidgets.QTreeWidgetItem(item_5, ['Row 2.2.1.2'])
|
2021-07-16 02:09:27 +00:00
|
|
|
item_7.setFlags(item_7.flags() | QtCore.Qt.ItemIsUserCheckable)
|
|
|
|
item_7.setCheckState(0, QtCore.Qt.Checked)
|
2021-07-15 20:43:27 +00:00
|
|
|
item_8 = QtWidgets.QTreeWidgetItem(item_2, ['Row 2.3'])
|
2021-07-16 02:09:27 +00:00
|
|
|
item_8.setFlags(item_8.flags() | QtCore.Qt.ItemIsUserTristate)
|
|
|
|
item_8.setCheckState(0, QtCore.Qt.PartiallyChecked)
|
2021-07-15 20:43:27 +00:00
|
|
|
item_9 = QtWidgets.QTreeWidgetItem(self.treeWidget, ['Row 3'])
|
|
|
|
item_10 = QtWidgets.QTreeWidgetItem(item_9, ['Row 3.1'])
|
|
|
|
item_11 = QtWidgets.QTreeWidgetItem(self.treeWidget, ['Row 4'])
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_4.addWidget(self.treeWidget)
|
|
|
|
self.gridLayout_2.addWidget(self.groupBox_2, 0, 0, 1, 1)
|
2021-07-13 18:30:57 +00:00
|
|
|
self.tab_3v2 = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tab_3v2.setObjectName('tab_3v2')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.gridLayout_3v2 = QtWidgets.QGridLayout(self.tab_3v2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_3v2.setObjectName('gridLayout_3v2')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.groupBox_3v2 = QtWidgets.QGroupBox(self.tab_3v2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.groupBox_3v2.setObjectName('groupBox_3v2')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.verticalLayout_4v2 = QtWidgets.QVBoxLayout(self.groupBox_3v2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalLayout_4v2.setObjectName('verticalLayout_4v2')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.tabBar = QtWidgets.QTabBar(self.tab_3v2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_3v2.setObjectName('tabBar')
|
|
|
|
self.tabBar.addTab('TabBar Tab 1')
|
|
|
|
self.tabBar.addTab('TabBar Tab 2')
|
|
|
|
self.tabBar.addTab('TabBar Tab 3')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.verticalLayout_4v2.addWidget(self.tabBar, 0, QtCore.Qt.AlignTop)
|
|
|
|
self.gridLayout_3v2.addWidget(self.groupBox_3v2, 0, 0, 1, 1)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget.addTab(self.tab_2, '')
|
|
|
|
self.tabWidget.addTab(self.tab_3v2, '')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_5.addWidget(self.tabWidget)
|
|
|
|
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.horizontalLayout.setObjectName('horizontalLayout')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.pushButton_2.setObjectName('pushButton_2')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.pushButton_2.setToolTip('Sample Tooltip2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.pushButton_2)
|
|
|
|
self.bt_delay_popup = QtWidgets.QToolButton(self.centralwidget)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.bt_delay_popup.setObjectName('bt_delay_popup')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.bt_delay_popup)
|
|
|
|
self.bt_instant_popup = QtWidgets.QToolButton(self.centralwidget)
|
|
|
|
self.bt_instant_popup.setPopupMode(QtWidgets.QToolButton.InstantPopup)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.bt_instant_popup.setObjectName('bt_instant_popup')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.bt_instant_popup)
|
|
|
|
self.bt_menu_button_popup = QtWidgets.QToolButton(self.centralwidget)
|
|
|
|
self.bt_menu_button_popup.setPopupMode(QtWidgets.QToolButton.MenuButtonPopup)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.bt_menu_button_popup.setObjectName('bt_menu_button_popup')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.bt_menu_button_popup)
|
|
|
|
self.line_2 = QtWidgets.QFrame(self.centralwidget)
|
|
|
|
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
|
|
|
|
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.line_2.setObjectName('line_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.line_2)
|
|
|
|
self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget)
|
|
|
|
self.pushButton_3.setEnabled(False)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.pushButton_3.setObjectName('pushButton_3')
|
2021-07-13 18:30:57 +00:00
|
|
|
self.pushButton_3.setToolTip('Sample Tooltip3')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.pushButton_3)
|
|
|
|
self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.centralwidget)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.doubleSpinBox.setObjectName('doubleSpinBox')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.doubleSpinBox)
|
|
|
|
self.toolButton = QtWidgets.QToolButton(self.centralwidget)
|
|
|
|
self.toolButton.setPopupMode(QtWidgets.QToolButton.InstantPopup)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.toolButton.setObjectName('toolButton')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.horizontalLayout.addWidget(self.toolButton)
|
|
|
|
self.verticalLayout_5.addLayout(self.horizontalLayout)
|
|
|
|
MainWindow.setCentralWidget(self.centralwidget)
|
|
|
|
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
|
|
|
self.menubar.setGeometry(QtCore.QRect(0, 0, 1068, 29))
|
2021-07-14 03:46:41 +00:00
|
|
|
self.menubar.setObjectName('menubar')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.menuMenu = QtWidgets.QMenu(self.menubar)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.menuMenu.setObjectName('menuMenu')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.menuSubmenu_2 = QtWidgets.QMenu(self.menuMenu)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.menuSubmenu_2.setObjectName('menuSubmenu_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
MainWindow.setMenuBar(self.menubar)
|
|
|
|
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.statusbar.setObjectName('statusbar')
|
2016-10-26 18:44:37 +00:00
|
|
|
MainWindow.setStatusBar(self.statusbar)
|
|
|
|
self.dockWidget1 = QtWidgets.QDockWidget(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.dockWidget1.setObjectName('dockWidget1')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.dockWidgetContents = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.dockWidgetContents.setObjectName('dockWidgetContents')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.dockWidgetContents)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalLayout_2.setObjectName('verticalLayout_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout = QtWidgets.QVBoxLayout()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalLayout.setObjectName('verticalLayout')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.comboBox = QtWidgets.QComboBox(self.dockWidgetContents)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.comboBox.setObjectName('comboBox')
|
2021-07-16 19:30:46 +00:00
|
|
|
self.comboBox.setEditable(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.comboBox.addItem('')
|
|
|
|
self.comboBox.addItem('')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout.addWidget(self.comboBox)
|
|
|
|
self.horizontalSlider = QtWidgets.QSlider(self.dockWidgetContents)
|
|
|
|
self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.horizontalSlider.setObjectName('horizontalSlider')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout.addWidget(self.horizontalSlider)
|
|
|
|
self.textEdit = QtWidgets.QTextEdit(self.dockWidgetContents)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.textEdit.setObjectName('textEdit')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout.addWidget(self.textEdit)
|
|
|
|
self.line = QtWidgets.QFrame(self.dockWidgetContents)
|
|
|
|
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
|
|
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.line.setObjectName('line')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout.addWidget(self.line)
|
|
|
|
self.progressBar = QtWidgets.QProgressBar(self.dockWidgetContents)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.progressBar.setProperty('value', 24)
|
|
|
|
self.progressBar.setObjectName('progressBar')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout.addWidget(self.progressBar)
|
|
|
|
self.verticalLayout_2.addLayout(self.verticalLayout)
|
|
|
|
self.frame = QtWidgets.QFrame(self.dockWidgetContents)
|
|
|
|
self.frame.setMinimumSize(QtCore.QSize(0, 100))
|
|
|
|
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
|
|
|
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
|
|
|
|
self.frame.setLineWidth(3)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.frame.setObjectName('frame')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalLayout_2.addWidget(self.frame)
|
|
|
|
self.dockWidget1.setWidget(self.dockWidgetContents)
|
|
|
|
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget1)
|
|
|
|
self.toolBar = QtWidgets.QToolBar(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.toolBar.setObjectName('toolBar')
|
2016-10-26 18:44:37 +00:00
|
|
|
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
|
|
|
self.dockWidget2 = QtWidgets.QDockWidget(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.dockWidget2.setObjectName('dockWidget2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.dockWidgetContents_2 = QtWidgets.QWidget()
|
2021-07-14 03:46:41 +00:00
|
|
|
self.dockWidgetContents_2.setObjectName('dockWidgetContents_2')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_3 = QtWidgets.QGridLayout(self.dockWidgetContents_2)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.gridLayout_3.setObjectName('gridLayout_3')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.verticalSlider = QtWidgets.QSlider(self.dockWidgetContents_2)
|
|
|
|
self.verticalSlider.setOrientation(QtCore.Qt.Vertical)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.verticalSlider.setObjectName('verticalSlider')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.gridLayout_3.addWidget(self.verticalSlider, 0, 0, 1, 1)
|
|
|
|
self.dockWidget2.setWidget(self.dockWidgetContents_2)
|
|
|
|
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget2)
|
|
|
|
self.actionAction = QtWidgets.QAction(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.actionAction.setObjectName('actionAction')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.actionSub_menu = QtWidgets.QAction(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.actionSub_menu.setObjectName('actionSub_menu')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.actionAction_C = QtWidgets.QAction(MainWindow)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.actionAction_C.setObjectName('actionAction_C')
|
2016-10-26 18:44:37 +00:00
|
|
|
self.menuSubmenu_2.addAction(self.actionSub_menu)
|
|
|
|
self.menuSubmenu_2.addAction(self.actionAction_C)
|
|
|
|
self.menuMenu.addAction(self.actionAction)
|
|
|
|
self.menuMenu.addAction(self.menuSubmenu_2.menuAction())
|
|
|
|
self.menubar.addAction(self.menuMenu.menuAction())
|
|
|
|
self.toolBar.addAction(self.actionAction)
|
|
|
|
self.toolBar.addAction(self.actionSub_menu)
|
|
|
|
|
|
|
|
self.retranslateUi(MainWindow)
|
|
|
|
self.tabWidget.setCurrentIndex(0)
|
|
|
|
self.toolBox.setCurrentIndex(1)
|
|
|
|
self.tabWidget_2.setCurrentIndex(0)
|
|
|
|
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
|
|
|
MainWindow.setTabOrder(self.pushButton, self.checkableButton)
|
|
|
|
MainWindow.setTabOrder(self.checkableButton, self.pushButton_5)
|
|
|
|
MainWindow.setTabOrder(self.pushButton_5, self.tabWidget_2)
|
|
|
|
MainWindow.setTabOrder(self.tabWidget_2, self.tableWidget)
|
|
|
|
MainWindow.setTabOrder(self.tableWidget, self.radioButton)
|
|
|
|
MainWindow.setTabOrder(self.radioButton, self.checkBox)
|
|
|
|
MainWindow.setTabOrder(self.checkBox, self.checkBox_2)
|
|
|
|
MainWindow.setTabOrder(self.checkBox_2, self.treeWidget)
|
|
|
|
MainWindow.setTabOrder(self.treeWidget, self.pushButton_2)
|
|
|
|
MainWindow.setTabOrder(self.pushButton_2, self.bt_delay_popup)
|
|
|
|
MainWindow.setTabOrder(self.bt_delay_popup, self.bt_instant_popup)
|
|
|
|
MainWindow.setTabOrder(self.bt_instant_popup, self.bt_menu_button_popup)
|
|
|
|
MainWindow.setTabOrder(self.bt_menu_button_popup, self.pushButton_3)
|
|
|
|
MainWindow.setTabOrder(self.pushButton_3, self.doubleSpinBox)
|
|
|
|
MainWindow.setTabOrder(self.doubleSpinBox, self.toolButton)
|
|
|
|
MainWindow.setTabOrder(self.toolButton, self.comboBox)
|
|
|
|
MainWindow.setTabOrder(self.comboBox, self.horizontalSlider)
|
|
|
|
MainWindow.setTabOrder(self.horizontalSlider, self.textEdit)
|
|
|
|
MainWindow.setTabOrder(self.textEdit, self.verticalSlider)
|
|
|
|
MainWindow.setTabOrder(self.verticalSlider, self.tabWidget)
|
|
|
|
MainWindow.setTabOrder(self.tabWidget, self.lineEdit)
|
|
|
|
MainWindow.setTabOrder(self.lineEdit, self.listWidget)
|
|
|
|
|
|
|
|
def retranslateUi(self, MainWindow):
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
2021-07-14 03:46:41 +00:00
|
|
|
MainWindow.setWindowTitle(_translate('MainWindow', 'MainWindow'))
|
|
|
|
self.groupBox.setTitle(_translate('MainWindow', 'ToolBox'))
|
|
|
|
self.toolBox.setItemText(self.toolBox.indexOf(self.page), _translate('MainWindow', 'Page 1'))
|
2016-10-26 18:44:37 +00:00
|
|
|
self.listWidget.setSortingEnabled(False)
|
|
|
|
item = self.listWidget.item(0)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(1)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(2)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(3)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(4)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(5)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(6)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.listWidget.item(7)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Item'))
|
2021-07-16 19:30:46 +00:00
|
|
|
self.listWidget.setSortingEnabled(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.toolBox.setItemText(self.toolBox.indexOf(self.page_2), _translate('MainWindow', 'Page 2'))
|
|
|
|
self.checkableButton.setText(_translate('MainWindow', 'Checkable button'))
|
|
|
|
self.pushButton.setText(_translate('MainWindow', 'PushButton'))
|
|
|
|
self.pushButton_5.setText(_translate('MainWindow', 'PushButton'))
|
|
|
|
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_3), _translate('MainWindow', 'Tab 1'))
|
2021-07-16 19:30:46 +00:00
|
|
|
self.tableWidget.setSortingEnabled(False)
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.tableWidget.verticalHeaderItem(0)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Row'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.tableWidget.verticalHeaderItem(1)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Row'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.tableWidget.verticalHeaderItem(2)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Row'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.tableWidget.verticalHeaderItem(3)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Row'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.tableWidget.horizontalHeaderItem(0)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Column'))
|
2016-10-26 18:44:37 +00:00
|
|
|
item = self.tableWidget.horizontalHeaderItem(1)
|
2021-07-14 03:46:41 +00:00
|
|
|
item.setText(_translate('MainWindow', 'New Column 2'))
|
2021-07-16 19:30:46 +00:00
|
|
|
self.tableWidget.setSortingEnabled(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_5), _translate('MainWindow', 'Page'))
|
|
|
|
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_4), _translate('MainWindow', 'Tab 2'))
|
2021-07-16 19:30:46 +00:00
|
|
|
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_5v2), _translate('MainWindow', 'Tab 3'))
|
|
|
|
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab_6v2), _translate('MainWindow', 'Tab 4'))
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate('MainWindow', 'Tab 1'))
|
|
|
|
self.groupBox_2.setTitle(_translate('MainWindow', 'GroupBox'))
|
|
|
|
self.label.setText(_translate('MainWindow', 'TextLabel'))
|
|
|
|
self.radioButton.setText(_translate('MainWindow', 'RadioB&utton'))
|
|
|
|
self.checkBox.setText(_translate('MainWindow', 'CheckBox'))
|
|
|
|
self.checkBox_2.setText(_translate('MainWindow', 'CheckBox Tristate'))
|
|
|
|
self.checkBox_3.setText(_translate('MainWindow', 'CheckBox Disabled'))
|
|
|
|
self.treeWidget.headerItem().setText(0, _translate('MainWindow', 'qdz'))
|
2016-10-26 18:44:37 +00:00
|
|
|
self.treeWidget.setSortingEnabled(False)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.treeWidget.topLevelItem(0).setText(0, _translate('MainWindow', 'qzd'))
|
|
|
|
self.treeWidget.topLevelItem(1).setText(0, _translate('MainWindow', 'effefe'))
|
2021-07-16 19:30:46 +00:00
|
|
|
self.treeWidget.setSortingEnabled(True)
|
2021-07-14 03:46:41 +00:00
|
|
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate('MainWindow', 'Tab 2'))
|
|
|
|
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3v2), _translate('MainWindow', 'Tab 3'))
|
|
|
|
self.groupBox_3v2.setTitle(_translate('MainWindow', 'GroupBox v2'))
|
|
|
|
self.pushButton_2.setText(_translate('MainWindow', 'PushButton'))
|
|
|
|
self.bt_delay_popup.setText(_translate('MainWindow', 'Delayed popup '))
|
|
|
|
self.bt_instant_popup.setText(_translate('MainWindow', 'Instant popup'))
|
|
|
|
self.bt_menu_button_popup.setText(_translate('MainWindow', 'MenuButtonPopup'))
|
|
|
|
self.pushButton_3.setText(_translate('MainWindow', 'Disabled'))
|
|
|
|
self.toolButton.setText(_translate('MainWindow', '...'))
|
|
|
|
self.menuMenu.setTitle(_translate('MainWindow', '&Menu'))
|
|
|
|
self.menuSubmenu_2.setTitle(_translate('MainWindow', '&Submenu 2'))
|
|
|
|
self.dockWidget1.setWindowTitle(_translate('MainWindow', '&Dock widget 1'))
|
|
|
|
self.comboBox.setItemText(0, _translate('MainWindow', 'Item 0'))
|
|
|
|
self.comboBox.setItemText(1, _translate('MainWindow', 'Item 2'))
|
|
|
|
self.toolBar.setWindowTitle(_translate('MainWindow', 'toolBar'))
|
|
|
|
self.dockWidget2.setWindowTitle(_translate('MainWindow', 'Dock widget &2'))
|
|
|
|
self.actionAction.setText(_translate('MainWindow', '&Action'))
|
|
|
|
self.actionSub_menu.setText(_translate('MainWindow', '&Action B'))
|
|
|
|
self.actionSub_menu.setToolTip(_translate('MainWindow', 'submenu'))
|
|
|
|
self.actionAction_C.setText(_translate('MainWindow', 'Action &C'))
|
|
|
|
|
2021-07-15 20:23:08 +00:00
|
|
|
def about(self):
|
2021-07-16 19:30:46 +00:00
|
|
|
QtWidgets.QMessageBox.aboutQt(self.centralwidget, 'About Menu')
|
2021-07-15 20:23:08 +00:00
|
|
|
|
2021-07-17 03:07:12 +00:00
|
|
|
def critical(self):
|
|
|
|
QtWidgets.QMessageBox.critical(self.centralwidget, 'Error', 'Critical Error')
|
|
|
|
|
2021-07-14 03:46:41 +00:00
|
|
|
|
|
|
|
def main(argv=None):
|
|
|
|
'Application entry point'
|
|
|
|
|
|
|
|
args, unknown = parser.parse_known_args(argv)
|
2021-07-15 20:23:08 +00:00
|
|
|
if args.scale != 1:
|
|
|
|
os.environ['QT_SCALE_FACTOR'] = str(args.scale)
|
|
|
|
else:
|
|
|
|
os.environ['QT_AUTO_SCREEN_SCALE_FACTOR'] = '1'
|
2021-07-15 01:22:33 +00:00
|
|
|
if args.style != 'native':
|
|
|
|
style = QtWidgets.QStyleFactory.create(args.style)
|
|
|
|
QtWidgets.QApplication.setStyle(style)
|
2021-07-14 03:46:41 +00:00
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
app = QtWidgets.QApplication(argv[:1] + unknown)
|
|
|
|
window = QtWidgets.QMainWindow()
|
|
|
|
|
2021-07-15 05:10:14 +00:00
|
|
|
# use the default font size
|
|
|
|
font = app.font()
|
|
|
|
if args.font_size > 0:
|
|
|
|
font.setPointSizeF(args.font_size)
|
|
|
|
if args.font_family:
|
|
|
|
font.setFamily(args.font_family)
|
|
|
|
app.setFont(font)
|
|
|
|
|
2021-07-14 03:46:41 +00:00
|
|
|
# setup ui
|
|
|
|
ui = Ui()
|
|
|
|
ui.setup(window)
|
|
|
|
ui.bt_delay_popup.addActions([
|
|
|
|
ui.actionAction,
|
|
|
|
ui.actionAction_C
|
|
|
|
])
|
|
|
|
ui.bt_instant_popup.addActions([
|
|
|
|
ui.actionAction,
|
|
|
|
ui.actionAction_C
|
|
|
|
])
|
|
|
|
ui.bt_menu_button_popup.addActions([
|
|
|
|
ui.actionAction,
|
|
|
|
ui.actionAction_C
|
|
|
|
])
|
|
|
|
window.setWindowTitle('Sample BreezeStyleSheets application.')
|
|
|
|
|
2021-07-15 20:23:08 +00:00
|
|
|
# Add event triggers
|
|
|
|
ui.actionAction.triggered.connect(ui.about)
|
2021-07-17 03:07:12 +00:00
|
|
|
ui.actionAction_C.triggered.connect(ui.critical)
|
2021-07-15 20:23:08 +00:00
|
|
|
|
2021-07-14 03:46:41 +00:00
|
|
|
# tabify dock widgets to show bug #6
|
|
|
|
window.tabifyDockWidget(ui.dockWidget1, ui.dockWidget2)
|
|
|
|
|
|
|
|
# setup stylesheet
|
|
|
|
if args.stylesheet != 'native':
|
2021-07-16 01:28:48 +00:00
|
|
|
file = QtCore.QFile(f':/{args.stylesheet}/stylesheet.qss')
|
2021-07-14 03:46:41 +00:00
|
|
|
file.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text)
|
|
|
|
stream = QtCore.QTextStream(file)
|
|
|
|
app.setStyleSheet(stream.readAll())
|
|
|
|
|
|
|
|
# run
|
|
|
|
window.show()
|
2021-07-15 21:44:59 +00:00
|
|
|
return app.exec_()
|
2021-07-14 03:46:41 +00:00
|
|
|
|
2016-10-26 18:44:37 +00:00
|
|
|
|
2021-07-14 03:46:41 +00:00
|
|
|
if __name__ == '__main__':
|
2021-07-15 21:44:59 +00:00
|
|
|
sys.exit(main(sys.argv))
|