python类QSpacerItem()的实例源码

addition.py 文件源码 项目:MusicPlayer 作者: HuberTRoy 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(SearchLineEdit, self).__init__()
        self.setObjectName("SearchLine")
        self.parent = parent
        self.setMinimumSize(218, 20)
        with open('QSS/searchLine.qss', 'r') as f:
            self.setStyleSheet(f.read())

        self.button = QPushButton(self)
        self.button.setMaximumSize(13, 13)
        self.button.setCursor(QCursor(Qt.PointingHandCursor))

        self.setTextMargins(3, 0, 19, 0)

        self.spaceItem = QSpacerItem(150, 10, QSizePolicy.Expanding)

        self.mainLayout = QHBoxLayout()
        self.mainLayout.addSpacerItem(self.spaceItem)
        # self.mainLayout.addStretch(1)
        self.mainLayout.addWidget(self.button)
        self.mainLayout.addSpacing(10)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.mainLayout)
messages.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def __init__(self, msg, details="", parent=None):
        super().__init__(parent=parent)
        self.setWindowTitle("Error message")
        self.setIcon(QW.QMessageBox.Critical)

        # Force a minimum width ! Cannot use setFixedWidth. This is a trick
        # found on
        # http://www.qtcentre.org/threads/22298-QMessageBox-Controlling-the-width
        layout = self.layout()
        spacer = QW.QSpacerItem(600,0)
        layout.addItem(spacer, layout.rowCount(), 0,1,layout.columnCount())

        msg = '<b style="color:red">' + msg + "</b><br><br>"
        try: details = str(details).replace("\\n", "<br>")
        except: pass
        self.setText(msg + details)
builtin.py 文件源码 项目:pyree-old 作者: DrLuke 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(FileWatch, self).__init__(*args, **kwargs)

        self.filePath = ""
        self.lastEdited = 0
        self.fileContent = ""

        self.propertiesWidget = QWidget()

        self.vlayout = QVBoxLayout()
        self.lineEdit = QLineEdit()
        self.lineEdit.textChanged.connect(self.lineEditTextChanges)

        self.vlayout.addWidget(self.lineEdit)
        self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self.propertiesWidget.setLayout(self.vlayout)

        self.timer = QTimer()
        self.timer.timeout.connect(self.checkFileChange)
        self.timer.start(200)
openglbase.py 文件源码 项目:pyree-old 作者: DrLuke 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(FullScreenQuad, self).__init__(*args, **kwargs)

        self.propertiesWidget = QWidget()

        self.vlayout = QVBoxLayout()

        self.xoffsetWidget = QDoubleSpinBox()
        self.xoffsetWidget.setMaximum(9999)
        self.xoffsetWidget.setMinimum(-9999)
        self.yoffsetWidget = QDoubleSpinBox()
        self.yoffsetWidget.setMaximum(9999)
        self.yoffsetWidget.setMinimum(-9999)
        self.vlayout.addWidget(self.xoffsetWidget)
        self.vlayout.addWidget(self.yoffsetWidget)

        self.xoffsetWidget.valueChanged.connect(self.offsetchange)
        self.yoffsetWidget.valueChanged.connect(self.offsetchange)

        self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self.propertiesWidget.setLayout(self.vlayout)
baseModule.py 文件源码 项目:pyree-old 作者: DrLuke 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        self.ownsheet = None
        self.sheets = None
        self.selectedSheet = None
        self.listSheetItems = {}

        super(SubSheet, self).__init__(*args, **kwargs)

        self.propertiesWidget = QWidget()

        self.vlayout = QVBoxLayout()

        self.listWidget = QListWidget()
        self.listWidget.itemClicked.connect(self.listClicked)
        self.vlayout.addWidget(self.listWidget)

        self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self.propertiesWidget.setLayout(self.vlayout)
