当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.QMetaObject类代码示例

本文整理汇总了Python中PySide.QtCore.QMetaObject的典型用法代码示例。如果您正苦于以下问题:Python QMetaObject类的具体用法?Python QMetaObject怎么用?Python QMetaObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QMetaObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: load_ui

def load_ui(uifile, baseinstance=None):
    """
    Dynamically load a user interface from the given ``uifile``.

    ``uifile`` is a string containing a file name of the UI file to load.

    If ``baseinstance`` is ``None``, the a new instance of the top-level widget
    will be created.  Otherwise, the user interface is created within the given
    ``baseinstance``.  In this case ``baseinstance`` must be an instance of the
    top-level widget class in the UI file to load, or a subclass thereof.  In
    other words, if you've created a ``QMainWindow`` interface in the designer,
    ``baseinstance`` must be a ``QMainWindow`` or a subclass thereof, too.  You
    cannot load a ``QMainWindow`` UI file with a plain
    :class:`~PySide.QtGui.QWidget` as ``baseinstance``.

    :method:`~PySide.QtCore.QMetaObject.connectSlotsByName()` is called on the
    created user interface, so you can implemented your slots according to its
    conventions in your widget class.

    Return ``baseinstance``, if ``baseinstance`` is not ``None``.  Otherwise
    return the newly created instance of the user interface.
    """
    loader = UiLoader(baseinstance)
    widget = loader.load(os.path.join(
        os.path.dirname(__file__), uifile,
    ))
    QMetaObject.connectSlotsByName(widget)
    return widget
开发者ID:igorer88,项目名称:series_list,代码行数:28,代码来源:loader.py

示例2: loadUi

def loadUi(uifile, baseinstance=None, package=None, resource_suffix=None):
    """
    Dynamically load a user interface from the given ``uifile``.

    ``uifile`` is a string containing a file name of the UI file to load.

    If ``baseinstance`` is ``None``, the a new instance of the top-level widget
    will be created.  Otherwise, the user interface is created within the given
    ``baseinstance``.  In this case ``baseinstance`` must be an instance of the
    top-level widget class in the UI file to load, or a subclass thereof.  In
    other words, if you've created a ``QMainWindow`` interface in the designer,
    ``baseinstance`` must be a ``QMainWindow`` or a subclass thereof, too.  You
    cannot load a ``QMainWindow`` UI file with a plain
    :class:`~PySide.QtGui.QWidget` as ``baseinstance``.

    :method:`~PySide.QtCore.QMetaObject.connectSlotsByName()` is called on the
    created user interface, so you can implemented your slots according to its
    conventions in your widget class.

    Return ``baseinstance``, if ``baseinstance`` is not ``None``. Otherwise
    return the newly created instance of the user interface.
    """
    if package is not None:
        _logger.warning(
            "loadUi package parameter not implemented with PySide")
    if resource_suffix is not None:
        _logger.warning(
            "loadUi resource_suffix parameter not implemented with PySide")

    loader = UiLoader(baseinstance, customWidgets=CUSTOM_WIDGETS)
    widget = loader.load(uifile)
    QMetaObject.connectSlotsByName(widget)
    return widget
开发者ID:dnaudet,项目名称:silx,代码行数:33,代码来源:_pyside_dynamic.py

示例3: loadUi

def loadUi(uifile, baseinstance=None, customWidgets=None):
    """
    Dynamically load a user interface from the given ``uifile``.
    ``uifile`` is a string containing a file name of the UI file to load.

    If ``baseinstance`` is ``None``, the a new instance of the top-level widget
    will be created.  Otherwise, the user interface is created within the given
    ``baseinstance``.  In this case ``baseinstance`` must be an instance of the
    top-level widget class in the UI file to load, or a subclass thereof. .

    ``customWidgets`` is a dictionary mapping from class name to class object
    for widgets that you've promoted in the Qt Designer interface. Usually,
    this should be done by calling registerCustomWidget on the QUiLoader, but
    with PySide 1.1.2 on Ubuntu 12.04 x86_64 this causes a segfault.

    :method:`~PySide.QtCore.QMetaObject.connectSlotsByName()` is called on the
    created user interface, so you can implemented your slots according to its
    conventions in your widget class.

    Return ``baseinstance``, if ``baseinstance`` is not ``None``.  Otherwise
    return the newly created instance of the user interface.
    """

    loader = UiLoader(baseinstance, customWidgets)
    widget = loader.load(uifile)
    QMetaObject.connectSlotsByName(widget)
    return widget
