python类loadUi()的实例源码

dialogs.py 文件源码 项目:Pesterchum-Discord 作者: henry232323 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, app, parent, f=False, i=True):
        """
        Dialog opened when the Add [Chum] button is pressed, adds to chumsTree widget
        """
        super(__class__, self).__init__()
        self.parent = parent
        self.app = app
        self.i = i
        self.fin = False
        uic.loadUi(self.app.theme["ui_path"] + "/AuthDialog.ui", self)
        self.setWindowTitle('Auth')
        self.setWindowIcon(QIcon(app.theme["path"] + "/trayicon.png"))
        self.acceptButton.clicked.connect(self.accepted)
        self.closeButton.clicked.connect(self.rejected)
        if f:
            self.errorLabel.setText("""Invalid login / token! Failed to login.""")
        self.auth = None
        self.exec_()
dialogs.py 文件源码 项目:Pesterchum-Discord 作者: henry232323 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, app):
        super(__class__, self).__init__()
        self.app = app
        uic.loadUi(self.app.theme["ui_path"] + "/QuirksWindow.ui", self)
        self.addQuirkButton.clicked.connect(self.openQuirk)
        self.editQuirkButton.clicked.connect(self.editQuirk)
        self.removeQuirkButton.clicked.connect(self.removeQuirk)
        self.cancelButton.clicked.connect(self.closeWin)
        self.okButton.clicked.connect(self.save)
        self.testButton.clicked.connect(self.testQuirks)
        for type, quirk in self.app.quirks.quirks:
            self.quirksList.addItem("{}:{}".format(type, quirk))

        self.setWindowTitle('Quirks')
        self.setWindowIcon(QIcon(app.theme["path"] + "/trayicon.png"))

        self.show()
dialogs.py 文件源码 项目:Pesterchum-Discord 作者: henry232323 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, app, parent):
        super(__class__, self).__init__()
        uic.loadUi(app.theme["ui_path"] + "/ConnectingDialog.ui", self)
        self.app = app
        self.parent = parent
        self.setWindowFlags(Qt.FramelessWindowHint)
        self.connectingExitButton.clicked.connect(sysexit)
        self.setWindowTitle('Connecting')
        self.setWindowIcon(QIcon(app.theme["path"] + "/trayicon.png"))
        self.app.connectingDialog = self
        width = self.frameGeometry().width()
        height = self.frameGeometry().height()
        self.setFixedSize(width, height)

    # Methods for moving window
InsertSinePlugin.py 文件源码 项目:urh 作者: jopohl 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def dialog_ui(self) -> QDialog:
        if self.__dialog_ui is None:
            dir_name = os.path.dirname(os.readlink(__file__)) if os.path.islink(__file__) else os.path.dirname(__file__)
            self.__dialog_ui = uic.loadUi(os.path.realpath(os.path.join(dir_name, "insert_sine_dialog.ui")))
            self.__dialog_ui.setAttribute(Qt.WA_DeleteOnClose)
            self.__dialog_ui.setModal(True)
            self.__dialog_ui.doubleSpinBoxAmplitude.setValue(self.__amplitude)
            self.__dialog_ui.doubleSpinBoxFrequency.setValue(self.__frequency)
            self.__dialog_ui.doubleSpinBoxPhase.setValue(self.__phase)
            self.__dialog_ui.doubleSpinBoxSampleRate.setValue(self.__sample_rate)
            self.__dialog_ui.doubleSpinBoxNSamples.setValue(self.__num_samples)
            self.__dialog_ui.lineEditTime.setValidator(
                QRegExpValidator(QRegExp("[0-9]+([nmµ]*|([\.,][0-9]{1,3}[nmµ]*))?$")))

            scene_manager = SceneManager(self.dialog_ui.graphicsViewSineWave)
            self.__dialog_ui.graphicsViewSineWave.scene_manager = scene_manager
            self.insert_indicator = scene_manager.scene.addRect(0, -2, 0, 4,
                                                                QPen(QColor(Qt.transparent), Qt.FlatCap),
                                                                QBrush(self.INSERT_INDICATOR_COLOR))
            self.insert_indicator.stackBefore(scene_manager.scene.selection_area)

            self.set_time()

        return self.__dialog_ui
