Python PyQt5.QtWidgets 模块,QSplitter() 实例源码

我们从Python开源项目中,提取了以下40个代码示例,用于说明如何使用PyQt5.QtWidgets.QSplitter()

项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def splitter_setting(self):
        """
        set splitter
        :return:
        """
        if self.splitter:
            self.splitter = None
        self.splitter = QSplitter(Qt.Vertical)
        self.splitter.setHandleWidth(1)
        # add "case_widget" and "log_area" to splitter
        self.splitter.addWidget(self.case_widget)
        self.splitter.addWidget(self.log_area)

        # set the initial scale: 4:1
        self.splitter.setStretchFactor(0, 4)
        self.splitter.setStretchFactor(1, 1)
        self.case_table_layout.addWidget(self.splitter)
项目:idasec    作者:RobinDavid    | 项目源码 | 文件源码
def setupUi(self, Master):
        Master.setObjectName("Master")
        Master.resize(718, 477)
        self.verticalLayout = QtWidgets.QVBoxLayout(Master)
        self.verticalLayout.setObjectName("verticalLayout")
        self.splitter = QtWidgets.QSplitter(Master)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName("splitter")
        self.tab_widget = QtWidgets.QTabWidget(self.splitter)
        self.tab_widget.setObjectName("tab_widget")

        self.docker = QtWidgets.QDockWidget(self.splitter)
        self.docker.setObjectName("docker")
        self.docker.setAllowedAreas(QtCore.Qt.BottomDockWidgetArea)

        self.log_widget = QtWidgets.QTreeWidget(self.docker)
        self.log_widget.setHeaderItem(QtWidgets.QTreeWidgetItem(["date", "origin", "type", "message"]))
        self.docker.setWidget(self.log_widget)

        self.verticalLayout.addWidget(self.splitter)
        self.tab_widget.setCurrentIndex(-1)
        QtCore.QMetaObject.connectSlotsByName(Master)
        Master.setWindowTitle("IDASec")
项目:calibre-cloud-plugin    作者:COMU    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 239)
        Dialog.setMinimumSize(QtCore.QSize(400, 239))
        Dialog.setMaximumSize(QtCore.QSize(400, 239))
        self.manuel_button = QtWidgets.QPushButton(Dialog)
        self.manuel_button.setGeometry(QtCore.QRect(230, 190, 85, 30))
        self.manuel_button.setObjectName("manuel_button")
        self.splitter = QtWidgets.QSplitter(Dialog)
        self.splitter.setGeometry(QtCore.QRect(20, 20, 361, 161))
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName("splitter")
        self.label_2 = QtWidgets.QLabel(self.splitter)
        self.label_2.setObjectName("label_2")
        self.label = QtWidgets.QLabel(self.splitter)
        self.label.setObjectName("label")

        self.retranslateUi(Dialog)
        self.manuel_button.clicked.connect(Dialog.close)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:activity-browser    作者:LCA-ActivityBrowser    | 项目源码 | 文件源码
def __init__(self, parent):
        super(InventoryTab, self).__init__(parent)
        # main widgets
        self.projects_widget = ProjectsWidget()
        self.databases_widget = DatabaseWidget(self)
        self.activities_widget = ActivitiesWidget(self)
        self.flows_widget = BiosphereFlowsWidget(self)

        # Layout
        self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)
        # self.splitter.addWidget(self.projects_widget)
        self.splitter.addWidget(self.databases_widget)
        self.splitter.addWidget(self.activities_widget)
        self.splitter.addWidget(self.flows_widget)

        self.overall_layout = QtWidgets.QVBoxLayout()
        self.overall_layout.setAlignment(QtCore.Qt.AlignTop)
        self.overall_layout.addWidget(self.projects_widget)

        # self.overall_layout.addWidget(self.databases_widget)
        # self.overall_layout.addWidget(self.activities_widget)
        # self.overall_layout.addWidget(self.flows_widget)
        self.overall_layout.addWidget(self.splitter)
        self.overall_layout.addStretch()
        self.setLayout(self.overall_layout)

        self.activities_widget.hide()
        self.flows_widget.hide()

        self.connect_signals()
项目:activity-browser    作者:LCA-ActivityBrowser    | 项目源码 | 文件源码
def get_details_widget(self):
        self.production = ExchangeTable(self, production=True)
        self.inputs = ExchangeTable(self)
        self.flows = ExchangeTable(self, biosphere=True)
        self.upstream = ExchangeTable(self)

        layout = QtWidgets.QVBoxLayout()
        self.metadata = ActivityDataGrid()
        layout.addWidget(self.metadata)

        # splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)

        tables = [
            (self.production, "Products:"),
            (self.inputs, "Technosphere Inputs:"),
            (self.flows, "Biosphere flows:"),
            (self.upstream, "Downstream consumers:"),
        ]

        for table, label in tables:
            layout.addWidget(DetailsGroupBox(label, table))

        # layout.addWidget(splitter)
        layout.addStretch()
        widget = QtWidgets.QWidget(self)
        widget.setLayout(layout)

        return widget