开发者ID:FedoraScientific,项目名称:salome-gui,代码行数:27,代码来源:pyside_dynamic.py

示例4: loadUi

    def loadUi(uifile, baseinstance=None, workingDirectory=None):
        """
        Dynamically load a user interface from the given ``uifile``.

        ``uifile`` is a string containing a file name of the UI file to load.

        If ``baseinstance`` is ``None``, the a new instance of the top-level
        widget will be created. Otherwise, the user interface is created within
        the given ``baseinstance``. In this case ``baseinstance`` must be an
        instance of the top-level widget class in the UI file to load, or a
        subclass thereof. In other words, if you've created a ``QMainWindow``
        interface in the designer, ``baseinstance`` must be a ``QMainWindow``
        or a subclass thereof, too. You cannot load a ``QMainWindow`` UI file
        with a plain :class:`~PySide.QtGui.QWidget` as ``baseinstance``.

        :method:`~PySide.QtCore.QMetaObject.connectSlotsByName()` is called on
        the created user interface, so you can implemented your slots according
        to its conventions in your widget class.

        Return ``baseinstance``, if ``baseinstance`` is not ``None``. Otherwise
        return the newly created instance of the user interface.
        """

        # We parse the UI file and import any required custom widgets
        customWidgets = _get_custom_widgets(uifile)

        loader = UiLoader(baseinstance, customWidgets)

        if workingDirectory is not None:
            loader.setWorkingDirectory(workingDirectory)

        widget = loader.load(uifile)
        QMetaObject.connectSlotsByName(widget)
        return widget
开发者ID:mlzharov,项目名称:pyzo,代码行数:34,代码来源:uic.py

示例5: loadUi

def loadUi(uifile, customWidgets=None, baseinstance=None):
    loader = UiLoader(baseinstance)
    for customWidget in customWidgets:
        loader.registerCustomWidget(customWidget)
    widget = loader.load(uifile)
    QMetaObject.connectSlotsByName(widget)
    return widget
开发者ID:pszostek,项目名称:cp,代码行数:7,代码来源:uiloader.py

示例6: _loadUi

    def _loadUi(uifile, baseinstance=None, custom_widgets=None):
        from PySide.QtUiTools import QUiLoader
        from PySide.QtCore import QMetaObject
        from PySide.QtGui import QDialog

        class CustomUiLoader(QUiLoader):
            class_aliases = {
                'Line': 'QFrame',
            }

            def __init__(self, baseinstance=None, custom_widgets=None):
                super(CustomUiLoader, self).__init__(baseinstance)
                self._base_instance = baseinstance
                self._custom_widgets = custom_widgets or {}

            def createWidget(self, class_name, parent=None, name=''):
                # don't create the top-level widget, if a base instance is set
                if self._base_instance and not parent:
                    return self._base_instance

                if class_name in self._custom_widgets:
                    widget = self._custom_widgets[class_name](parent)
                else:
                    widget = QUiLoader.createWidget(self, class_name, parent, name)

                if str(type(widget)).find(self.class_aliases.get(class_name, class_name)) < 0:
                    sys.modules['QtCore'].qDebug(
                            str('PySide.loadUi(): could not find widget '
                            'class "%s", defaulting to "%s"' % (
                                class_name, type(widget)))
                            )

                if self._base_instance:
                    setattr(self._base_instance, name, widget)

                return widget

        loader = CustomUiLoader(baseinstance, custom_widgets)

        # instead of passing the custom widgets, they should be registered
        # using QUiLoader.registerCustomWidget(),
        # but this does not work in PySide 1.0.6: it simply segfaults...
        #loader = CustomUiLoader(baseinstance)
        #custom_widgets = custom_widgets or {}
        #for custom_widget in custom_widgets.values():
        #    loader.registerCustomWidget(custom_widget)

        ui = loader.load(uifile)
        QMetaObject.connectSlotsByName(ui)
        # Workaround: PySide doesn't automatically center dialogs on their
        # parent windows
        if isinstance(baseinstance, QDialog) and (baseinstance.parentWidget() is not None):
            r = baseinstance.frameGeometry()
            r.moveCenter(baseinstance.parentWidget().frameGeometry().center())
            baseinstance.move(r.topLeft())
        return ui