qt_listview.py 文件源码 项目:pypog 作者: cro-ki 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def setupUi(self, window):
        window.setObjectName("window")
        window.resize(380, 477)
        window.setModal(True)
        self.verticalLayout = QtWidgets.QVBoxLayout(window)
        self.verticalLayout.setObjectName("verticalLayout")
        self.txt_list = QtWidgets.QTextEdit(window)
        self.txt_list.setMinimumSize(QtCore.QSize(183, 0))
        self.txt_list.setAcceptRichText(False)
        self.txt_list.setObjectName("txt_list")
        self.verticalLayout.addWidget(self.txt_list)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, -1, -1, 10)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.btn_cancel = QtWidgets.QPushButton(window)
        self.btn_cancel.setAutoDefault(False)
        self.btn_cancel.setObjectName("btn_cancel")
        self.horizontalLayout.addWidget(self.btn_cancel)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.btn_ok = QtWidgets.QPushButton(window)
        self.btn_ok.setAutoDefault(True)
        self.btn_ok.setObjectName("btn_ok")
        self.horizontalLayout.addWidget(self.btn_ok)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(window)
        QtCore.QMetaObject.connectSlotsByName(window)
widgets.py 文件源码 项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def process_delete(self, process):
        """
        Handle the removal of a B3 process.
        """
        msgbox = QMessageBox()
        msgbox.setIcon(QMessageBox.Question)
        msgbox.setWindowTitle('CONFIRM')
        msgbox.setText('Are you sure?')
        msgbox.setInformativeText('Do you want to remove %s?' % process.name)
        msgbox.setStandardButtons(QMessageBox.No|QMessageBox.Yes)
        msgbox.setDefaultButton(QMessageBox.No)
        msgbox.layout().addItem(QSpacerItem(300, 0, QSizePolicy.Minimum, QSizePolicy.Expanding),
                                msgbox.layout().rowCount(), 0, 1, msgbox.layout().columnCount())
        msgbox.exec_()

        if msgbox.result() == QMessageBox.Yes:
            if process.state() != QProcess.NotRunning:
                self.process_shutdown(process)
            process.delete()
            self.repaint()
dialogs.py 文件源码 项目:RRPam-WDS 作者: asselapathirana 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def draw_network(self, links):
        # get the units
        self.dunits = self.mainwindow.projectgui.projectproperties.dataset.dunits
        self.lunits = self.mainwindow.projectgui.projectproperties.dataset.lunits

        logger = logging.getLogger()
        if(not links):
            logger.info("Links sent was None. Ignoring request to draw!")
            return
        logger.info("Creating assignment items for %d links " % len(links))

        for link in links:
            self.add_assign_asset_item(link)
        spacerItem = QtWidgets.QSpacerItem(
            20,
            40,
            QtWidgets.QSizePolicy.Minimum,
            QtWidgets.QSizePolicy.Expanding)
        self.ui.assign_asset_item_parent_layout.addItem(spacerItem)

        # now populate select_diameter_combobox with unique diameters
        dia = [str(y) for y in sorted(set(x.diameter_ for x in self.myplotitems.values()))]
        self.ui.select_diameter_combobox.clear()
        self.ui.select_diameter_combobox.addItems(dia)
file_transfer.py 文件源码 项目:uPyLoader 作者: BetaRavener 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def setupUi(self, FileTransferDialog):
        FileTransferDialog.setObjectName("FileTransferDialog")
        FileTransferDialog.resize(400, 120)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(FileTransferDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label = QtWidgets.QLabel(FileTransferDialog)
        self.label.setObjectName("label")
        self.verticalLayout_2.addWidget(self.label)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.progressBar = QtWidgets.QProgressBar(FileTransferDialog)
        self.progressBar.setProperty("value", 24)
        self.progressBar.setObjectName("progressBar")
        self.verticalLayout.addWidget(self.progressBar)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.cancelButton = QtWidgets.QPushButton(FileTransferDialog)
        self.cancelButton.setEnabled(False)
        self.cancelButton.setCheckable(False)
        self.cancelButton.setObjectName("cancelButton")
        self.horizontalLayout.addWidget(self.cancelButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(FileTransferDialog)
        QtCore.QMetaObject.connectSlotsByName(FileTransferDialog)
ui_summary.py 文件源码 项目:kaptan 作者: KaOSx 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        self.setSubTitle(self.tr("<h2>Save Your Settings</h2>"))

        vlayout = QVBoxLayout(self)

        label = QLabel(self)
        label.setWordWrap(True)
        label.setText(self.tr("<p>You have successfully finished all steps. Here's a summary of the settings you want to apply. \
        Click <strong>Apply Settings</strong> to save them now. You are now ready to enjoy KaOS!</p>"))
        vlayout.addWidget(label)
        vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred))

        groupBox = QGroupBox()
        groupBox.setTitle(self.tr("The following settings will be applied"))
        groupBox.setMinimumHeight(350)

        groupLayout = QHBoxLayout(groupBox)
        self.labelSummary = QLabel()
        self.labelSummary.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
        groupLayout.addWidget(    self.labelSummary)
        self.labelSummary2 = QLabel()
        self.labelSummary2.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop)
        groupLayout.addWidget(    self.labelSummary2)
        vlayout.addWidget(groupBox)

        vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred))

        self.summary = {}
        self.parent().summaryVisible.connect(self.summaryWrite)
