Python PySide2.QtWidgets.QSplitter() Examples
The following are 29
code examples of PySide2.QtWidgets.QSplitter().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
PySide2.QtWidgets
, or try the search function
.
Example #1
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #2
Source File: universal_tool_template_0904.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #3
Source File: universal_tool_template_0904.py From universal_tool_template.py with MIT License | 5 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version="0.1" self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file." self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.location = "" if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.name = self.__class__.__name__ self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } self.qui_user_dict = {} #------------------------------
Example #4
Source File: universal_tool_template_0803.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #5
Source File: universal_tool_template_0803.py From universal_tool_template.py with MIT License | 5 votes |
def qui(self, ui_list_string, parentObject_string='', opt=''): # pre-defined user short name syntax type_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } # get ui_list, creation or existing ui object ui_list = [x.strip() for x in ui_list_string.split('|')] for i in range(len(ui_list)): if ui_list[i] in self.uiList: # - exisiting object ui_list[i] = self.uiList[ui_list[i]] else: # - string creation: # get part info partInfo = ui_list[i].split(';',1) uiName = partInfo[0].split('@')[0] uiType = uiName.rsplit('_',1)[-1] if uiType in type_dict: uiType = type_dict[uiType] # set quickUI string format ui_list[i] = partInfo[0]+';'+uiType if len(partInfo)==1: # give empty button and label a place holder name if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'): ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName elif len(partInfo)==2: ui_list[i]=ui_list[i]+";"+partInfo[1] # get parentObject or exisiting object parentObject = parentObject_string if parentObject in self.uiList: parentObject = self.uiList[parentObject] # process quickUI self.quickUI(ui_list, parentObject, opt)
Example #6
Source File: universal_tool_template_0903.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #7
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #8
Source File: universal_tool_template_1000.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #9
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #10
Source File: universal_tool_template_v8.1.py From universal_tool_template.py with MIT License | 5 votes |
def qui(self, ui_list_string, parentObject_string='', opt=''): # pre-defined user short name syntax type_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } # get ui_list, creation or existing ui object ui_list = [x.strip() for x in ui_list_string.split('|')] for i in range(len(ui_list)): if ui_list[i] in self.uiList: # - exisiting object ui_list[i] = self.uiList[ui_list[i]] else: # - string creation: # get part info partInfo = ui_list[i].split(';',1) uiName = partInfo[0].split('@')[0] uiType = uiName.rsplit('_',1)[-1] if uiType in type_dict: uiType = type_dict[uiType] # set quickUI string format ui_list[i] = partInfo[0]+';'+uiType if len(partInfo)==1: # give empty button and label a place holder name if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'): ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName elif len(partInfo)==2: ui_list[i]=ui_list[i]+";"+partInfo[1] # get parentObject or exisiting object parentObject = parentObject_string if parentObject in self.uiList: parentObject = self.uiList[parentObject] # process quickUI self.quickUI(ui_list, parentObject, opt)
Example #11
Source File: universal_tool_template_1112.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #12
Source File: universal_tool_template_v8.1.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #13
Source File: UITranslator.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #14
Source File: UITranslator.py From universal_tool_template.py with MIT License | 5 votes |
def qui(self, ui_list_string, parentObject_string='', opt=''): # pre-defined user short name syntax type_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', } # get ui_list, creation or existing ui object ui_list = [x.strip() for x in ui_list_string.split('|')] for i in range(len(ui_list)): if ui_list[i] in self.uiList: # - exisiting object ui_list[i] = self.uiList[ui_list[i]] else: # - string creation: # get part info partInfo = ui_list[i].split(';',1) uiName = partInfo[0].split('@')[0] uiType = uiName.rsplit('_',1)[-1] if uiType in type_dict: uiType = type_dict[uiType] # set quickUI string format ui_list[i] = partInfo[0]+';'+uiType if len(partInfo)==1: # give empty button and label a place holder name if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'): ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName elif len(partInfo)==2: ui_list[i]=ui_list[i]+";"+partInfo[1] # get parentObject or exisiting object parentObject = parentObject_string if parentObject in self.uiList: parentObject = self.uiList[parentObject] # process quickUI self.quickUI(ui_list, parentObject, opt)
Example #15
Source File: GearBox_template_1010.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #16
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #17
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #18
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 5 votes |
def quickSplitUI(self, name, part_list, type): split_type = QtCore.Qt.Horizontal if type == 'v': split_type = QtCore.Qt.Vertical self.uiList[name]=QtWidgets.QSplitter(split_type) for each_part in part_list: if isinstance(each_part, QtWidgets.QWidget): self.uiList[name].addWidget(each_part) else: tmp_holder = QtWidgets.QWidget() tmp_holder.setLayout(each_part) self.uiList[name].addWidget(tmp_holder) return self.uiList[name]
Example #19
Source File: main_window.py From angr-management with BSD 2-Clause "Simplified" License | 5 votes |
def _init_workspace(self): """ Initialize workspace :return: None """ self.central_widget_main = QSplitter(Qt.Horizontal) self.setCentralWidget(self.central_widget_main) self.central_widget = QMainWindow() self.central_widget2 = QMainWindow() self.central_widget_main.addWidget(self.central_widget) self.central_widget_main.addWidget(self.central_widget2) wk = Workspace(self, Instance()) self.workspace = wk self.workspace.view_manager.tabify_center_views() self.central_widget.setTabPosition(Qt.RightDockWidgetArea, QTabWidget.North) self.central_widget2.setTabPosition(Qt.LeftDockWidgetArea, QTabWidget.North) def set_caption(**kwargs): if self.workspace.instance.project == None: self.caption = '' else: self.caption = os.path.basename(self.workspace.instance.project.filename) self.workspace.instance.project_container.am_subscribe(set_caption) # # Shortcuts #
Example #20
Source File: gui.py From GridCal with GNU General Public License v3.0 | 4 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(841, 518) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/Icons/icons/sigma.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName("verticalLayout") self.splitter_3 = QtWidgets.QSplitter(self.centralwidget) self.splitter_3.setOrientation(QtCore.Qt.Horizontal) self.splitter_3.setObjectName("splitter_3") self.frame_8 = QtWidgets.QFrame(self.splitter_3) self.frame_8.setFrameShape(QtWidgets.QFrame.NoFrame) self.frame_8.setFrameShadow(QtWidgets.QFrame.Raised) self.frame_8.setObjectName("frame_8") self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.frame_8) self.verticalLayout_7.setContentsMargins(-1, 0, -1, -1) self.verticalLayout_7.setObjectName("verticalLayout_7") self.tableView = QtWidgets.QTableView(self.frame_8) self.tableView.setObjectName("tableView") self.verticalLayout_7.addWidget(self.tableView) self.PlotFrame = QtWidgets.QFrame(self.splitter_3) self.PlotFrame.setFrameShape(QtWidgets.QFrame.NoFrame) self.PlotFrame.setFrameShadow(QtWidgets.QFrame.Raised) self.PlotFrame.setObjectName("PlotFrame") self.horizontalLayout = QtWidgets.QHBoxLayout(self.PlotFrame) self.horizontalLayout.setObjectName("horizontalLayout") self.plotwidget = MatplotlibWidget(self.PlotFrame) self.plotwidget.setObjectName("plotwidget") self.horizontalLayout.addWidget(self.plotwidget) self.verticalLayout.addWidget(self.splitter_3) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 841, 22)) self.menubar.setObjectName("menubar") self.menuActions = QtWidgets.QMenu(self.menubar) self.menuActions.setObjectName("menuActions") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionCopy_to_clipboard = QtWidgets.QAction(MainWindow) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/Icons/icons/copy.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionCopy_to_clipboard.setIcon(icon1) self.actionCopy_to_clipboard.setObjectName("actionCopy_to_clipboard") self.actionSave = QtWidgets.QAction(MainWindow) icon2 = QtGui.QIcon() icon2.addPixmap(QtGui.QPixmap(":/Icons/icons/import_profiles.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionSave.setIcon(icon2) self.actionSave.setObjectName("actionSave") self.menuActions.addAction(self.actionCopy_to_clipboard) self.menuActions.addAction(self.actionSave) self.menubar.addAction(self.menuActions.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #21
Source File: universal_tool_template_1010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): super_class.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = "0.1" self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.location = "" if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.name = self.__class__.__name__ self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {} #------------------------------
Example #22
Source File: ui_mainwindow.py From Il2cppSpy with MIT License | 4 votes |
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 600) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget) self.verticalLayout.setSpacing(0) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.splitter = QtWidgets.QSplitter(self.centralwidget) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setHandleWidth(2) self.splitter.setObjectName("splitter") self.treeWidget = QtWidgets.QTreeWidget(self.splitter) self.treeWidget.setObjectName("treeWidget") self.treeWidget.headerItem().setText(0, "1") self.treeWidget.header().setVisible(False) self.tabWidget = QtWidgets.QTabWidget(self.splitter) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth()) self.tabWidget.setSizePolicy(sizePolicy) self.tabWidget.setDocumentMode(True) self.tabWidget.setTabsClosable(True) self.tabWidget.setMovable(True) self.tabWidget.setObjectName("tabWidget") self.verticalLayout.addWidget(self.splitter) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar() self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 22)) self.menubar.setObjectName("menubar") self.menuFile = QtWidgets.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.toolBar = QtWidgets.QToolBar(MainWindow) self.toolBar.setIconSize(QtCore.QSize(18, 18)) self.toolBar.setObjectName("toolBar") MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) self.actionOpenFile = QtWidgets.QAction(MainWindow) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/folder.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionOpenFile.setIcon(icon) self.actionOpenFile.setObjectName("actionOpenFile") self.actionCompareFiles = QtWidgets.QAction(MainWindow) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/file.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.actionCompareFiles.setIcon(icon1) self.actionCompareFiles.setObjectName("actionCompareFiles") self.menuFile.addAction(self.actionOpenFile) self.menuFile.addAction(self.actionCompareFiles) self.menubar.addAction(self.menuFile.menuAction()) self.toolBar.addAction(self.actionOpenFile) self.toolBar.addAction(self.actionCompareFiles) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
Example #23
Source File: universal_tool_template_1110.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #24
Source File: universal_tool_template_1100.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #25
Source File: universal_tool_template_1115.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #26
Source File: universal_tool_template_2010.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None): QtWidgets.QMainWindow.__init__(self, parent) # class property self.tpl_ver = tpl_ver self.tpl_date = tpl_date self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' # class info self.name = self.__class__.__name__ self.fileType='.{0}_EXT'.format(self.name) # class path and icon self.location = '' if getattr(sys, 'frozen', False): self.location = sys.executable # frozen case - cx_freeze else: self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) # class data self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.memoData['last_browse'] = '' # core function variable self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'spin':'QSpinBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #27
Source File: universal_tool_template_1020.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #28
Source File: universal_tool_template_1116.py From universal_tool_template.py with MIT License | 4 votes |
def __init__(self, parent=None, mode=0): QtWidgets.QMainWindow.__init__(self, parent) #------------------------------ # class variables #------------------------------ self.version = '0.1' self.date = '2017.01.01' self.log = 'no version log in user class' self.help = 'no help guide in user class' self.hotkey = {} self.uiList={} # for ui obj storage self.memoData = {} # key based variable data storage self.memoData['font_size_default'] = QtGui.QFont().pointSize() self.memoData['font_size'] = self.memoData['font_size_default'] self.memoData['last_export'] = '' self.memoData['last_import'] = '' self.name = self.__class__.__name__ self.location = '' if getattr(sys, 'frozen', False): # frozen - cx_freeze self.location = sys.executable else: # unfrozen self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__) self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png') self.iconPix = QtGui.QPixmap(self.iconPath) self.icon = QtGui.QIcon(self.iconPath) self.fileType='.{0}_EXT'.format(self.name) #------------------------------ # core function variable #------------------------------ self.qui_core_dict = { 'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout', 'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget', 'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox', 'txt': 'QTextEdit', 'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget', 'space': 'QSpacerItem', 'menu' : 'QMenu', 'menubar' : 'QMenuBar', } self.qui_user_dict = {}
Example #29
Source File: PyAero.py From PyAero with MIT License | 4 votes |
def __init__(self, parent=None): # call constructor of QWidget super().__init__(parent) self.parent = parent # split main window horizontally into two panes self.splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) # create QToolBox widget self.toolbox = ToolBox.Toolbox(self.parent) # create box where viewing options are placed self.viewingOptions() verticalSpacer = QtWidgets.QSpacerItem(50, 15, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) horizontal_line = QtWidgets.QFrame() horizontal_line.setFrameShape(QtWidgets.QFrame.HLine) horizontal_line.setFrameShadow(QtWidgets.QFrame.Sunken) self.left_pane = QtWidgets.QWidget() vbox = QtWidgets.QVBoxLayout(self) vbox.addWidget(self.toolbox) vbox.addItem(verticalSpacer) vbox.addWidget(horizontal_line) vbox.addItem(verticalSpacer) vbox.addWidget(self.viewing_options) self.left_pane.setLayout(vbox) # create tabbed windows for viewing self.tabs = QtWidgets.QTabWidget() self.tabs.addTab(self.parent.view, 'Airfoil Viewer') self.tabs.addTab(self.parent.contourview, 'Contour Analysis') # connect tab changed signal to slot self.tabs.currentChanged.connect(self.parent.slots.onTabChanged) # add splitter panes self.splitter.addWidget(self.left_pane) self.splitter.addWidget(self.tabs) self.splitter.setSizes([100, 1300]) # initial hint for splitter spacing # put splitter in a layout box hbox = QtWidgets.QHBoxLayout(self) hbox.addWidget(self.splitter) self.setLayout(hbox)