runnix.py 文件源码 项目:runnix 作者: TheInitializer 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self):
        QtWidgets.QMainWindow.__init__(self)

        self.ui = uic.loadUi(l('mainwindow.ui'), self)
        self.ui.show()

        self.ui.runIcon.pixmap = l("run_37198.jpg")

        self.okButton.clicked.connect(self.run)
        self.commandBox.lineEdit().returnPressed.connect(self.run)

        self.commandBox.setFocus()
MoboScrap.py 文件源码 项目:MoboScrap 作者: stoic1979 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self):
        QWidget.__init__(self)
        uic.loadUi(os.path.join(DIRPATH, 'MoboScrap.ui'), self)

        # adding button event handlers
        self.btnItunesSearch.clicked.connect(self.handleItunesSearch)

        # populating country names
        for country in countries:
            self.cbCountries.addItem(country["name"])
qt.py 文件源码 项目:cmt 作者: chadmv 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def pyqt4_load_ui(fname):
    """Read Qt Designer .ui `fname`

    Args:
        fname (str): Absolute path to .ui file

    """

    from PyQt4 import uic
    return uic.loadUi(fname)
qt.py 文件源码 项目:cmt 作者: chadmv 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def pyqt5_load_ui(fname):
    """Read Qt Designer .ui `fname`

    Args:
        fname (str): Absolute path to .ui file

    """

    from PyQt5 import uic
    return uic.loadUi(fname)
lab3.py 文件源码 项目:Computer-graphics 作者: Panda-Lewandowski 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = QtWidgets.QGraphicsScene(0, 0, 511, 511)
        self.mainview.setScene(self.scene)
        self.image = QImage(511, 511, QImage.Format_ARGB32_Premultiplied)
        self.pen = QPen()
        self.color_line = QColor(Qt.black)
        self.color_bground = QColor(Qt.white)
        self.draw_line.clicked.connect(lambda: draw_line(self))
        self.clean_all.clicked.connect(lambda : clear_all(self))
        self.btn_bground.clicked.connect(lambda: get_color_bground(self))
        self.btn_line.clicked.connect(lambda: get_color_line(self))
        self.draw_sun.clicked.connect(lambda: draw_sun(self))
        self.cda.setChecked(True)
gui.py 文件源码 项目:Speaker_recognition 作者: Mgajurel 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, uipath="user_interface.ui", verbose=False):
        super(Ui, self).__init__()
        uic.loadUi(uipath, self)
        self.status = ""
        self.output = ""
        self.isPredicting=False

        #Thread
        self.train_th = TrainThread(self)
        self.train_th.finished.connect(self.train_fin)

        self.predict_th = PredictionThread(self)
        self.predict_th.finished.connect(self.predict_fin)

        self.test_predict_th = TestPredictionThread(self)
        self.test_predict_th.finished.connect(self.test_predict_fin)

        # UI Initializes
        self.btn_train.clicked.connect(self.start_train)
        self.btn_predict.clicked.connect(self.start_predict)
        self.btn_test_predict.clicked.connect(self.start_test_predict)
        self.checkBox_verbose.clicked.connect(self.verbose_changed)
        self.checkBox_delta_mode.clicked.connect(self.delta_changed)

        # Show the form
        self.show()
        self.nn = NeuralNetwork(is_delta_mode=False, verbose=verbose)
widget_node_base.py 文件源码 项目:urban-journey 作者: urbanjourney 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def load_ui(self, path: str):
        """Load in .ui file created by Qt Designer."""
        if not isabs(path):
            # If path is relative find ui file relative to file containing QWidgetNodeBase child class.
            path = join(dirname(inspect.getfile(sys._getframe(1))), path)
        uic.loadUi(path, self)