开发者ID:imclab,项目名称:compoundpi,代码行数:56,代码来源:binding_helper.py

示例7: __init__

 def __init__(self, parent=None):
     QMainWindow.__init__(self, parent)
     central = QWidget(self)
     layout = QVBoxLayout(central)
     self.image_label = QLabel("here's the shot", central)
     layout.addWidget(self.image_label)
     self.button = QPushButton("Shoot me!", central)
     self.button.setObjectName("shot_button")
     layout.addWidget(self.button)
     self.setCentralWidget(central)
     QMetaObject.connectSlotsByName(self)
开发者ID:nickshiotelis,项目名称:snippets,代码行数:11,代码来源:window_screenshot.py

示例8: loadUi

    def loadUi(uifile, baseinstance=None, custom_widgets=None, verbose=True):
        from PySide.QtUiTools import QUiLoader
        from PySide.QtCore import QMetaObject

        class CustomUiLoader(QUiLoader):
            class_aliases = {
                'Line': 'QFrame',
            }

            def __init__(self, baseinstance=None, custom_widgets=None):
                super(CustomUiLoader, self).__init__(baseinstance)
                self._base_instance = baseinstance
                self._custom_widgets = custom_widgets or {}

            def createWidget(self, class_name, parent=None, name=''):
                # don't create the top-level widget, if a base instance is set
                if self._base_instance is not None and parent is None:
                    return self._base_instance

                if class_name in self._custom_widgets:
                    widget = self._custom_widgets[class_name](parent)
                else:
                    widget = QUiLoader.createWidget(self, class_name, parent, name)

                if str(type(widget)).find(self.class_aliases.get(class_name, class_name)) < 0:
                    if verbose:
                        sys.modules['QtCore'].qDebug(str('PySide.loadUi(): could not find widget class "%s", defaulting to "%s"' % (class_name, type(widget))))

                if self._base_instance is not None:
                    setattr(self._base_instance, name, widget)

                return widget

        loader = CustomUiLoader(baseinstance, custom_widgets)

        # instead of passing the custom widgets, they should be registered using QUiLoader.registerCustomWidget(),
        # but this does not work in PySide 1.0.6: it simply segfaults...
        #loader = CustomUiLoader(baseinstance)
        #custom_widgets = custom_widgets or {}
        #for custom_widget in custom_widgets.values():
        #    loader.registerCustomWidget(custom_widget)

        ui = loader.load(_ui_dir() + uifile)
        QMetaObject.connectSlotsByName(ui)
        return ui
开发者ID:Q-Leap-Networks,项目名称:pyside-segfault,代码行数:45,代码来源:binding_helper.py

示例9: QtLoadUI

    def QtLoadUI(uifile, baseinstance=None, custom_widgets=None):
        from PySide.QtUiTools import QUiLoader
        from PySide.QtCore import QMetaObject

        class CustomUiLoader(QUiLoader):
            class_aliases = {
                'Line': 'QFrame',
            }

            def __init__(self, baseinstance=None, custom_widgets=None):
                super(CustomUiLoader, self).__init__(baseinstance)
                self._base_instance = baseinstance
                self._custom_widgets = custom_widgets or {}

            def createWidget(self, class_name, parent=None, name=''):
                # don't create the top-level widget, if a base instance is set
                if self._base_instance and not parent:
                    return self._base_instance

                if class_name in self._custom_widgets:
                    widget = self._custom_widgets[class_name](parent)
                else:
                    widget = QUiLoader.createWidget(
                        self, class_name, parent, name)

                if str(type(widget)).find(self.class_aliases.get(class_name, class_name)) < 0:
                    sys.modules['QtCore'].qDebug(str('PySide.loadUi(): could not find widget class "%s", defaulting to "%s"' % (class_name, type(widget))))

                if self._base_instance:
                    setattr(self._base_instance, name, widget)

                return widget

        loader = CustomUiLoader(baseinstance, custom_widgets)
        widget = loader.load(uifile)
        QMetaObject.connectSlotsByName(widget)
        return widget