项目:PINCE    作者:korcankaraokcu    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(704, 545)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.splitter = QtWidgets.QSplitter(self.centralwidget)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.treeWidget_InstructionInfo = QtWidgets.QTreeWidget(self.splitter)
        self.treeWidget_InstructionInfo.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.treeWidget_InstructionInfo.setObjectName("treeWidget_InstructionInfo")
        self.treeWidget_InstructionInfo.headerItem().setText(0, "1")
        self.treeWidget_InstructionInfo.header().setVisible(False)
        self.textBrowser_RegisterInfo = QtWidgets.QTextBrowser(self.splitter)
        self.textBrowser_RegisterInfo.setObjectName("textBrowser_RegisterInfo")
        self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 704, 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.actionOpen = QtWidgets.QAction(MainWindow)
        self.actionOpen.setObjectName("actionOpen")
        self.actionSave = QtWidgets.QAction(MainWindow)
        self.actionSave.setObjectName("actionSave")
        self.actionSave_as_a_text_file = QtWidgets.QAction(MainWindow)
        self.actionSave_as_a_text_file.setObjectName("actionSave_as_a_text_file")
        self.menuFile.addAction(self.actionOpen)
        self.menuFile.addAction(self.actionSave)
        self.menubar.addAction(self.menuFile.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:PINCE    作者:korcankaraokcu    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(768, 440)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.widget = QtWidgets.QWidget(self.splitter)
        self.widget.setObjectName("widget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(self.widget)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.listWidget_ReturnAddresses = QtWidgets.QListWidget(self.widget)
        self.listWidget_ReturnAddresses.setObjectName("listWidget_ReturnAddresses")
        self.verticalLayout.addWidget(self.listWidget_ReturnAddresses)
        self.widget1 = QtWidgets.QWidget(self.splitter)
        self.widget1.setObjectName("widget1")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.widget1)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label_2 = QtWidgets.QLabel(self.widget1)
        self.label_2.setObjectName("label_2")
        self.verticalLayout_2.addWidget(self.label_2)
        self.textBrowser_Info = QtWidgets.QTextBrowser(self.widget1)
        self.textBrowser_Info.setObjectName("textBrowser_Info")
        self.verticalLayout_2.addWidget(self.textBrowser_Info)
        self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:PINCE    作者:korcankaraokcu    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(1025, 530)
        Form.setToolTip("")
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.layoutWidget = QtWidgets.QWidget(self.splitter)
        self.layoutWidget.setObjectName("layoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.lineEdit_Regex = QtWidgets.QLineEdit(self.layoutWidget)
        self.lineEdit_Regex.setObjectName("lineEdit_Regex")
        self.horizontalLayout_2.addWidget(self.lineEdit_Regex)
        self.checkBox_IgnoreCase = QtWidgets.QCheckBox(self.layoutWidget)
        self.checkBox_IgnoreCase.setChecked(True)
        self.checkBox_IgnoreCase.setObjectName("checkBox_IgnoreCase")
        self.horizontalLayout_2.addWidget(self.checkBox_IgnoreCase)
        self.checkBox_Regex = QtWidgets.QCheckBox(self.layoutWidget)
        self.checkBox_Regex.setObjectName("checkBox_Regex")
        self.horizontalLayout_2.addWidget(self.checkBox_Regex)
        self.pushButton_Search = QtWidgets.QPushButton(self.layoutWidget)
        self.pushButton_Search.setObjectName("pushButton_Search")
        self.horizontalLayout_2.addWidget(self.pushButton_Search)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.listWidget_Referrers = QtWidgets.QListWidget(self.layoutWidget)
        self.listWidget_Referrers.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.listWidget_Referrers.setObjectName("listWidget_Referrers")
        self.verticalLayout.addWidget(self.listWidget_Referrers)
        self.textBrowser_DisasInfo = QtWidgets.QTextBrowser(self.splitter)
        self.textBrowser_DisasInfo.setLineWrapMode(QtWidgets.QTextEdit.NoWrap)
        self.textBrowser_DisasInfo.setObjectName("textBrowser_DisasInfo")
        self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:Mac-Python-3.X    作者:L1nwatch    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(911, 688)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.editorBox = QtWidgets.QGroupBox(self.splitter)
        self.editorBox.setObjectName("editorBox")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.editorBox)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.plainTextEdit = QtWidgets.QPlainTextEdit(self.editorBox)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout_2.addWidget(self.plainTextEdit)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.clearButton = QtWidgets.QPushButton(self.editorBox)
        self.clearButton.setObjectName("clearButton")
        self.horizontalLayout.addWidget(self.clearButton)
        self.previewButton = QtWidgets.QPushButton(self.editorBox)
        self.previewButton.setObjectName("previewButton")
        self.horizontalLayout.addWidget(self.previewButton)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        self.previewerBox = QtWidgets.QGroupBox(self.splitter)
        self.previewerBox.setObjectName("previewerBox")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.previewerBox)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.webView = QtWebKitWidgets.QWebView(self.previewerBox)
        self.webView.setUrl(QtCore.QUrl("about:blank"))
        self.webView.setObjectName("webView")
        self.horizontalLayout_3.addWidget(self.webView)
        self.horizontalLayout_4.addWidget(self.splitter)

        self.retranslateUi(Form)
        self.clearButton.clicked.connect(self.plainTextEdit.clear)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:examples    作者:pyqt    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(911, 688)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.editorBox = QtWidgets.QGroupBox(self.splitter)
        self.editorBox.setObjectName("editorBox")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.editorBox)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.plainTextEdit = QtWidgets.QPlainTextEdit(self.editorBox)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout_2.addWidget(self.plainTextEdit)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.clearButton = QtWidgets.QPushButton(self.editorBox)
        self.clearButton.setObjectName("clearButton")
        self.horizontalLayout.addWidget(self.clearButton)
        self.previewButton = QtWidgets.QPushButton(self.editorBox)
        self.previewButton.setObjectName("previewButton")
        self.horizontalLayout.addWidget(self.previewButton)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        self.previewerBox = QtWidgets.QGroupBox(self.splitter)
        self.previewerBox.setObjectName("previewerBox")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.previewerBox)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.webView = QtWebKitWidgets.QWebView(self.previewerBox)
        self.webView.setUrl(QtCore.QUrl("about:blank"))
        self.webView.setObjectName("webView")
        self.horizontalLayout_3.addWidget(self.webView)
        self.horizontalLayout_4.addWidget(self.splitter)

        self.retranslateUi(Form)
        self.clearButton.clicked.connect(self.plainTextEdit.clear)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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]
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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]
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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]
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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]
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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]
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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]
项目:binja-ui-api    作者:nbsdx    | 项目源码 | 文件源码
def FunctionWindow():
    app = _app()

    views = [x for x in app.allWidgets() if x.__class__ is QtWidgets.QListView]

    for view in views:
        if view.parent().__class__ is QtWidgets.QWidget:
            if view.parent().parent().__class__ is QtWidgets.QSplitter:
                return view.parent()

    return None
