Python PyQt5.uic 模块,loadUi() 实例源码

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

项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = QGraphicsScene(0, 0, 711, 601)
        self.scene.win = self
        self.view.setScene(self.scene)
        self.image = QImage(710, 600, QImage.Format_Alpha8)
        self.image.fill(black)
        self.pen = QPen(black)
        self.draw.clicked.connect(lambda: draw(self))
        self.dial_x.valueChanged.connect(lambda: draw(self))
        self.dial_y.valueChanged.connect(lambda: draw(self))
        self.dial_z.valueChanged.connect(lambda: draw(self))
        self.funcs.addItem("cos(x) * sin(z)")
        self.funcs.addItem("2 * cos(x * z)")
        self.funcs.addItem("exp(sin(sqrt(x^2 + z^2)))")
        self.funcs.addItem("x^2 / 20 + z^2 / 20")
        self.funcs.addItem("|sin(x) * sin(z)|")
项目:TextStageProcessor    作者:mhyhre    | 项目源码 | 文件源码
def __init__(self, dirname, morph, configurations, parent):
        super().__init__()
        uic.loadUi('sources/DialogClassificationLib.ui', self)

        flags = Qt.Window | Qt.WindowSystemMenuHint | Qt.WindowMinimizeButtonHint | Qt.WindowMaximizeButtonHint | Qt.WindowCloseButtonHint
        self.setWindowFlags(flags)

        self.morph = morph
        self.configurations = configurations
        self.parent = parent
        self.input_dir = dirname
        self.lineEditInputDir.setText(dirname)

        self.profiler = Profiler()

        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.buttonClassify.clicked.connect(self.makeClassification)

        output_dir = self.configurations.get("output_files_directory", "output_files")

        self.calculator = ClassificationLibCalculator(self.input_dir, output_dir, morph, self.configurations)
        self.calculator.signals.Finished.connect(self.onCalculationFinish)
        self.calculator.signals.UpdateProgressBar.connect(self.onUpdateProgressBar)
        self.calculator.signals.PrintInfo.connect(self.onTextLogAdd)
        self.output_dir = configurations.get("output_files_directory", "output_files/classification") + "/"
项目:spyking-circus    作者:spyking-circus    | 项目源码 | 文件源码
def init_gui_layout(self):
        gui_fname = pkg_resources.resource_filename('circus',
                                                    os.path.join('qt_GUI',
                                                                 'qt_merge.ui'))
        if comm.rank == 0:
            self.ui = uic.loadUi(gui_fname, self)
            # print dir(self.ui)
            self.score_ax1 = self.ui.score_1.axes
            self.score_ax2 = self.ui.score_2.axes
            self.score_ax3 = self.ui.score_3.axes
            self.waveforms_ax  = self.ui.waveforms.axes
            self.detail_ax     = self.ui.detail.axes
            self.data_ax       = self.ui.data_overview.axes
            self.current_order = self.ui.cmb_sorting.currentIndex()
            self.mpl_toolbar = NavigationToolbar(self.ui.waveforms, None)
            self.mpl_toolbar.pan()
            self.ui.show()
        else:
            self.ui = None
项目:spyking-circus    作者:spyking-circus    | 项目源码 | 文件源码
def init_gui_layout(self):
        gui_fname = pkg_resources.resource_filename('circus',
                                                    os.path.join('qt_GUI',
                                                                 'qt_preview.ui'))
        self.ui = uic.loadUi(gui_fname, self)
        self.electrode_ax = self.ui.electrodes.axes
        self.data_x = self.ui.raw_data.axes
        if self.show_fit:
            self.ui.btn_next.clicked.connect(self.increase_time)
            self.ui.btn_prev.clicked.connect(self.decrease_time)
        else:
            self.ui.btn_next.setVisible(False)
            self.ui.btn_prev.setVisible(False)
        # Toolbar will not be displayed
        self.mpl_toolbar = NavigationToolbar(self.ui.raw_data, None)
        self.mpl_toolbar.pan()
        self.ui.show()
项目:runnix    作者:TheInitializer    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QMainWindow.__init__(self)

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

        self.plainTextEdit.appendPlainText("Microsoft Windows (Version 10.0.10240)")
        self.plainTextEdit.appendPlainText("(c) 2015 Microsoft Corporation. All rights reserved. \n")

        self.plainTextEdit.appendPlainText("C:\\> ")

        self.plainTextEdit.installEventFilter(self)

        self.editable = True
        self.keys = []
        self.lolnope = []