ui_welcome.py 文件源码 项目:kaptan 作者: KaOSx 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        self.setSubTitle(self.tr("<h2>Welcome to KaOS</h2>"))

        vlayout = QVBoxLayout(self)
        vlayout.addItem(QSpacerItem(20, 30, QSizePolicy.Preferred, QSizePolicy.Minimum))

        hlayout = QHBoxLayout(self)
        label = QLabel(self)
        label.setText(self.tr("""<h1>What is KaOS?</h1>
        <p>The idea behind KaOS is to create a tightly integrated rolling and<br />
        transparent distribution for the modern desktop, build from scratch with<br />
        a very specific focus. Focus on one DE (KDE), one toolkit (Qt) & one architecture (x86_64).<br />
        Plus a focus on evaluating and selecting the most suitable tools and applications.</p>
        <p>This wizard will help you personalize your KaOS workspace easily and quickly.</p>
        <p>Please click <code style=color:#3498DB>Next</code> in order to begin. Click <code style=color:#3498DB>Cancel</code> anytime and changes won't be saved.</p>"""))
        label.setWordWrap(True)
        label.setAlignment(Qt.AlignLeft)
        hlayout.addWidget(label)

        kaptan_logo = QLabel(self)
        kaptan_logo.setPixmap(QPixmap(":/data/images/welcome.png"))
        kaptan_logo.setAlignment(Qt.AlignRight)
        kaptan_logo.setMaximumSize(157, 181)
        hlayout.addWidget(kaptan_logo)
        vlayout.addLayout(hlayout)

        vlayout.addItem(QSpacerItem(20, 40, QSizePolicy.Preferred, QSizePolicy.Preferred))

        desktop_file = os.path.join(os.environ["HOME"], ".config", "autostart", "kaptan.desktop")
        if os.path.exists(desktop_file):
            self.checkBox = QCheckBox()
            self.checkBox.setText(self.tr("Run on system startup"))
            self.checkBox.setChecked(True)
            self.checkBox.clicked.connect(self.autoRemove)
            vlayout.addWidget(self.checkBox)