项目:FIRST-plugin-ida    作者:vrtadmin    | 项目源码 | 文件源码
def populate_main_form(self):
        list_view = QtWidgets.QListView()
        list_view.setFixedWidth(115)
        list_view.setModel(self.views_model)

        select = QtCore.QItemSelectionModel.Select
        list_view.selectionModel().select(self.views_model.createIndex(0, 0), select)
        list_view.clicked.connect(self.view_clicked)

        current_view = QtWidgets.QWidget()
        view = self.view_about()
        if not view:
            view = QtWidgets.QBoxLayout()
        current_view.setLayout(view)

        self.splitter = QtWidgets.QSplitter(Qt.Horizontal)
        self.splitter.addWidget(list_view)

        self.splitter.addWidget(current_view)
        self.splitter.setChildrenCollapsible(False)
        self.splitter.show()

        outer_layout = QtWidgets.QHBoxLayout()
        outer_layout.addWidget(self.splitter)

        self.parent.setLayout(outer_layout)
项目:pyqt5-example    作者:guinslym    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(911, 688)
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(Form)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.editorBox = QtWidgets.QGroupBox(self.splitter)
        self.editorBox.setObjectName("editorBox")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.editorBox)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.plainTextEdit = QtWidgets.QPlainTextEdit(self.editorBox)
        self.plainTextEdit.setObjectName("plainTextEdit")
        self.verticalLayout_2.addWidget(self.plainTextEdit)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.clearButton = QtWidgets.QPushButton(self.editorBox)
        self.clearButton.setObjectName("clearButton")
        self.horizontalLayout.addWidget(self.clearButton)
        self.previewButton = QtWidgets.QPushButton(self.editorBox)
        self.previewButton.setObjectName("previewButton")
        self.horizontalLayout.addWidget(self.previewButton)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        self.previewerBox = QtWidgets.QGroupBox(self.splitter)
        self.previewerBox.setObjectName("previewerBox")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.previewerBox)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.webView = QtWebKitWidgets.QWebView(self.previewerBox)
        self.webView.setUrl(QtCore.QUrl("about:blank"))
        self.webView.setObjectName("webView")
        self.horizontalLayout_3.addWidget(self.webView)
        self.horizontalLayout_4.addWidget(self.splitter)

        self.retranslateUi(Form)
        self.clearButton.clicked.connect(self.plainTextEdit.clear)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:qturtle    作者:Transpyler    | 项目源码 | 文件源码