项目:pipeline    作者:liorbenhorin    | 项目源码 | 文件源码
def _pyqt5():
    import PyQt5.Qt
    from PyQt5 import QtCore, QtWidgets, uic

    _remap(QtCore, "Signal", QtCore.pyqtSignal)
    _remap(QtCore, "Slot", QtCore.pyqtSlot)
    _remap(QtCore, "Property", QtCore.pyqtProperty)

    _add(PyQt5, "__binding__", PyQt5.__name__)
    _add(PyQt5, "load_ui", lambda fname: uic.loadUi(fname))
    _add(PyQt5, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, n)))
    _add(PyQt5,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PyQt5)

    return PyQt5
项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = Scene(0, 0, 561, 581)
        self.scene.win = self
        self.view.setScene(self.scene)
        self.image = QImage(561, 581, QImage.Format_ARGB32_Premultiplied)
        self.image.fill(Qt.white)
        self.bars.clicked.connect(lambda : set_bars(self))
        self.erase.clicked.connect(lambda: clean_all(self))
        self.paint.clicked.connect(lambda: clipping(self))
        self.rect.clicked.connect(lambda: set_rect(self))
        self.ect.clicked.connect(lambda: add_bars(self))
        self.lock.clicked.connect(lambda: lock(self))
        self.lines = []
        self.edges = []
        self.clip = None
        self.point_now_rect = None
        self.point_now_bars = None
        self.point_lock = None
        self.input_bars = False
        self.input_rect = False
        self.pen = QPen(black)
项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = myScene(0, 0, 561, 581)
        self.scene.win = self
        self.view.setScene(self.scene)
        self.image = QImage(561, 581, QImage.Format_ARGB32_Premultiplied)
        self.image.fill(col_zero)
        self.lock.clicked.connect(lambda: lock(self))
        self.erase.clicked.connect(lambda: clean_all(self))
        self.paint.clicked.connect(lambda: fill_xor(self))
        self.addpoint.clicked.connect(lambda: add_point_by_btn(self))
        self.edges = []
        self.point_now = None
        self.point_lock = None
        self.pen = QPen(col_one)
        self.delay.setChecked(False)
项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = Scene(0, 0, 561, 581)
        self.scene.win = self
        self.view.setScene(self.scene)
        self.poly.clicked.connect(lambda : set_pol(self))
        self.erase.clicked.connect(lambda: clean_all(self))
        self.paint.clicked.connect(lambda: clipping(self))
        self.rect.clicked.connect(lambda: set_rect(self))
        self.ect.clicked.connect(lambda: add_bars(self))
        self.lock.clicked.connect(lambda: lock(self))
        self.clip = []
        self.pol = []
        self.point_now_clip = None
        self.point_now_pol = None
        self.point_lock_pol = None
        self.point_lock_clip = None
        self.input_pol = False
        self.input_clip = False
        self.pen = QPen(black)
项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = myScene(0, 0, 561, 581)
        self.scene.win = self
        self.view.setScene(self.scene)
        self.image = QImage(561, 581, QImage.Format_ARGB32_Premultiplied)
        self.image.fill(col_zero)
        self.lock.clicked.connect(lambda: lock(self))
        self.erase.clicked.connect(lambda: clean_all(self))
        self.paint.clicked.connect(lambda: fill_with_seed(self))
        self.addpoint.clicked.connect(lambda: add_point_by_btn(self))
        self.pixel.clicked.connect(lambda: set_flag_zat(self))
        self.addcircle.clicked.connect(lambda: set_flag_cir(self))
        self.edges = []
        self.point_now = None
        self.point_lock = None

        self.pen = QPen(col_one)
        self.delay.setChecked(False)