independenceTestViewerUi.py 文件源码 项目:coquery 作者: gkunter 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def setupUi(self, IndependenceTestViewer):
        IndependenceTestViewer.setObjectName("IndependenceTestViewer")
        IndependenceTestViewer.resize(640, 480)
        self.verticalLayout = QtWidgets.QVBoxLayout(IndependenceTestViewer)
        self.verticalLayout.setContentsMargins(0, -1, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(4, -1, 4, -1)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(IndependenceTestViewer)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.button_copy_text = QtWidgets.QPushButton(IndependenceTestViewer)
        self.button_copy_text.setObjectName("button_copy_text")
        self.horizontalLayout.addWidget(self.button_copy_text)
        self.button_copy_html = QtWidgets.QPushButton(IndependenceTestViewer)
        self.button_copy_html.setObjectName("button_copy_html")
        self.horizontalLayout.addWidget(self.button_copy_html)
        self.button_copy_latex = QtWidgets.QPushButton(IndependenceTestViewer)
        self.button_copy_latex.setObjectName("button_copy_latex")
        self.horizontalLayout.addWidget(self.button_copy_latex)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.textBrowser = QtWidgets.QTextBrowser(IndependenceTestViewer)
        self.textBrowser.setObjectName("textBrowser")
        self.verticalLayout.addWidget(self.textBrowser)

        self.retranslateUi(IndependenceTestViewer)
        QtCore.QMetaObject.connectSlotsByName(IndependenceTestViewer)
aboutUi.py 文件源码 项目:coquery 作者: gkunter 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def setupUi(self, AboutDialog):
        AboutDialog.setObjectName("AboutDialog")
        AboutDialog.resize(640, 480)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(AboutDialog.sizePolicy().hasHeightForWidth())
        AboutDialog.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(AboutDialog)
        self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
        self.verticalLayout.setSpacing(16)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame_pixmap = QtWidgets.QFrame(AboutDialog)
        self.frame_pixmap.setStyleSheet("background-color: #fffdfd")
        self.frame_pixmap.setObjectName("frame_pixmap")
        self.layout_pixmap = QtWidgets.QVBoxLayout(self.frame_pixmap)
        self.layout_pixmap.setContentsMargins(4, 3, 4, 3)
        self.layout_pixmap.setSpacing(0)
        self.layout_pixmap.setObjectName("layout_pixmap")
        self.label_pixmap = QtWidgets.QLabel(self.frame_pixmap)
        self.label_pixmap.setText("")
        self.label_pixmap.setObjectName("label_pixmap")
        self.layout_pixmap.addWidget(self.label_pixmap)
        self.verticalLayout.addWidget(self.frame_pixmap)
        self.label_description = QtWidgets.QLabel(AboutDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_description.sizePolicy().hasHeightForWidth())
        self.label_description.setSizePolicy(sizePolicy)
        self.label_description.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.label_description.setWordWrap(True)
        self.label_description.setOpenExternalLinks(True)
        self.label_description.setObjectName("label_description")
        self.verticalLayout.addWidget(self.label_description)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)

        self.retranslateUi(AboutDialog)
        QtCore.QMetaObject.connectSlotsByName(AboutDialog)
orphanagedDatabasesUi.py 文件源码 项目:coquery 作者: gkunter 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def setupUi(self, OrphanagedDatabases):
        OrphanagedDatabases.setObjectName("OrphanagedDatabases")
        OrphanagedDatabases.resize(640, 479)
        self.verticalLayout = QtWidgets.QVBoxLayout(OrphanagedDatabases)
        self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(OrphanagedDatabases)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setWordWrap(True)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.listWidget = QtWidgets.QListWidget(OrphanagedDatabases)
        self.listWidget.setObjectName("listWidget")
        self.verticalLayout.addWidget(self.listWidget)
        self.label_3 = QtWidgets.QLabel(OrphanagedDatabases)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
        self.label_3.setSizePolicy(sizePolicy)
        self.label_3.setWordWrap(True)
        self.label_3.setObjectName("label_3")
        self.verticalLayout.addWidget(self.label_3)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.buttonBox = QtWidgets.QDialogButtonBox(OrphanagedDatabases)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.No|QtWidgets.QDialogButtonBox.Yes)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(OrphanagedDatabases)
        self.buttonBox.accepted.connect(OrphanagedDatabases.accept)
        self.buttonBox.rejected.connect(OrphanagedDatabases.reject)
        QtCore.QMetaObject.connectSlotsByName(OrphanagedDatabases)
builtin.py 文件源码 项目:pyree-old 作者: DrLuke 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(Bool, self).__init__(*args, **kwargs)

        self.propertiesWidget = QWidget()

        self.vlayout = QVBoxLayout()
        self.toggle = QCheckBox("Output")
        self.toggle.toggled.connect(self.toggleTrueFalse)

        self.vlayout.addWidget(self.toggle)
        self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self.propertiesWidget.setLayout(self.vlayout)
builtin.py 文件源码 项目:pyree-old 作者: DrLuke 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(String, self).__init__(*args, **kwargs)

        self.text = ""

        self.propertiesWidget = QWidget()

        self.vlayout = QVBoxLayout()
        self.lineEdit = QLineEdit()
        self.lineEdit.textChanged.connect(self.textChanged)

        self.vlayout.addWidget(self.lineEdit)
        self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self.propertiesWidget.setLayout(self.vlayout)