开发者ID:openlab-aux,项目名称:hamster,代码行数:37,代码来源:QtVariant.py

示例10: Communicate

#     limitations under the License.
#

# This test is using signals and will only work if PySide properly accepts
# compiled functions as callables.

from __future__ import print_function

from PySide.QtCore import Slot, Signal, QObject, QMetaObject

class Communicate(QObject):
    speak = Signal(int)
    def __init__(self,name='',parent = None):
        QObject.__init__(self,parent)
        self.setObjectName(name)

class Speaker(QObject):
    @Slot(int)
    def on_communicator_speak(self, stuff):
        print(stuff)

speaker = Speaker()
someone = Communicate(name='communicator',parent=speaker)

QMetaObject.connectSlotsByName(speaker)

print('The answer is:',end="")
# emit  'speak' signal
someone.speak.emit(42)
print('Slot should have made output by now.')
开发者ID:TheKK,项目名称:Nuitka,代码行数:30,代码来源:PySideUsing.py

示例11: loadUi

def loadUi(uifile, baseinstance=None):
    loader = MyQUiLoader(baseinstance)
    ui = loader.load(uifile)
    QMetaObject.connectSlotsByName(ui)
    return ui
开发者ID:aviatorBeijing,项目名称:ptpy,代码行数:5,代码来源:loadui.py

示例12: loadUi

def loadUi(uifile, baseinstance=None):
    loader = UiLoader(baseinstance)
    widget = loader.load(uifile)
    QMetaObject.connectSlotsByName(widget)
    return widget
开发者ID:pszostek,项目名称:cp,代码行数:5,代码来源:dtreeview.py

示例13: setupUi