项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
def __init__(self):
        QtWidgets.QWidget.__init__(self)
        uic.loadUi("window.ui", self)
        self.scene = Scene(0, 0, 561, 581)
        self.scene.win = self
        self.view.setScene(self.scene)
        self.image = QImage(561, 581, QImage.Format_ARGB32_Premultiplied)
        self.image.fill(Qt.white)
        self.bars.clicked.connect(lambda : set_bars(self))
        self.erase.clicked.connect(lambda: clean_all(self))
        self.paint.clicked.connect(lambda: clipping(self))
        self.rect.clicked.connect(lambda: set_rect(self))
        self.ect.clicked.connect(lambda: add_bars(self))
        self.lines = []
        self.clip = None
        self.point_now = None
        self.input_bars = False
        self.input_rect = False
        self.pen = QPen(red)
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
def __init__(self):
        super().__init__()
        uic.loadUi('ui/users_management_window.ui', self)

        self.delete_button.clicked.connect(self.delete)
        self.rights = {
            'manage_users': self.manage_users,
            'manage_products': self.manage_products,
            'manage_notes': self.manage_notes,
        }

        # This variable allows us to not save user rights during user selcection
        # because checkboxes send the changed signal on every setChecked call
        self.updating = True
        try:
            self.selected = self.user_list.widgets[0]
            self.update_form()
        except IndexError:
            self.selected = None
            self.set_form_checkable(False)
        self.updating = False

        self.show()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
def __init__(self):
        super().__init__()
        uic.loadUi('ui/about_window.ui', self)
        self.show()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
def __init__(self, path):
        super().__init__()
        uic.loadUi('ui/csv_import_window.ui', self)
        self.file_path = path
        self.notes = []
        self.on_change = lambda: False

        # It is possible to validate multiple times without that
        self.validated = False

        self.amount.setValidator(api.validator.NUMBER)
        self.reason.setValidator(api.validator.NAME)
        self.recap.header().setStretchLastSection(False)
        self.recap.header().setSectionResizeMode(1,
            QtWidgets.QHeaderView.Stretch)
        try:
            self._build_recap()
        except KeyError:
            gui.utils.error("Erreur", "Le fichier CSV fourni est mal formé")
            raise csv.Error
        else:
            self.show()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super().__init__(parent)
        uic.loadUi('ui/products_management_window.ui', self)
        self.tab_manage_categories.on_change = self.on_change
        self.tab_manage_consumptions.on_change = self.on_change
        self.groupBox.on_change = self.on_change
        self.input_cat.set_validator(api.validator.NAME)
        self.input_product.set_validator(api.validator.NAME)
        self.name_input.set_validator(api.validator.NAME)
        self.percentage_input.set_validator(api.validator.NUMBER)

        self.category = None
        self.products.build()
        self.products.sortByColumn(0, QtCore.Qt.AscendingOrder)
        self.color_picker = QtWidgets.QColorDialog(self)
        self.win = None
        self.tabs.currentChanged.connect(self.products.rebuild)
        self.show()
项目:SiebenApp    作者:ahitrin    | 项目源码 | 文件源码
def main(root_script):
    parser = ArgumentParser()
    parser.add_argument('--devel', '-d', action='store_true', default=False,
                        help='Run in developer mode (affects GUI behavior)')
    parser.add_argument('db', nargs='?', default=DEFAULT_DB,
                        help='Path to the database file (sieben.db by default)')
    args = parser.parse_args()
    app = QApplication(sys.argv)
    root = dirname(realpath(root_script))
    if args.devel:
        w = loadUi(join(root, 'ui', 'main-devel.ui'), SiebenAppDevelopment(args.db))
    else:
        w = loadUi(join(root, 'ui', 'main.ui'), SiebenApp(args.db))
    w.use_dot = not args.devel
    w.about = loadUi(join(root, 'ui', 'about.ui'))
    w.setup()
    w.showMaximized()
    sys.exit(app.exec_())
项目:pyblish-starter    作者:pyblish    | 项目源码 | 文件源码
def pyqt5():
    import PyQt5.Qt
    from PyQt5 import QtCore, uic

    remap(QtCore, "Signal", QtCore.pyqtSignal)
    remap(QtCore, "Slot", QtCore.pyqtSlot)
    remap(QtCore, "Property", QtCore.pyqtProperty)

    add(PyQt5, "__wrapper_version__", __version__)
    add(PyQt5, "__binding__", "PyQt5")
    add(PyQt5, "__binding_version__", QtCore.PYQT_VERSION_STR)
    add(PyQt5, "__qt_version__", QtCore.QT_VERSION_STR, safe=False)
    add(PyQt5, "__added__", __added__)
    add(PyQt5, "__remapped__", __remapped__)
    add(PyQt5, "__modified__", __modified__)
    add(PyQt5, "load_ui", lambda fname: uic.loadUi(fname))

    return PyQt5