element_windows.py 文件源码 项目:pandapower_gui 作者: Tooblippe 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def initialize_window(self):
        uic.loadUi('resources/ui/add_s_line.ui', self)
        for stdLineType in pp.std_types.available_std_types(self.net).index:
            self.standard_type.addItem(stdLineType)
        for availableBus in self.net.bus.index:
            self.from_bus.addItem(str(availableBus))
            self.to_bus.addItem(str(availableBus))
element_windows.py 文件源码 项目:pandapower_gui 作者: Tooblippe 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def initialize_window(self):
        uic.loadUi('resources/ui/add_load.ui', self)
        for availableBus in self.net.bus.index:
            self.bus.addItem(str(availableBus))
element_windows.py 文件源码 项目:pandapower_gui 作者: Tooblippe 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def initialize_window(self):
        uic.loadUi('resources/ui/add_bus.ui', self)
pandapower_gui.py 文件源码 项目:pandapower_gui 作者: Tooblippe 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, net, parent=None):
        super(runppOptions, self).__init__(parent=parent)
        uic.loadUi('resources/ui/runpp_options.ui', self)
        self.net = net
        self.inits = {"flat": self.InitFlat, "dc": self.InitDC, "results": self.InitResults,
                      "auto":self.InitAuto}
        self.algos = {"nr": self.NewtonRaphson, "bf": self.BackwardForward}
        self.voltage_angles = {True: self.VoltageAnglesTrue, False: self.VoltageAnglesFalse,
                               "auto": self.VoltageAnglesAuto}
        self.set_parameters(**self.net._runpp_options)
        self.ok_button.clicked.connect(partial(self.exit_window, True, False))
        self.cancel_button.clicked.connect(partial(self.exit_window, False, False))
        self.run_button.clicked.connect(partial(self.exit_window, True, True))
        self.show()
panels_management_window.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        uic.loadUi('ui/panels_management_window.ui', self)
        self.panel_list = []
        self.name_input.set_validator(api.validator.NAME)
        self.product_list.sortByColumn(0, QtCore.Qt.AscendingOrder)
        self.panel_content.sortByColumn(0, QtCore.Qt.AscendingOrder)

        self.create_panel_list()
        self.show()
mail_scheduler_window.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent):
        super().__init__(parent)
        uic.loadUi("ui/mail_scheduler_window.ui", self)
        self.filter_selector.set_filter_input(self.filter_input)
        self.build_mail_list()
        self.scheduled_mails_list.setCurrentRow(0)

        self.show()
mail_selector_window.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, parent, mails):
        super().__init__(parent)
        uic.loadUi("ui/mail_selector_window.ui", self)
        self.load_list(mails)
admin_stats_window.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self):
        super().__init__()
        uic.loadUi('ui/admin_stats_window.ui', self)
        nb_red, red = api.stats.get_red_sum()
        nb_green, green = api.stats.get_green_sum()
        self.red_label.setText("{:.2f} € ({})".format(red, nb_red))
        self.green_label.setText("{:.2f} € ({})".format(green, nb_green))
        self.total_label.setText("{:.2f} € ({})".format(green + red, nb_red + nb_green))
        self.ecocups_nb_label.setText(str(api.stats.get_ecocups_nb()))
        for note, value in api.stats.get_red_notes():
            QtWidgets.QTreeWidgetItem(self.red_notes, [note, "{:.2f}".format(value)])
        self.show()
load_mail_model_window.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self, parent):
        super().__init__(parent)
        uic.loadUi("ui/load_mail_model_window.ui", self)

        # Load model names from database.
        for model in api.mail.get_models():
            self.model_list.addItem(model['name'])


问题


面经


文章

微信
公众号

扫码关注公众号