当前位置: 首页>>代码示例>>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;未经允许,请勿转载。