BATS.py 文件源码 项目:BATS-Bayesian-Adaptive-Trial-Simulator 作者: ContaTP 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):

        QtWidgets.QFrame.__init__(self, parent)
        # Set layout
        self.sideLayout = QtWidgets.QVBoxLayout()
        # Widgets
        self.sideTitle = SideTitle(parent)
        self.sideSpacer = QtWidgets.QSpacerItem(240, 150)
        self.sideMenu = SideMenu(parent)
        # Run side information
        # Show when running a task
        self.sideRunMenu = SideRunMenu(parent)
        # Hide when intialize
        self.sideRunMenu.setVisible(False)
        # Option
        self.sideOption = SideOption(parent)
        # Add widgets
        self.sideLayout.addWidget(self.sideTitle, 1)
        self.sideLayout.insertStretch(1, 1)
        self.sideLayout.addWidget(self.sideMenu, 7)
        self.sideLayout.addWidget(self.sideRunMenu, 7)
        self.sideLayout.addWidget(self.sideOption, 0)
        # Add layout
        self.sideLayout.setContentsMargins(0, 0, 0, 0)
        self.sideLayout.setSpacing(0)
        self.setLayout(self.sideLayout)
        # Stylesheet
        self.setStyleSheet("background:#399ee5; ")



# Side Title
BATS.py 文件源码 项目:BATS-Bayesian-Adaptive-Trial-Simulator 作者: ContaTP 项目源码 文件源码 阅读 47 收藏 0 点赞 0 评论 0
def setCallbackPlot(self, filedir):

        self.plot_file = {}
        # Delete previous widgets
        for root, dir, files in os.walk(filedir):

            for file in files:

                if file.endswith(".png"):

                    filename = file.rsplit(".", 1)[0]
                    root_index = root.rsplit("/", 1)[1]
                    if root_index in self.plot_file:

                        if file != "ui.png":

                            self.plot_file[root_index].append(root + "/" + file)

                    else:

                        self.plot_file[root_index] = [root + "/ui.png"]
                        if file != "ui.png":

                            self.plot_file[root_index].append(root + "/" + file)

        row_pos = col_pos = 0

        for root_index in range(0, len(list(self.plot_file.keys()))):

            row_pos = int(root_index/2)
            col_pos = root_index % 2
            root_name = list(self.plot_file.keys())[root_index]
            currentfile = self.plot_file[root_name][0]
            plot_frame = SubGraphViewer(self, root_name, currentfile)
            self.plotViewer.addWidget(plot_frame, row_pos, col_pos, QtCore.Qt.AlignTop)

        # self.plotViewer.addItem(QtWidgets.QSpacerItem(20, 60, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding), row_pos + 1, 0)
        # self.graph_comboBox.setCurrentIndex(-1)
        self.exportPlot_flag = -1
extra_widgets.py 文件源码 项目:plexdesktop 作者: coryo 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, name, parent=None):
        super().__init__(name, parent)
        self.ui = plexdesktop.ui.downloadwindow_ui.Ui_DownloadWindow()
        self.ui.setupUi(self)

        self.mutex = QtCore.QMutex()

        self.setWindowTitle('Downloads')
        self.setWindowFlags(QtCore.Qt.Window)
        self.spacer = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        self.ui.layout.insertItem(-1, self.spacer)
        self.jobs = {}
        self.queue = queue.Queue()
panel_widget.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def finalise(self):
        """ Finalise
        Add a spacer at the bottom of the QGroupBox layout
        """
        policy = QtWidgets.QSizePolicy.Expanding
        self.spacer = QtWidgets.QSpacerItem(0, 0, vPolicy=policy)
        self.layout.addItem(self.spacer)
