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


Python KPushButton.sizeHint方法代碼示例

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


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

示例1: PointAndClick

# 需要導入模塊: from PyKDE4.kdeui import KPushButton [as 別名]
# 或者: from PyKDE4.kdeui.KPushButton import sizeHint [as 別名]
class PointAndClick(SettingsGroup):
    def __init__(self, page):
        super(PointAndClick, self).__init__(i18n("Point and Click"), page)

        layout = QHBoxLayout(self)
        self.button = KPushButton(i18n("Enable Point and Click"))
        self.button.setFixedSize(self.button.sizeHint())
        l = QLabel(
            i18n(
                "Click this button if Point and Click does not work. "
                "See Shift+F1 (What's This) for more information."
            )
        )
        l.setWordWrap(True)
        l.setWhatsThis(
            i18n(
                "On its first run, Frescobaldi tries to auto-configure Okular "
                "(which provides the PDF preview) to call Frescobaldi when a "
                "clickable object is clicked."
                "\n\n"
                "But this setting can get lost when you move Frescobaldi to a "
                "different location or when other applications reconfigure Okular."
                "\n\n"
                "Click this button to configure Frescobaldi as 'custom editor' "
                "inside Okular.  This works best when all instances of Okular are "
                "closed and the PDF preview has not yet been opened."
            )
        )
        self.button.setWhatsThis(l.whatsThis())
        self.button.clicked.connect(self.installOkularPartRC)
        layout.addWidget(self.button)
        layout.addWidget(l)

    def installOkularPartRC(self):
        import frescobaldi_app.install

        frescobaldi_app.install.installOkularPartRC()
        config("").writeEntry("configure okularpart", True)
        KMessageBox.information(
            self,
            i18n(
                "The Okular PDF preview has been reconfigured.\n\n"
                "If you already opened the PDF preview, "
                "restart Frescobaldi for the new settings to take effect."
            ),
        )
開發者ID:Alwnikrotikz,項目名稱:lilykde,代碼行數:48,代碼來源:settings.py


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