#.........这里部分代码省略.........

        #### log_gbox
        self.log_gbox = QGroupBox(self.leftSplitter)
        self.log_gbox.setFlat(True)
        self.log_gbox.setObjectName("log_gbox")
        log_layout = QVBoxLayout(self.log_gbox)
        self.log_te = QTextEdit(self.log_gbox)
        self.log_te.setLineWrapMode(QTextEdit.NoWrap)
        self.log_te.setReadOnly(True)
        self.log_te.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
        self.log_te.setObjectName("log_te")

        self.disconnect_btn = QPushButton(self.log_gbox)
        self.disconnect_btn.setObjectName("disconnect_btn")
        self.disconnect_btn.hide()
        log_layout.addWidget(self.log_te)
        log_layout_btn = QHBoxLayout()
        log_layout.addLayout(log_layout_btn)
        log_layout_btn.addWidget(self.disconnect_btn)
        log_layout_btn.addStretch()

        #### links_gbox
        self.links_gbox = QGroupBox(self.mainSplitter)
        self.links_gbox.setFlat(True)
        self.links_gbox.setObjectName("links_gbox")
        self.links_gbox.hide()
        links_gbox_layout = QVBoxLayout(self.links_gbox)
        links_gbox_links_layout = QVBoxLayout()
        links_gbox_buttons_layout = QHBoxLayout()
        links_gbox_layout.addLayout(links_gbox_links_layout)
        links_gbox_layout.addLayout(links_gbox_buttons_layout)

        self.links_text_edit = QTextEdit(self.links_gbox)
        self.links_text_edit.setObjectName("links_text_edit")
        links_gbox_links_layout.addWidget(self.links_text_edit)

        self.export_txt_btn = QPushButton(self.links_gbox)
        self.export_txt_btn.setObjectName("export_txt_btn")
        self.export_txt_btn.setEnabled(False)
        self.export_html_btn = QPushButton(self.links_gbox)
        self.export_html_btn.setObjectName("export_html_btn")
        self.export_html_btn.setEnabled(False)

        links_gbox_buttons_layout.addWidget(self.export_txt_btn)
        links_gbox_buttons_layout.addWidget(self.export_html_btn)
        
        ### menubar
        self.menubar = QMenuBar(MainWindow)
        # self.menubar.setGeometry(QRect(0, 0, 860, 21))
        self.menubar.setObjectName("menubar")
        self.menu_file = QMenu(self.menubar)
        self.menu_file.setObjectName("menu_file")
        self.menu_help = QMenu(self.menubar)
        self.menu_help.setObjectName("menu_help")
        MainWindow.setMenuBar(self.menubar)
        self.action_about = QAction(MainWindow)
        self.action_about.setObjectName("action_about")
        self.action_About_Qt = QAction(MainWindow)
        self.action_About_Qt.setObjectName("action_About_Qt")
        self.action_exit = QAction(MainWindow)
        self.action_exit.setObjectName("action_exit")
        self.actionSave = QAction(MainWindow)
        self.actionSave.setObjectName("actionSave")
        self.action_Gmail_Advanced_Search_Syntax = QAction(MainWindow)
        self.action_Gmail_Advanced_Search_Syntax.setObjectName("action_Gmail_Advanced_Search_Syntax")
        self.menu_file.addAction(self.action_exit)
        self.menu_help.addAction(self.action_Gmail_Advanced_Search_Syntax)
        self.menu_help.addSeparator()
        self.menu_help.addAction(self.action_about)
        self.menu_help.addAction(self.action_About_Qt)
        self.menubar.addAction(self.menu_file.menuAction())
        self.menubar.addAction(self.menu_help.menuAction())
        
        self.retranslateUi(MainWindow)
        QMetaObject.connectSlotsByName(MainWindow)
        MainWindow.setTabOrder(self.client_secrets_file_path_le, self.client_secret_file_path_tBtn)
        MainWindow.setTabOrder(self.client_secret_file_path_tBtn, self.remove_account_btn)
        MainWindow.setTabOrder(self.remove_account_btn, self.add_account_btn)
        MainWindow.setTabOrder(self.add_account_btn, self.accounts_cb)
        MainWindow.setTabOrder(self.decryption_key_le, self.connect_btn)
        MainWindow.setTabOrder(self.connect_btn, self.log_te)
        MainWindow.setTabOrder(self.log_te, self.mailboxes_lw)
        MainWindow.setTabOrder(self.mailboxes_lw, self.after_date_cb)
        MainWindow.setTabOrder(self.after_date_cb, self.after_date_edit)
        MainWindow.setTabOrder(self.after_date_edit, self.before_date_cb)
        MainWindow.setTabOrder(self.before_date_cb, self.before_date_edit)
        MainWindow.setTabOrder(self.before_date_edit, self.from_le)
        MainWindow.setTabOrder(self.from_le, self.to_le)
        MainWindow.setTabOrder(self.to_le, self.subject_le)
        MainWindow.setTabOrder(self.subject_le, self.thread_count_sb)
        MainWindow.setTabOrder(self.thread_count_sb, self.html_radio)
        MainWindow.setTabOrder(self.html_radio, self.text_radio)
        MainWindow.setTabOrder(self.text_radio, self.search_btn)
        MainWindow.setTabOrder(self.search_btn, self.parameters_cb)
        MainWindow.setTabOrder(self.parameters_cb, self.parameters_le)
        MainWindow.setTabOrder(self.parameters_le, self.disconnect_btn)
        MainWindow.setTabOrder(self.disconnect_btn, self.links_text_edit)
        MainWindow.setTabOrder(self.links_text_edit, self.export_txt_btn)
        MainWindow.setTabOrder(self.export_txt_btn, self.export_html_btn)
        MainWindow.setTabOrder(self.export_html_btn, self.mailboxes_lw)
开发者ID:erdinc-me,项目名称:GmailURLParser,代码行数:101,代码来源:gui_gmailURLParser.py

示例14: initUI