TraceInstructionsWaitWidget.py 文件源码 项目:PINCE 作者: korcankaraokcu 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(194, 91)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label_Animated = QtWidgets.QLabel(Form)
        self.label_Animated.setText("")
        self.label_Animated.setObjectName("label_Animated")
        self.verticalLayout.addWidget(self.label_Animated)
        self.label_StatusText = QtWidgets.QLabel(Form)
        self.label_StatusText.setText("")
        self.label_StatusText.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextSelectableByMouse)
        self.label_StatusText.setObjectName("label_StatusText")
        self.verticalLayout.addWidget(self.label_StatusText)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.pushButton_Cancel = QtWidgets.QPushButton(Form)
        self.pushButton_Cancel.setObjectName("pushButton_Cancel")
        self.horizontalLayout.addWidget(self.pushButton_Cancel)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
LoadingDialog.py 文件源码 项目:PINCE 作者: korcankaraokcu 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(208, 89)
        self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.label_Animated = QtWidgets.QLabel(Dialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_Animated.sizePolicy().hasHeightForWidth())
        self.label_Animated.setSizePolicy(sizePolicy)
        self.label_Animated.setText("")
        self.label_Animated.setScaledContents(False)
        self.label_Animated.setObjectName("label_Animated")
        self.horizontalLayout.addWidget(self.label_Animated)
        self.label_StatusText = QtWidgets.QLabel(Dialog)
        self.label_StatusText.setObjectName("label_StatusText")
        self.horizontalLayout.addWidget(self.label_StatusText)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.gridLayout_2.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.widget_Cancel = QtWidgets.QWidget(Dialog)
        self.widget_Cancel.setObjectName("widget_Cancel")
        self.gridLayout = QtWidgets.QGridLayout(self.widget_Cancel)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem2, 0, 0, 1, 1)
        self.pushButton_Cancel = QtWidgets.QPushButton(self.widget_Cancel)
        self.pushButton_Cancel.setObjectName("pushButton_Cancel")
        self.gridLayout.addWidget(self.pushButton_Cancel, 0, 1, 1, 1)
        spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem3, 0, 2, 1, 1)
        self.gridLayout_2.addWidget(self.widget_Cancel, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
BookmarkWidget.py 文件源码 项目:PINCE 作者: korcankaraokcu 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(900, 300)
        self.gridLayout = QtWidgets.QGridLayout(Form)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(Form)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.listWidget = QtWidgets.QListWidget(Form)
        self.listWidget.setObjectName("listWidget")
        self.verticalLayout.addWidget(self.listWidget)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.label_2 = QtWidgets.QLabel(Form)
        self.label_2.setObjectName("label_2")
        self.verticalLayout_2.addWidget(self.label_2)
        self.lineEdit_Info = QtWidgets.QLineEdit(Form)
        self.lineEdit_Info.setReadOnly(True)
        self.lineEdit_Info.setObjectName("lineEdit_Info")
        self.verticalLayout_2.addWidget(self.lineEdit_Info)
        self.label_3 = QtWidgets.QLabel(Form)
        self.label_3.setObjectName("label_3")
        self.verticalLayout_2.addWidget(self.label_3)
        self.lineEdit_Comment = QtWidgets.QLineEdit(Form)
        self.lineEdit_Comment.setReadOnly(True)
        self.lineEdit_Comment.setObjectName("lineEdit_Comment")
        self.verticalLayout_2.addWidget(self.lineEdit_Comment)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem)
        self.horizontalLayout.addLayout(self.verticalLayout_2)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