def __init__(self,
                 transpyler,
                 parent=None,
                 text='', header_text=None, **kwds):
        super().__init__(parent=parent)
        assert transpyler

        # Configure scene
        self._scene = TurtleScene()
        self._view = TurtleView(self._scene)

        # Configure editor
        self._transpyler = transpyler
        self._repl_editor = ReplEditor(header_text=header_text,
                                       transpyler=transpyler)
        self._repl_editor.setText(text)
        self._repl_editor.initNamespace()
        self._repl_editor.sizePolicy().setHorizontalPolicy(7)

        # Configure layout
        self._splitter = QtWidgets.QSplitter()
        self._splitter.addWidget(self._view)
        self._splitter.addWidget(self._repl_editor)
        self._layout = QtWidgets.QHBoxLayout(self)
        self._layout.setContentsMargins(0, 0, 0, 0)
        self._layout.addWidget(self._splitter)
        self._splitter.setSizes([200, 120])

        # Connect signals
        self._repl_editor.turtleMessageSignal.connect(self._scene.handleMessage)
        self._scene.messageReplySignal.connect(
            self._repl_editor.handleMessageReply)
项目:RRPam-WDS    作者:asselapathirana    | 项目源码 | 文件源码
def arrange_properties_panel(self):
        self.qs = QSplitter(self)
        self.frame = QFrame(parent=self)
        layout = QVBoxLayout()
        layout.addWidget(self.projectgui.projectproperties)
        layout.insertStretch(1)
        self.frame.setLayout(layout)
        self.qs.addWidget(self.frame)
        for x in self.projectgui.projectproperties.findChildren(QSlider):
            x.setMinimumWidth(100)

        self.qs.addWidget(self.mdi)
        self.setCentralWidget(self.qs)
项目:pytc-gui    作者:harmslab    | 项目源码 | 文件源码
def layout(self):
        """
        Create the widget layout.
        """

        # ------------ Plot widget ----------------------- 
        self._plot_box = PlotBox(self,self._fit)

        # ------------ Message box -----------------------
        self._message_box = MessageBox(self,self._fit)

        # ------------ Experiments widget ----------------
        self._exp_box = ExperimentBox(self,self._fit)

        # ------------ Parameters widget -----------------
        self._param_box = ParameterBox(self,self._fit)

        self._core_widgets = [self._plot_box,
                              self._message_box,
                              self._exp_box,
                              self._param_box]

        # ------------ "Do fit" button -------------------
        self._do_fit_button = QW.QPushButton("Do fit", self)
        self._do_fit_button.clicked.connect(self.do_fit_callback)

        # Split up the main window in a useful way

        # Left column
        left_column = QW.QSplitter(QC.Qt.Vertical)
        left_column.addWidget(self._plot_box)
        left_column.addWidget(self._exp_box)
        left_column.setSizes([200, 50])

        # right column
        right_column = QW.QSplitter(QC.Qt.Vertical)
        right_column.addWidget(self._message_box)
        right_column.addWidget(self._param_box)
        right_column.setSizes([200, 200])

        # Right and left columns next to each other
        h_splitter = QW.QSplitter(QC.Qt.Horizontal)
        h_splitter.addWidget(left_column)
        h_splitter.addWidget(right_column)
        h_splitter.setSizes([200, 200])

        # Now add the split up window.
        main_layout = QW.QVBoxLayout(self)
        main_layout.addWidget(h_splitter)
        main_layout.addWidget(self._do_fit_button)
项目:scm-workbench    作者:barry-scott    | 项目源码 | 文件源码
def __init__( self, app, parent, title, file_left, header_left, file_right, header_right, ):
        super().__init__( app, app.debug_options.debugLogDiff, parent=parent )
        wb_tracked_qwidget.WbTrackedModeless.__init__( self )

        prefs = self.app.prefs.diff_window
        geometry = prefs.geometry

        self.setWindowTitle( title )
        icon = app.getAppQIcon()
        if icon is not None:
            self.setWindowIcon( icon )

        if geometry is not None:
            geometry = QtCore.QByteArray( geometry.encode('utf-8') )
            self.restoreGeometry( QtCore.QByteArray.fromHex( geometry ) )

        else:
            em = self.app.fontMetrics().width( 'm' )
            ex = self.app.fontMetrics().lineSpacing()
            self.resize( 130*em, 45*ex )

        self.setupToolBar()
        self.setupStatusBar( self.statusBar() )

        self.splitter = QtWidgets.QSplitter()
        self.splitter.setOrientation( QtCore.Qt.Horizontal )
        self.sash_ratio = 0.5

        self.panel_left = DiffWidget( app, self.splitter, header_left, name='left' )
        self.panel_right = DiffWidget( app, self.splitter, header_right, name='right' )

        self.panel_left.ed.setMirrorEditor( self.panel_right.ed )
        self.panel_right.ed.setMirrorEditor( self.panel_left.ed )

        self.panel_left.ed.setProcessKeyHandler( self.processKeyHandler )
        self.panel_right.ed.setProcessKeyHandler( self.processKeyHandler )

        self.splitter.addWidget( self.panel_left )
        self.splitter.addWidget( self.panel_right )

        # Create the editor and calculate all the differences
        self.processor = wb_diff_processor.DiffProcessor( self.panel_left.ed, self.panel_right.ed )
        self.diff = wb_diff_difflib.Difference( self.processor )

        self.files_ok = self.diff.filecompare( file_left, file_right )
        if not self.files_ok:
            return

        self.setChangeCounts( 0, self.processor.getChangeCount() )

        self.setCentralWidget( self.splitter )

        # start with folds collapsed
        self.actionFoldsCollapse()
        # show first diff
        self.actionDiffNext()