#.........这里部分代码省略.........
     sizePolicy.setHorizontalStretch(0)
     sizePolicy.setVerticalStretch(0)
     sizePolicy.setHeightForWidth(
         self.compTable.sizePolicy().hasHeightForWidth())
     self.compTable.setSizePolicy(sizePolicy)
     self.compTable.setBaseSize(QSize(0, 0))
     font = QFont()
     font.setWeight(50)
     self.compTable.setFont(font)
     self.compTable.setEditTriggers(QAbstractItemView.NoEditTriggers)
     self.compTable.setShowGrid(True)
     self.compTable.setGridStyle(Qt.SolidLine)
     # lignes / colonnes
     self.compTable.setColumnCount(2)
     self.compTable.setRowCount(3)
     self.compTable.setVerticalHeaderItem(0, QTableWidgetItem("Taille (bits)"))
     self.compTable.setVerticalHeaderItem(1, QTableWidgetItem("Entropie"))
     self.compTable.setVerticalHeaderItem(2, QTableWidgetItem("Taille moy. (bits)"))
     for i in range(2):
         self.compTable.verticalHeaderItem(i).setTextAlignment(
             Qt.AlignRight)
     self.compTable.setHorizontalHeaderItem(0, QTableWidgetItem("ASCII"))
     self.compTable.setHorizontalHeaderItem(1, QTableWidgetItem("Huffman"))
     
     # nom des items
     self.compTabASCIIMem = QTableWidgetItem()
     self.compTable.setItem(0, 0, self.compTabASCIIMem)
     self.compTabASCIIEnt = QTableWidgetItem()
     self.compTable.setItem(1, 0, self.compTabASCIIEnt)
     self.compTabASCIIAvg = QTableWidgetItem()
     self.compTable.setItem(2, 0, self.compTabASCIIAvg)
     self.compTabHuffMem = QTableWidgetItem()
     self.compTable.setItem(0, 1, self.compTabHuffMem)
     self.compTabHuffEnt = QTableWidgetItem()
     self.compTable.setItem(1, 1, self.compTabHuffEnt)
     self.compTabHuffAvg = QTableWidgetItem()
     self.compTable.setItem(2, 1, self.compTabHuffAvg)
     # parem du tableau
     self.compTable.horizontalHeader().setCascadingSectionResizes(False)
     self.compTable.verticalHeader().setVisible(True)
     font = QFont("Mono", 8)
     self.compTable.setFont(font)
     compGrid.addWidget(self.compTable, 1, 0, 1, 1)
     self.analysGrid.addWidget(self.compGroup, 0, 0, 1, 1)
     mainGrid.addWidget(analysGroup, 0, 1, 1, 1)
     # -+++++++----------------- groupe du texte -----------------+++++++- #
     groupBox = QGroupBox(u"Texte", centralwidget)
     textGrid = QGridLayout(groupBox)
     # -+++++++------------- groupe du texte original ------------+++++++- #
     orgTextGroup = QGroupBox(u"Texte original (Ctrl+T)", groupBox)
     orgTextGrid = QGridLayout(orgTextGroup)
     self.orgText = QTextEdit(orgTextGroup)
     self.orgText.setPalette(self.defaultPalette)
     orgTextGrid.addWidget(self.orgText, 0, 0, 1, 1)
     textGrid.addWidget(orgTextGroup, 0, 0, 1, 2)
     # -+++++++------------ groupe du texte compressé ------------+++++++- #
     compressedTextGroup = QGroupBox(u"Texte compressé (Ctrl+H)", groupBox)
     compressedTextGrid = QGridLayout(compressedTextGroup)
     self.compressedText = QTextEdit(compressedTextGroup)
     self.compressedText.setPalette(self.defaultPalette)
     compressedTextGrid.addWidget(self.compressedText, 0, 0, 1, 1)
     textGrid.addWidget(compressedTextGroup, 1, 0, 1, 2)
     # -+++++++------------ groupe pour le texte ascii -----------+++++++- #
     asciiTextGroup = QGroupBox(u"Texte ASCII", groupBox)
     asciiTextGrid = QGridLayout(asciiTextGroup)
     self.asciiText = QTextBrowser(asciiTextGroup)
     self.asciiText.setPalette(self.defaultPalette)
     asciiTextGrid.addWidget(self.asciiText, 0, 0, 1, 1)
     textGrid.addWidget(asciiTextGroup, 2, 0, 1, 2)
     # -+++++++-------------------- label de log -----------------+++++++- #
     self.logLab = QLabel(analysGroup)
     textGrid.addWidget(self.logLab, 3, 0, 1, 2)
     # -+++++++----------- bouton pour encoder le texte ----------+++++++- #
     self.encodeBut = QPushButton(groupBox)
     self.encodeBut.setStatusTip(
         u"Cliquez sur ce bouton pour encoder le texte original.")
     self.encodeBut.setText(u"ENCODER")
     self.encodeBut.clicked.connect(self.encode_text)
     textGrid.addWidget(self.encodeBut, 4, 0, 1, 1)
     # -+++++++----------- bouton pour décoder le texte ----------+++++++- #
     self.decodeBut = QPushButton(groupBox)
     self.decodeBut.setStatusTip(
         u"Cliquez sur ce bouton pour décoder le texte compressé.")
     self.decodeBut.setText(u"DÉCODER")
     self.decodeBut.clicked.connect(self.decode_text)
     textGrid.addWidget(self.decodeBut, 4, 1, 1, 1)
     mainGrid.addWidget(groupBox, 0, 0, 1, 1)
     self.setCentralWidget(centralwidget)
     # -+++++++--------------- une barre de statut ---------------+++++++- #
     self.setStatusBar(QStatusBar(self))
     # -+++++++--------------------- le menu ---------------------+++++++- #
     self.fileMenu = QMenu(u"Fichier")
     self.fileMenu.addAction(u"Importer un texte...", self.open_text)
     self.fileMenu.addAction(
         u"Importer un texte encodé...", lambda: self.open_text(True))
     self.fileMenu.addAction(u"Importer un dictionnaire...", self.open_dict)
     self.fileMenu.addAction(u"Enregistrer le dictionnaire...", self.save_dict)
     self.fileMenu.addAction(u"Quitter", self.close)
     self.menuBar().addMenu(self.fileMenu)
     QMetaObject.connectSlotsByName(self)