qt_PluginSelector.py 文件源码 项目:CRIkit2 作者: CoherentRamanNIST 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(389, 239)
        Dialog.setStyleSheet("font: 10pt \"Arial\";")
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(Dialog)
        font = QtGui.QFont()
        font.setFamily("Arial")
        font.setPointSize(10)
        font.setItalic(False)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label, 0, QtCore.Qt.AlignTop)
        self.comboBox = QtWidgets.QComboBox(Dialog)
        self.comboBox.setObjectName("comboBox")
        self.verticalLayout.addWidget(self.comboBox)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem1)
        self.label_2 = QtWidgets.QLabel(Dialog)
        self.label_2.setObjectName("label_2")
        self.verticalLayout.addWidget(self.label_2)
        self.plainTextEditDescription = QtWidgets.QPlainTextEdit(Dialog)
        self.plainTextEditDescription.setReadOnly(True)
        self.plainTextEditDescription.setObjectName("plainTextEditDescription")
        self.verticalLayout.addWidget(self.plainTextEditDescription)
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)

        self.retranslateUi(Dialog)
        self.buttonBox.accepted.connect(Dialog.accept)
        self.buttonBox.rejected.connect(Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
qt_PlotEffect.py 文件源码 项目:CRIkit2 作者: CoherentRamanNIST 项目源码 文件源码 阅读 44 收藏 0 点赞 0 评论 0
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(640, 977)
        self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.pushButtonOk = QtWidgets.QPushButton(Dialog)
        self.pushButtonOk.setFocusPolicy(QtCore.Qt.NoFocus)
        self.pushButtonOk.setLayoutDirection(QtCore.Qt.LeftToRight)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/icons/open-iconic-master/png/check-3x.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButtonOk.setIcon(icon)
        self.pushButtonOk.setIconSize(QtCore.QSize(35, 35))
        self.pushButtonOk.setDefault(False)
        self.pushButtonOk.setFlat(False)
        self.pushButtonOk.setObjectName("pushButtonOk")
        self.horizontalLayout.addWidget(self.pushButtonOk)
        self.pushButtonCancel = QtWidgets.QPushButton(Dialog)
        self.pushButtonCancel.setFocusPolicy(QtCore.Qt.NoFocus)
        self.pushButtonCancel.setLayoutDirection(QtCore.Qt.LeftToRight)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/icons/open-iconic-master/png/thumb-down-3x.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButtonCancel.setIcon(icon1)
        self.pushButtonCancel.setIconSize(QtCore.QSize(35, 35))
        self.pushButtonCancel.setDefault(False)
        self.pushButtonCancel.setFlat(False)
        self.pushButtonCancel.setObjectName("pushButtonCancel")
        self.horizontalLayout.addWidget(self.pushButtonCancel)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.line = QtWidgets.QFrame(Dialog)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setLineWidth(5)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setObjectName("line")
        self.verticalLayout.addWidget(self.line)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
finish.py 文件源码 项目:lilii 作者: LimeLinux 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__()
        self.parent = parent
        self.setWindowTitle(self.tr("Finish"))
        self.setLayout(QVBoxLayout())

        titleText = QLabel()
        self.layout().addWidget(titleText)
        titleText.setAlignment(Qt.AlignCenter)
        titleText.setText(self.tr("<h1>All of the process is completed.</h1>"))

        descText = QLabel()
        descText.setWordWrap(True)
        descText.setAlignment(Qt.AlignCenter)
        descText.setText(self.tr("Lime GNU/Linux, has been installed successfully to your system.\nTo use the newly installed system "
                                 "you can restart or you can continue to use Lime GNU/Linux Live system."))
        self.layout().addWidget(descText)

        hlayout = QHBoxLayout()
        self.layout().addLayout(hlayout)

        hlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Preferred, QSizePolicy.Preferred))

        restartButton = CustomButton()
        restartButton.setFlat(True)
        restartButton.setIcon(QIcon(":/images/restart.svg"))
        restartButton.setIconSize(QSize(128, 128))
        restartButton.setFixedSize(130, 130)
        hlayout.addWidget(restartButton)

        hlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Preferred, QSizePolicy.Preferred))

        restartButton.clicked.connect(self.systemRestart)