项目:vivisect-py3    作者:bat-serjo    | 项目源码 | 文件源码
def __init__(self, trace=None, parent=None):
        super(RegistersView, self).__init__(parent=parent)
        self.setWindowTitle('Registers')

        vbox = QtWidgets.QVBoxLayout(self)
        vbox.setContentsMargins(2, 2, 2, 2)
        vbox.setSpacing(4)

        self.viewnames = QtWidgets.QComboBox(self)
        self.regviews = {}
        self.flagviews = {}

        reg_groups = trace.archGetRegisterGroups()
        for name, group in reg_groups:
            self.regviews[name] = group
            self.viewnames.addItem(name)

        self.reglist = RegistersListView(trace=trace, parent=self)
        self.regdelegate = RegColorDelegate(self.reglist)
        self.reglist.setItemDelegate(self.regdelegate)
        # TODO: we should switch theme overall to monospace font
        # font = Qt.QFont('Courier New', 10)
        # self.reglist.setFont(font)

        vbox.addWidget(self.viewnames)

        # show general in dropdown by default if exists, otherwise all
        # (preferences will re-set)
        if 'general' in self.regviews:
            self.regViewNameSelected('general')
            idx = self.viewnames.findText('general')
            self.viewnames.setCurrentIndex(idx)
        else:
            self.regViewNameSelected('all')
            idx = self.viewnames.findText('all')
            self.viewnames.setCurrentIndex(idx)

        statusreg_widget = VQFlagsGridView(trace=trace, parent=self)
        statusreg_widget.setMaximumHeight(60)
        statusreg_widget.hide()

        splitview = QtWidgets.QSplitter(QtCore.Qt.Vertical)
        splitview.addWidget(self.reglist)
        splitview.addWidget(statusreg_widget)
        vbox.addWidget(splitview)

        self.viewnames.currentIndexChanged.connect(self.regViewNameSelected)

        self.setLayout(vbox)