项目:TextStageProcessor    作者:mhyhre    | 项目源码 | 文件源码
def __init__(self, filenames, morph, configurations, parent):
        super().__init__()
        uic.loadUi('sources/DialogDecomposeAndRuleApply.ui', self)

        flags = Qt.Window | Qt.WindowSystemMenuHint | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint;
        self.setWindowFlags(flags)

        self.filenames = filenames
        self.morph = morph
        self.configurations = configurations
        self.parent = parent

        self.profiler = Profiler()

        self.nu = []
        self.ns = []
        self.nv = []
        self.all_idf_word_keys = []
        self.texts = []

        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)

        self.buttonProcess.clicked.connect(self.process)
        self.textEdit.setText("")
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.dBCommandLineHelper = DBCommandLineHelper()
        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, 'add_case.ui')
        uic.loadUi(ui_file_path, self)

        screen = QDesktopWidget().screenGeometry()
        self.resize(screen.width() / 5 * 2, screen.height() / 5 * 2)

        self.search_button = SearchButton()
        self.tag_names_line_edit = TagLineEdit("tag_names_line_edit", self.search_button)
        self.tag_names_line_edit_adapter()
        self.tag_list = None

        self.result_widget = RunnerTableWidget(self.dBCommandLineHelper.query_case_all(), [])
        self.result_table_layout.insertWidget(0, self.result_widget)

        self.message_box = QMessageBox()

        self.search_button.clicked.connect(self.search_event)
        self.selectcasebtn.clicked.connect(self.select_event)
        self.casecancelbtn.clicked.connect(self.close)
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.devices_radio_buttons = []
        self.data_count = None
        self.selected_data_number = 0  # init data number, '0' refer to all data
        self.selected_device_list = []

        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, 'add_device.ui')
        uic.loadUi(ui_file_path, self)

        screen = QDesktopWidget().screenGeometry()
        self.resize(screen.width() / 6, screen.height() / 6)

        self.all_data_selected = True
        self.line_number_line_edit.hide()

        self.select_device_btn.clicked.connect(self.select_event)
        self.cancel_device_btn.clicked.connect(self.close)
        self.all_radio_btn.clicked.connect(self.data_all_radio_event)
        self.line_number_radio_btn.clicked.connect(self.data_specified_radio_event)

        self.message_box = QMessageBox()
        self.devices_list = []
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, message, *args, **kwargs):
        super().__init__(*args, **kwargs)
        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, 'report_detail.ui')
        uic.loadUi(ui_file_path, self)
       # self.message = eval(message)
        scroll_area = QScrollArea()
        message_label = QLabel()
        # message_label.setWordWrap(True)
        # message_label_text = ''
        # for key, value in self.message.items():
        #     message_label_text += "{} :\n{}\n".format(key, value)
        # message_label.setText(message_label_text)
        message_label.setText(message)
        scroll_area.setWidget(message_label)
        self.main_layout.addWidget(scroll_area)
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, parent=None):
        super(CompleterWidget, self).__init__(parent)

        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, 'completer_widget.ui')
        uic.loadUi(ui_file_path, self)

        self.setWindowFlags(Qt.FramelessWindowHint | Qt.Tool)

        self.func_list_widget = QListWidget()
        self.func_list_widget.setFixedWidth(200)
        self.func_list_widget.setSizeAdjustPolicy(QListWidget.AdjustToContents)
        self.func_list_layout.insertWidget(0, self.func_list_widget)
        self.desc_text_browser.setSizeAdjustPolicy(QTextBrowser.AdjustToContents)

        self.func_list_widget.setFocusPolicy(Qt.NoFocus)
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, refresh_signal, conflict_tags_message_dict, case_data_manager, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.refresh_signal = refresh_signal
        self.case_data_manager = case_data_manager
        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, "conflict_tag.ui")
        uic.loadUi(ui_file_path, self)
        self.setWindowTitle("conflict tag")
        self.conflict_tags_message_dict = conflict_tags_message_dict
        self.set_conflict_tags_table_widget()

        config = Config()
        image = QImage(os.path.join(config.images, 'notice.png'))
        result = image.scaled(40, 40)
        self.notice_image_label.setPixmap(QPixmap.fromImage(result))
        self.notice_image_label.setAlignment(Qt.AlignCenter)
        self.notice_text_label.setText(
            '?????????\n'
            '1???????????????????????????????\n'
            '2???????????????')  # todo ??????
        self.conflict_tags_submit_button.clicked.connect(self.conflict_tags_submit)
        self.button_style(self.conflict_tags_submit_button)
        self.cancel_submit_button.clicked.connect(self.cancel_submit)
        self.button_style(self.cancel_submit_button)
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, refresh_signal, tag_name=None, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.refresh_signal = refresh_signal
        self.db_helper = DBCommandLineHelper()
        ui_dir_path = os.path.dirname(__file__)
        ui_file_path = os.path.join(ui_dir_path, 'tag_editor.ui')
        uic.loadUi(ui_file_path, self)
        # set icon
        save_icon = QIcon()
        config = Config()
        save_icon.addPixmap(QPixmap(config.images + '/save.png'), QIcon.Normal, QIcon.Off)
        self.tag_save_btn.setIcon(save_icon)
        self.tag_save_btn.clicked.connect(self.tag_save)
        self.tag_id_line_edit.hide()  # ??line_edit
        self.tag_name_line_edit.setPlaceholderText("Tag Name")  # ??????
        self.tag_description_text_edit.setPlaceholderText('Tag Description')
        if tag_name:
            self.tag = self.db_helper.query_tag_by_name(tag_name)
            self.tag_id_line_edit.setText(str(self.tag.id))
            self.tag_name_line_edit.setText(self.tag.name)
            self.tag_description_text_edit.setPlainText(self.tag.description)
            # self.tag_description_text_edit.setDocument(QTextDocument("Tag description"))  # ??????