开发者ID:mathieufrh,项目名称:huffmanwizard,代码行数:101,代码来源:huffgui.py

示例15: setupUi


#.........这里部分代码省略.........
        search_gbox_threads_layout.addWidget(self.search_btn)

        self.parameters_cb = QCheckBox(self.search_gbox)
        self.parameters_cb.setText("")
        self.parameters_cb.setObjectName("parameters_cb")
        self.parameters_le = QLineEdit(self.search_gbox)
        self.parameters_le.setEnabled(False)
        self.parameters_le.setObjectName("parameters_le")
        search_gbox_paramaters_layout.addWidget(self.parameters_cb)
        search_gbox_paramaters_layout.addWidget(self.parameters_le)

        # log_gbox
        self.log_gbox = QGroupBox(self.leftSplitter)
        self.log_gbox.setFlat(True)
        self.log_gbox.setObjectName("log_gbox")
        log_layout = QVBoxLayout(self.log_gbox)
        self.log_te = QTextEdit(self.log_gbox)
        self.log_te.setLineWrapMode(QTextEdit.NoWrap)
        self.log_te.setReadOnly(True)
        self.log_te.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
        self.log_te.setObjectName("log_te")

        self.disconnect_btn = QPushButton(self.log_gbox)
        self.disconnect_btn.setObjectName("disconnect_btn")
        self.disconnect_btn.hide()
        log_layout.addWidget(self.log_te)
        log_layout_btn = QHBoxLayout()
        log_layout.addLayout(log_layout_btn)
        log_layout_btn.addWidget(self.disconnect_btn)
        log_layout_btn.addStretch()

        # links_gbox
        self.links_gbox = QGroupBox(self.mainSplitter)
        self.links_gbox.setFlat(True)
        self.links_gbox.setObjectName("links_gbox")
        links_gbox_layout = QVBoxLayout(self.links_gbox)
        links_gbox_links_layout = QVBoxLayout()
        links_gbox_buttons_layout = QHBoxLayout()
        links_gbox_layout.addLayout(links_gbox_links_layout)
        links_gbox_layout.addLayout(links_gbox_buttons_layout)

        self.links_text_edit = QTextEdit(self.links_gbox)
        self.links_text_edit.setObjectName("links_text_edit")
        links_gbox_links_layout.addWidget(self.links_text_edit)

        self.export_txt_btn = QPushButton(self.links_gbox)
        self.export_txt_btn.setObjectName("export_txt_btn")
        self.export_txt_btn.setEnabled(False)
        self.export_html_btn = QPushButton(self.links_gbox)
        self.export_html_btn.setObjectName("export_html_btn")
        self.export_html_btn.setEnabled(False)

        links_gbox_buttons_layout.addWidget(self.export_txt_btn)
        links_gbox_buttons_layout.addWidget(self.export_html_btn)

        # menubar
        self.menubar = QMenuBar(MainWindow)
        self.menubar.setObjectName("menubar")
        self.menu_file = QMenu(self.menubar)
        self.menu_file.setObjectName("menu_file")
        self.menu_about = QMenu(self.menubar)
        self.menu_about.setObjectName("menu_about")
        MainWindow.setMenuBar(self.menubar)
        self.action_about = QAction(MainWindow)
        self.action_about.setObjectName("action_about")
        self.action_About_Qt = QAction(MainWindow)
        self.action_About_Qt.setObjectName("action_About_Qt")
        self.action_exit = QAction(MainWindow)
        self.action_exit.setObjectName("action_exit")
        self.actionSave = QAction(MainWindow)
        self.actionSave.setObjectName("actionSave")
        self.menu_file.addAction(self.action_exit)
        self.menu_about.addAction(self.action_about)
        self.menu_about.addAction(self.action_About_Qt)
        self.menubar.addAction(self.menu_file.menuAction())
        self.menubar.addAction(self.menu_about.menuAction())

        self.retranslateUi(MainWindow)
        QMetaObject.connectSlotsByName(MainWindow)
        MainWindow.setTabOrder(self.presets_cbox, self.imap_server_le)
        MainWindow.setTabOrder(self.imap_server_le, self.adress_le)
        MainWindow.setTabOrder(self.adress_le, self.pass_le)
        MainWindow.setTabOrder(self.pass_le, self.connect_btn)
        MainWindow.setTabOrder(self.connect_btn, self.log_te)
        MainWindow.setTabOrder(self.log_te, self.since_date_cb)
        MainWindow.setTabOrder(self.since_date_cb, self.since_date_edit)
        MainWindow.setTabOrder(self.since_date_edit, self.before_date_cb)
        MainWindow.setTabOrder(self.before_date_cb, self.before_date_edit)
        MainWindow.setTabOrder(self.before_date_edit, self.mailboxes_lw)
        MainWindow.setTabOrder(self.mailboxes_lw, self.from_le)
        MainWindow.setTabOrder(self.from_le, self.to_le)
        MainWindow.setTabOrder(self.to_le, self.subject_le)
        MainWindow.setTabOrder(self.subject_le, self.search_btn)
        MainWindow.setTabOrder(self.search_btn, self.links_text_edit)
        MainWindow.setTabOrder(self.links_text_edit, self.export_txt_btn)
        MainWindow.setTabOrder(self.export_txt_btn, self.export_html_btn)
        MainWindow.setTabOrder(self.export_html_btn, self.disconnect_btn)
        MainWindow.setTabOrder(self.disconnect_btn, self.add_preset_btn)
        MainWindow.setTabOrder(self.add_preset_btn, self.remove_preset_btn)
        MainWindow.setTabOrder(self.remove_preset_btn, self.ssl_cb)
开发者ID:erdinc-me,项目名称:IMAPLinkParser,代码行数:101,代码来源:gui_IMAPLinkParser.py


注:本文中的PySide.QtCore.QMetaObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。