项目:PINCE    作者:korcankaraokcu    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(1025, 530)
        Form.setToolTip("")
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.splitter = QtWidgets.QSplitter(Form)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.layoutWidget = QtWidgets.QWidget(self.splitter)
        self.layoutWidget.setObjectName("layoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.lineEdit_Regex = QtWidgets.QLineEdit(self.layoutWidget)
        self.lineEdit_Regex.setObjectName("lineEdit_Regex")
        self.horizontalLayout_2.addWidget(self.lineEdit_Regex)
        self.checkBox_IgnoreCase = QtWidgets.QCheckBox(self.layoutWidget)
        self.checkBox_IgnoreCase.setChecked(True)
        self.checkBox_IgnoreCase.setObjectName("checkBox_IgnoreCase")
        self.horizontalLayout_2.addWidget(self.checkBox_IgnoreCase)
        self.checkBox_Regex = QtWidgets.QCheckBox(self.layoutWidget)
        self.checkBox_Regex.setObjectName("checkBox_Regex")
        self.horizontalLayout_2.addWidget(self.checkBox_Regex)
        self.pushButton_Search = QtWidgets.QPushButton(self.layoutWidget)
        self.pushButton_Search.setObjectName("pushButton_Search")
        self.horizontalLayout_2.addWidget(self.pushButton_Search)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.tableWidget_References = QtWidgets.QTableWidget(self.layoutWidget)
        self.tableWidget_References.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.tableWidget_References.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
        self.tableWidget_References.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.tableWidget_References.setObjectName("tableWidget_References")
        self.tableWidget_References.setColumnCount(2)
        self.tableWidget_References.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_References.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_References.setHorizontalHeaderItem(1, item)
        self.tableWidget_References.horizontalHeader().setStretchLastSection(True)
        self.tableWidget_References.verticalHeader().setVisible(False)
        self.tableWidget_References.verticalHeader().setDefaultSectionSize(16)
        self.tableWidget_References.verticalHeader().setMinimumSectionSize(16)
        self.verticalLayout.addWidget(self.tableWidget_References)
        self.listWidget_Referrers = QtWidgets.QListWidget(self.splitter)
        self.listWidget_Referrers.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.listWidget_Referrers.setObjectName("listWidget_Referrers")
        self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:PINCE    作者:korcankaraokcu    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(530, 493)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.splitter_2 = QtWidgets.QSplitter(Form)
        self.splitter_2.setOrientation(QtCore.Qt.Vertical)
        self.splitter_2.setObjectName("splitter_2")
        self.splitter = QtWidgets.QSplitter(self.splitter_2)
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.layoutWidget = QtWidgets.QWidget(self.splitter)
        self.layoutWidget.setObjectName("layoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tableWidget_Opcodes = QtWidgets.QTableWidget(self.layoutWidget)
        self.tableWidget_Opcodes.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.tableWidget_Opcodes.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
        self.tableWidget_Opcodes.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.tableWidget_Opcodes.setObjectName("tableWidget_Opcodes")
        self.tableWidget_Opcodes.setColumnCount(2)
        self.tableWidget_Opcodes.setRowCount(0)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_Opcodes.setHorizontalHeaderItem(0, item)
        item = QtWidgets.QTableWidgetItem()
        self.tableWidget_Opcodes.setHorizontalHeaderItem(1, item)
        self.tableWidget_Opcodes.horizontalHeader().setStretchLastSection(True)
        self.tableWidget_Opcodes.verticalHeader().setVisible(False)
        self.tableWidget_Opcodes.verticalHeader().setDefaultSectionSize(16)
        self.tableWidget_Opcodes.verticalHeader().setMinimumSectionSize(16)
        self.verticalLayout.addWidget(self.tableWidget_Opcodes)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pushButton_Refresh = QtWidgets.QPushButton(self.layoutWidget)
        self.pushButton_Refresh.setObjectName("pushButton_Refresh")
        self.horizontalLayout.addWidget(self.pushButton_Refresh)
        self.pushButton_Stop = QtWidgets.QPushButton(self.layoutWidget)
        self.pushButton_Stop.setObjectName("pushButton_Stop")
        self.horizontalLayout.addWidget(self.pushButton_Stop)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.textBrowser_Info = QtWidgets.QTextBrowser(self.splitter)
        self.textBrowser_Info.setObjectName("textBrowser_Info")
        self.textBrowser_Disassemble = QtWidgets.QTextBrowser(self.splitter_2)
        self.textBrowser_Disassemble.setObjectName("textBrowser_Disassemble")
        self.gridLayout.addWidget(self.splitter_2, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:ida-settings    作者:williballenthin    | 项目源码 | 文件源码
def PopulateForm(self):
        """
        +-----------------------------------------------------------------------+
        | +--- splitter ------------------------------------------------------+ |
        | | +-- list widget--------------+  +- IdaSettingsView -------------+ | |
        | | |                            |  |                               | | |
        | | |  - plugin name             |  |                               | | |
        | | |  - plugin name             |  |                               | | |
        | | |  - plugin name             |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | |                            |  |                               | | |
        | | +----------------------------+  +-------------------------------+ | |
        | +-------------------------------------------------------------------+ |
        +-----------------------------------------------------------------------+
        """
        hbox = QtWidgets.QHBoxLayout(self.parent)

        self._splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal)
        self._plugin_list = QtWidgets.QListWidget()

        plugin_names = set([])
        for scope, fn in (("idb", ida_settings.IDASettings.get_idb_plugin_names),
                ("directory", ida_settings.IDASettings.get_directory_plugin_names),
                ("user", ida_settings.IDASettings.get_user_plugin_names),
                ("system", ida_settings.IDASettings.get_system_plugin_names)):
            for plugin_name in fn():
                plugin_names.add(plugin_name)
        for plugin_name in plugin_names:
            self._plugin_list.addItem(plugin_name)
        self._splitter.addWidget(self._plugin_list)

        hbox.addWidget(self._splitter)
        self.parent.setLayout(hbox)

        self._plugin_list.currentItemChanged.connect(self._handle_plugin_changed)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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 = {}
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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 = {}
        #------------------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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 = {}
        #------------------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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.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 = {}
        #------------------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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 = {}
        #------------------------------
项目:gtrans-web-gui    作者:takiyu    | 项目源码 | 文件源码
def _init_gui(self):
        # Create a target text box
        self.tgt_box = QtWidgets.QTextEdit(self)
        self.tgt_box.setReadOnly(True)
        self.tgt_box.setAcceptRichText(True)
        # Create a source text box
        self.src_box = QtWidgets.QTextEdit(self)
        self.src_box.setAcceptRichText(True)
        # Create bottom items
        self.src_lang_box = QtWidgets.QLineEdit(self)
        self.tgt_lang_box = QtWidgets.QLineEdit(self)
        self.src_lang_box.setFixedWidth(50)
        self.tgt_lang_box.setFixedWidth(50)
        # show candidate list when clicked
        self.src_lang_box.focusInEvent = lambda _: self._show_candidates(1)
        self.tgt_lang_box.focusInEvent = lambda _: self._show_candidates(2)
        self.swap_btn = QtWidgets.QPushButton("<-->", self)
        self.swap_btn.setFixedWidth(50)
        self.swap_btn.clicked.connect(self._swap_langs)
        self.trans_btn = QtWidgets.QPushButton("Translate", self)
        self.trans_btn.clicked.connect(lambda: self.translate())

        # Create a splitter for text box
        self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)
        self.splitter.addWidget(self.tgt_box)
        self.splitter.addWidget(self.src_box)
        self.splitter.setCollapsible(0, False)
        self.splitter.setCollapsible(1, False)

        # Create horizontal bottom layout
        self.bottom_layout = QtWidgets.QHBoxLayout()
        self.bottom_layout.addWidget(self.src_lang_box)
        self.bottom_layout.addWidget(self.swap_btn)
        self.bottom_layout.addWidget(self.tgt_lang_box)
        self.bottom_layout.addWidget(self.trans_btn)
        # Warp with a widget
        self.bottom_widget = QtWidgets.QWidget()
        self.bottom_widget.setLayout(self.bottom_layout)
        self.bottom_widget.setContentsMargins(-5, -5, -5, -5)

        # Create vertical central layout
        self.central_layout = QtWidgets.QVBoxLayout()
        self.central_layout.addWidget(self.splitter)
        self.central_layout.addWidget(self.bottom_widget)
        # Warp with a widget
        self.central_widget = QtWidgets.QWidget()
        self.central_widget.setLayout(self.central_layout)
        self.central_widget.setContentsMargins(-5, -5, -5, -5)

        # Set layout
        self.setCentralWidget(self.central_widget)
项目:gtrans-web-gui    作者:takiyu    | 项目源码 | 文件源码
def _init_gui(self):
        self.is_double = True
        # Create a target text box
        self.tgt_box = QtWidgets.QTextEdit(self)
        self.tgt_box.setReadOnly(True)
        self.tgt_box.setAcceptRichText(True)
        # Create a middle text box
        self.middle_box = QtWidgets.QTextEdit(self)
        self.middle_box.setAcceptRichText(True)
        # Create a source text box
        self.src_box = QtWidgets.QTextEdit(self)
        self.src_box.setAcceptRichText(True)
        # Create bottom items
        self.src_lang_box = QtWidgets.QLineEdit(self)
        self.tgt_lang_box = QtWidgets.QLineEdit(self)
        self.middle_lang_box = QtWidgets.QLineEdit(self)
        self.src_lang_box.setFixedWidth(50)
        self.tgt_lang_box.setFixedWidth(50)
        self.middle_lang_box.setFixedWidth(50)
        # show candidate list when clicked
        self.src_lang_box.focusInEvent = lambda _: self._show_candidates(1)
        self.tgt_lang_box.focusInEvent = lambda _: self._show_candidates(2)
        self.middle_lang_box.focusInEvent = lambda _: self._show_candidates(3)
        self.trans_btn = QtWidgets.QPushButton("Translate", self)
        self.trans_btn.clicked.connect(lambda: self.translate())
        self.toggle_double_btn = QtWidgets.QPushButton("toggle", self)
        self.toggle_double_btn.clicked.connect(lambda: self.toggle_double())

        # Create a splitter for text box
        self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical)
        self.splitter.addWidget(self.tgt_box)
        self.splitter.addWidget(self.middle_box)
        self.splitter.addWidget(self.src_box)
        self.splitter.setCollapsible(0, False)
        self.splitter.setCollapsible(1, False)
        self.splitter.setCollapsible(2, False)

        # Create horizontal bottom layout
        self.bottom_layout = QtWidgets.QHBoxLayout()
        self.bottom_layout.addWidget(self.src_lang_box)
        self.bottom_layout.addWidget(self.middle_lang_box)
        self.bottom_layout.addWidget(self.tgt_lang_box)
        self.bottom_layout.addWidget(self.trans_btn)
        self.bottom_layout.addWidget(self.toggle_double_btn)
        # Warp with a widget
        self.bottom_widget = QtWidgets.QWidget()
        self.bottom_widget.setLayout(self.bottom_layout)
        self.bottom_widget.setContentsMargins(-5, -5, -5, -5)

        # Create vertical central layout
        self.central_layout = QtWidgets.QVBoxLayout()
        self.central_layout.addWidget(self.splitter)
        self.central_layout.addWidget(self.bottom_widget)
        # Warp with a widget
        self.central_widget = QtWidgets.QWidget()
        self.central_widget.setLayout(self.central_layout)
        self.central_widget.setContentsMargins(-5, -5, -5, -5)

        # Set layout
        self.setCentralWidget(self.central_widget)