ui_derlem.py 文件源码 项目:kalbur 作者: ahmetax 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def setupUi(self, dlgDerlem):
        dlgDerlem.setObjectName("dlgDerlem")
        dlgDerlem.resize(656, 460)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(dlgDerlem)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.editGirdi = QtWidgets.QPlainTextEdit(dlgDerlem)
        self.editGirdi.setObjectName("editGirdi")
        self.verticalLayout.addWidget(self.editGirdi)
        self.editCikti = QtWidgets.QPlainTextEdit(dlgDerlem)
        self.editCikti.setObjectName("editCikti")
        self.verticalLayout.addWidget(self.editCikti)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.btnSecenekler = QtWidgets.QPushButton(dlgDerlem)
        self.btnSecenekler.setObjectName("btnSecenekler")
        self.horizontalLayout.addWidget(self.btnSecenekler)
        self.btnGirdiDosyasiSec = QtWidgets.QPushButton(dlgDerlem)
        self.btnGirdiDosyasiSec.setObjectName("btnGirdiDosyasiSec")
        self.horizontalLayout.addWidget(self.btnGirdiDosyasiSec)
        self.btnDonustur = QtWidgets.QPushButton(dlgDerlem)
        self.btnDonustur.setObjectName("btnDonustur")
        self.horizontalLayout.addWidget(self.btnDonustur)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.btnKaydet = QtWidgets.QPushButton(dlgDerlem)
        self.btnKaydet.setObjectName("btnKaydet")
        self.horizontalLayout.addWidget(self.btnKaydet)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(dlgDerlem)
        self.btnSecenekler.clicked.connect(dlgDerlem.secenekler)
        self.btnGirdiDosyasiSec.clicked.connect(dlgDerlem.dosyasec)
        self.btnDonustur.clicked.connect(dlgDerlem.donustur)
        self.btnKaydet.clicked.connect(dlgDerlem.kaydet)
        QtCore.QMetaObject.connectSlotsByName(dlgDerlem)
ui_secenekler.py 文件源码 项目:kalbur 作者: ahmetax 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(216, 152)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.chkStopword = QtWidgets.QCheckBox(Dialog)
        self.chkStopword.setObjectName("chkStopword")
        self.verticalLayout.addWidget(self.chkStopword)
        self.chkEnuzunkok = QtWidgets.QCheckBox(Dialog)
        self.chkEnuzunkok.setObjectName("chkEnuzunkok")
        self.verticalLayout.addWidget(self.chkEnuzunkok)
        self.chkTumKokleriListele = QtWidgets.QCheckBox(Dialog)
        self.chkTumKokleriListele.setObjectName("chkTumKokleriListele")
        self.verticalLayout.addWidget(self.chkTumKokleriListele)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        spacerItem = QtWidgets.QSpacerItem(20, 17, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pushButton = QtWidgets.QPushButton(Dialog)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout.addWidget(self.pushButton)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.pushButton_2 = QtWidgets.QPushButton(Dialog)
        self.pushButton_2.setObjectName("pushButton_2")
        self.horizontalLayout.addWidget(self.pushButton_2)
        self.verticalLayout_2.addLayout(self.horizontalLayout)

        self.retranslateUi(Dialog)
        self.pushButton.clicked.connect(Dialog.close)
        self.pushButton_2.clicked.connect(Dialog.secenekKaydet)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
universal_tool_template_v8.1.py 文件源码 项目:universal_tool_template.py 作者: shiningdesign 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
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)
run.py 文件源码 项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def run_gui():
    """
    Run B3 graphical user interface.
    Will raise an exception if the GUI cannot be initialized.
    """
    from b3.gui import B3App
    from b3.gui.misc import SplashScreen
    from PyQt5.QtWidgets import QMessageBox
    from PyQt5.QtWidgets import QSpacerItem, QSizePolicy

    # initialize outside try/except so if PyQt5 is not avaiable or there is
    # no display adapter available, this will raise an exception and we can
    # fallback into console mode
    app = B3App.Instance(sys.argv)

    try:
        with SplashScreen(min_splash_time=2):
            mainwindow = app.init()
    except Exception, e:
        box = QMessageBox()
        box.setIcon(QMessageBox.Critical)
        box.setWindowTitle('CRITICAL')
        box.setText('CRITICAL: B3 FAILED TO START!')
        box.setInformativeText('ERROR: %s' % e)
        box.setDetailedText(traceback.format_exc())
        box.setStandardButtons(QMessageBox.Ok)

        # this will trick Qt and resize a bit the QMessageBox to the exception stack trace is printed nice
        box.layout().addItem(QSpacerItem(400, 0, QSizePolicy.Minimum, QSizePolicy.Expanding),
                             box.layout().rowCount(), 0, 1, box.layout().columnCount())
        box.exec_()
        sys.exit(127)
    else:
        mainwindow.make_visible()
        sys.exit(app.exec_())


问题


面经


文章

微信
公众号

扫码关注公众号