當前位置: 首頁>>代碼示例>>Python>>正文


Python QMetaObject.connectSlotsByName方法代碼示例

本文整理匯總了Python中PySide.QtCore.QMetaObject.connectSlotsByName方法的典型用法代碼示例。如果您正苦於以下問題:Python QMetaObject.connectSlotsByName方法的具體用法?Python QMetaObject.connectSlotsByName怎麽用?Python QMetaObject.connectSlotsByName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PySide.QtCore.QMetaObject的用法示例。


在下文中一共展示了QMetaObject.connectSlotsByName方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_ui

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
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,代碼行數:30,代碼來源:loader.py

示例2: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
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,代碼行數:35,代碼來源:_pyside_dynamic.py

示例3: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
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,代碼行數:29,代碼來源:pyside_dynamic.py

示例4: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
    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,代碼行數:36,代碼來源:uic.py

示例5: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
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,代碼行數:9,代碼來源:uiloader.py

示例6: _loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
    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,代碼行數:58,代碼來源:binding_helper.py

示例7: __init__

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
 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,代碼行數:13,代碼來源:window_screenshot.py

示例8: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
    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,代碼行數:47,代碼來源:binding_helper.py

示例9: QtLoadUI

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
    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,代碼行數:39,代碼來源:QtVariant.py

示例10: Communicate

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
#     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,代碼行數:32,代碼來源:PySideUsing.py

示例11: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
def loadUi(uifile, baseinstance=None):
    loader = MyQUiLoader(baseinstance)
    ui = loader.load(uifile)
    QMetaObject.connectSlotsByName(ui)
    return ui
開發者ID:aviatorBeijing,項目名稱:ptpy,代碼行數:7,代碼來源:loadui.py

示例12: loadUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]
def loadUi(uifile, baseinstance=None):
    loader = UiLoader(baseinstance)
    widget = loader.load(uifile)
    QMetaObject.connectSlotsByName(widget)
    return widget
開發者ID:pszostek,項目名稱:cp,代碼行數:7,代碼來源:dtreeview.py

示例13: setupUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]

#.........這裏部分代碼省略.........

        #### 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,代碼行數:104,代碼來源:gui_gmailURLParser.py

示例14: initUI

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]

#.........這裏部分代碼省略.........
     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,代碼行數:104,代碼來源:huffgui.py

示例15: setupUi

# 需要導入模塊: from PySide.QtCore import QMetaObject [as 別名]
# 或者: from PySide.QtCore.QMetaObject import connectSlotsByName [as 別名]

#.........這裏部分代碼省略.........
        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,代碼行數:104,代碼來源:gui_IMAPLinkParser.py


注:本文中的PySide.QtCore.QMetaObject.connectSlotsByName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。