项目:urh    作者:jopohl    | 项目源码 | 文件源码
def setupUi(self, DialogLabels):
        DialogLabels.setObjectName("DialogLabels")
        DialogLabels.resize(714, 463)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(DialogLabels)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.splitter = QtWidgets.QSplitter(DialogLabels)
        self.splitter.setStyleSheet("QSplitter::handle:vertical {\n"
"margin: 4px 0px;\n"
"    background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, \n"
"stop:0 rgba(255, 255, 255, 0), \n"
"stop:0.5 rgba(100, 100, 100, 100), \n"
"stop:1 rgba(255, 255, 255, 0));\n"
"    image: url(:/icons/icons/splitter_handle_horizontal.svg);\n"
"}")
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setHandleWidth(6)
        self.splitter.setChildrenCollapsible(False)
        self.splitter.setObjectName("splitter")
        self.groupBoxSettings = QtWidgets.QGroupBox(self.splitter)
        self.groupBoxSettings.setObjectName("groupBoxSettings")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBoxSettings)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tblViewProtoLabels = ProtocolLabelTableView(self.groupBoxSettings)
        self.tblViewProtoLabels.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.tblViewProtoLabels.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        self.tblViewProtoLabels.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
        self.tblViewProtoLabels.setHorizontalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel)
        self.tblViewProtoLabels.setObjectName("tblViewProtoLabels")
        self.verticalLayout.addWidget(self.tblViewProtoLabels)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label = QtWidgets.QLabel(self.groupBoxSettings)
        font = QtGui.QFont()
        font.setUnderline(False)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        self.cbProtoView = QtWidgets.QComboBox(self.groupBoxSettings)
        self.cbProtoView.setObjectName("cbProtoView")
        self.cbProtoView.addItem("")
        self.cbProtoView.addItem("")
        self.cbProtoView.addItem("")
        self.horizontalLayout_2.addWidget(self.cbProtoView)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.groupBoxAdvancedSettings = QtWidgets.QGroupBox(self.splitter)
        self.groupBoxAdvancedSettings.setObjectName("groupBoxAdvancedSettings")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBoxAdvancedSettings)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.tabWidgetAdvancedSettings = QtWidgets.QTabWidget(self.groupBoxAdvancedSettings)
        self.tabWidgetAdvancedSettings.setObjectName("tabWidgetAdvancedSettings")
        self.verticalLayout_2.addWidget(self.tabWidgetAdvancedSettings)
        self.verticalLayout_3.addWidget(self.splitter)
        self.btnConfirm = QtWidgets.QPushButton(DialogLabels)
        self.btnConfirm.setObjectName("btnConfirm")
        self.verticalLayout_3.addWidget(self.btnConfirm)

        self.retranslateUi(DialogLabels)
        QtCore.QMetaObject.connectSlotsByName(DialogLabels)