项目:desktop-stream-viewer    作者:AbiosGaming    | 项目源码 | 文件源码
def show_settings(self):
        """Shows a dialog containing settings for DSW"""
        self.dialog = QDialog(self)
        self.dialog.ui = uic.loadUi(SETTINGS_UI_FILE, self.dialog)
        self.dialog.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.dialog.findChild(QtCore.QObject, BUTTONBOX) \
            .accepted.connect(self.generate_conf)
        if cfg[CONFIG_BUFFER_STREAM]:
            self.dialog.findChild(QtCore.QObject, RECORD_SETTINGS).setChecked(True)
        if cfg[CONFIG_MUTE]:
            self.dialog.findChild(QtCore.QObject, MUTE_SETTINGS).setChecked(True)
        self.dialog.findChild(QtCore.QObject, QUALITY_SETTINGS) \
            .setText(CONFIG_QUALITY_DELIMITER_JOIN.join(cfg[CONFIG_QUALITY]))
        self.dialog.findChild(QtCore.QObject, BUFFER_SIZE).setValue(cfg[CONFIG_BUFFER_SIZE])
        self.dialog.show()
项目:DCheat    作者:DCheat    | 项目源码 | 文件源码
def __init__(self, parentUi, sock, multiprocess, messgae, parent=None):
        QtWidgets.QDialog.__init__(self, parent)
        self.ui = uic.loadUi(config.config.ROOT_PATH +'view/closePopup.ui', self)

        self.parentUi = parentUi
        self.sock = sock
        self.mp = multiprocess
        self.closeMessage = "??? ???????.\n %d? ? ?????."
        self.message = messgae
        self.count = 10

        self.ui.label.setText(self.closeMessage % (self.count))

        self.timer = QTimer(self)
        self.timer.timeout.connect(self.message_display)
        self.timer.start(1100)

        self.ui.show()
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
def __init__(self, app, parent, user, name):
        """
        The widget within each tab of TabWindow, a display
        for new private messages and user input
        """
        super(__class__, self).__init__()
        uic.loadUi(app.theme["ui_path"] + "/PrivateMessageWidget.ui", self)
        self.user = user
        self.app = app
        self.parent = parent

        # setattr(user, "display_name", friend)
        self.userLabel.setText(name.join(["::", "::"]))
        self.sendButton.clicked.connect(self.send)
        self.userOutput.setReadOnly(True)
        self.userOutput.setMouseTracking(True)
        self.userOutput.anchorClicked.connect(self.anchorClicked)
        self.userOutput.setOpenLinks(False)

        if not isinstance(user, discord.PrivateChannel):
                self.display_text(fmt_begin_msg(app, self.app.client.user, user.user if not isinstance(user, discord.User) else user))
        ensure_future(self.get_logs())
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
def __init__(self, app, parent, user):
        """
        A window for storing PrivateMessageWidget instances, a navigation
        between current private message users
        """
        super(__class__, self).__init__()
        self.parent = parent
        self.app = app
        uic.loadUi(app.theme["ui_path"] + "/TabWindow.ui", self)
        self.users = []
        self.ids = []
        self.init_user = self.add_user(user)
        self.tabWidget.removeTab(0)  # Remove two default tabs
        self.tabWidget.removeTab(0)
        self.tabWidget.setTabsClosable(True)
        self.tabWidget.tabCloseRequested.connect(self.closeTab)
        self.setWindowTitle("Private Message")
        self.setWindowIcon(QIcon(app.theme["path"] + "/trayicon.png"))
        self.show()
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
def __init__(self, app, parent):
        super(__class__, self).__init__()
        uic.loadUi(app.theme["ui_path"] + "/MemoWindow.ui", self)
        self.app = app
        self.parent = parent
        self.setWindowTitle('Memos')
        self.setWindowIcon(QIcon(app.theme["path"] + "/trayicon.png"))
        width = self.frameGeometry().width()
        height = self.frameGeometry().height()
        self.setFixedSize(width, height)
        self.memosTableWidget.setColumnCount(2)
        self.memosTableWidget.setHorizontalHeaderLabels(["Memo", "Users"])
        self.memosTableWidget.doubleClicked.connect(self.openMemo)
        header = self.memosTableWidget.horizontalHeader()
        header.setSectionResizeMode(QHeaderView.Stretch)
        self.ctr = 0
        self.servers = dict()
        self.open = dict()
        for server in self.app.client.servers:
            self.servers[server.name] = server
            self.add_channel(server.name, len(server.members))
        self.memosTableWidget.sortItems(0)

        self.show()
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
def __init__(self, app, parent, memo):
        """
        A window for storing PrivateMessageWidget instances, a navigation
        between current private message users
        """
        super(__class__, self).__init__()
        self.parent = parent
        self.app = app
        uic.loadUi(app.theme["ui_path"] + "/MemoTabWindow.ui", self)
        self.memo = memo
        self.channels = list(filter(lambda x: x.type is discord.ChannelType.text and x.permissions_for(x.server.me).read_messages, self.memo.channels))
        self.channels.sort(key=lambda server: server.name)
        self.tabWidget.removeTab(0)  # Remove two default tabs
        self.tabWidget.removeTab(0)
        self.setWindowTitle("Memos")
        self.setWindowIcon(QIcon(self.app.theme["path"] + "/memo.png"))
        for channel in self.channels:
            self.add_memo(channel)

        self.add_user_items()

        self.show()
        playsound(os.path.join(self.app.theme["path"], "alarm2.wav"), block=False)
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
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_()
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
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()
项目:Pesterchum-Discord    作者:henry232323    | 项目源码 | 文件源码
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
项目:urh    作者:jopohl    | 项目源码 | 文件源码
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    作者:TheInitializer    | 项目源码 | 文件源码
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    作者:stoic1979    | 项目源码 | 文件源码
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"])
项目:cmt    作者:chadmv    | 项目源码 | 文件源码
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)
项目:cmt    作者:chadmv    | 项目源码 | 文件源码
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)
项目:Computer-graphics    作者:Panda-Lewandowski    | 项目源码 | 文件源码
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)
项目:Speaker_recognition    作者:Mgajurel    | 项目源码 | 文件源码
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)
项目:urban-journey    作者:urbanjourney    | 项目源码 | 文件源码
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)
项目:pandapower_gui    作者:Tooblippe    | 项目源码 | 文件源码
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))
项目:pandapower_gui    作者:Tooblippe    | 项目源码 | 文件源码
def initialize_window(self):
        uic.loadUi('resources/ui/add_load.ui', self)
        for availableBus in self.net.bus.index:
            self.bus.addItem(str(availableBus))
项目:pandapower_gui    作者:Tooblippe    | 项目源码 | 文件源码
def initialize_window(self):
        uic.loadUi('resources/ui/add_bus.ui', self)
项目:pandapower_gui    作者:Tooblippe    | 项目源码 | 文件源码
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()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
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()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
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()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
def __init__(self, parent, mails):
        super().__init__(parent)
        uic.loadUi("ui/mail_selector_window.ui", self)
        self.load_list(mails)
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
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()
项目:Enibar    作者:ENIB    | 项目源码 | 文件源码
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'])