项目:qturtle    作者:Transpyler    | 项目源码 | 文件源码
def __init__(self,
                 transpyler,
                 parent=None, *,
                 theme='dark',
                 header_text=None,
                 hide_console_margins=False):
        assert transpyler
        super().__init__(parent=parent, theme=theme)
        self._transpyler = transpyler
        self._header_text = header_text
        self._hide_console_margins = hide_console_margins
        self._console = self._createConsoleApp()
        self._editor = self._createEditorApp()
        self._editor.setConsole(self._console)

        # Create buttons
        run_button = QtWidgets.QPushButton('Run')
        hideup_button = QtWidgets.QPushButton('\u25b2')
        hidedown_button = QtWidgets.QPushButton('\u25bc')
        run_button.setMaximumWidth(100)
        hideup_button.setFixedWidth(35)
        hidedown_button.setFixedWidth(35)
        buttons = QtWidgets.QWidget()
        button_area = QtWidgets.QHBoxLayout(buttons)
        button_area.addWidget(hideup_button, 20)
        button_area.addWidget(hidedown_button, 20)
        button_area.addStretch(300)
        button_area.addWidget(run_button, 200)
        button_area.setContentsMargins(0, 0, 0, 0)
        buttons.setFixedHeight(25)

        # Connect signals
        run_button.clicked.connect(self.runCode)
        hideup_button.clicked.connect(self.hideUp)
        hidedown_button.clicked.connect(self.hideDown)

        # Create top area with the Editor and the button area element
        top_widget = QtWidgets.QWidget()
        top_layout = QtWidgets.QVBoxLayout(top_widget)
        top_layout.setContentsMargins(0, 0, 0, 0)
        top_layout.addWidget(self._editor.widget())
        top_layout.addWidget(buttons)
        self._top_widget = top_widget

        # Add elements
        layout = QtWidgets.QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        splitter = QtWidgets.QSplitter(QtCore.Qt.Orientation(0))
        splitter.addWidget(top_widget)
        splitter.addWidget(self._console.widget())
        splitter.setSizes([200, 120])
        splitter.setChildrenCollapsible(False)
        layout.addWidget(splitter)
        self._splitter = splitter
        self._splitter_sizes = splitter.sizes()

        # Size hints
        self.setMinimumSize(QtCore.QSize(100, 200))

        # Set theme
        self.setTheme(self.theme())