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


Python KApplication.desktop方法代码示例

本文整理汇总了Python中PyKDE4.kdeui.KApplication.desktop方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.desktop方法的具体用法?Python KApplication.desktop怎么用?Python KApplication.desktop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyKDE4.kdeui.KApplication的用法示例。


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

示例1: initUI

# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import desktop [as 别名]
    def initUI(self):
	global config
        backupTitle = QtGui.QLabel('Backup Volume:')
        self.backupVolumeTitle = QtGui.QLabel(config.backupName)
	self.manageBackupButton = QtGui.QPushButton('Manage Backup Volumes')
	self.managePathsButton = QtGui.QPushButton('Manage Sync Paths')
	
        toplevel = QtGui.QHBoxLayout()
        toplevel.addWidget(backupTitle)
        toplevel.addWidget(self.backupVolumeTitle)
        toplevel.addWidget(self.manageBackupButton)
        
        secondlevel = QtGui.QHBoxLayout()
        progressTitle = QtGui.QLabel('Syncing Progress:')
        self.progressDetail = QtGui.QLabel('Stopped.')
        secondlevel.addWidget(progressTitle)
        secondlevel.addWidget(self.progressDetail)
        secondlevel.addWidget(self.managePathsButton)
        
        gridv = QtGui.QVBoxLayout()
        gridv.addLayout(toplevel)
        gridv.addLayout(secondlevel)
        self.setLayout(gridv)
        self.setWindowTitle("Backup2isp")
        self.move( KApplication.desktop().screen().rect().center() - self.rect().center() )
	self.manageBackupButton.connect(self.manageBackupButton, QtCore.SIGNAL("clicked()"), self.manageBackups)
	self.managePathsButton.connect(self.managePathsButton, QtCore.SIGNAL("clicked()"), self.managePaths)
        self.beginBackup()
开发者ID:sarahcitrus,项目名称:backup2isp,代码行数:30,代码来源:backup2isp.py

示例2: __init__

# 需要导入模块: from PyKDE4.kdeui import KApplication [as 别名]
# 或者: from PyKDE4.kdeui.KApplication import desktop [as 别名]

#.........这里部分代码省略.........
                            __license__,
                            "), by ",
                            __author__,
                            ", ( ",
                            __email__,
                            " )",
                            linesep,
                        )
                    ),
                )
            )
        qafnt = QAction(QIcon.fromTheme("tools-check-spelling"), "Set GUI Font", self)
        if KDE:
            font = QFont()
            qafnt.triggered.connect(
                lambda: self.setStyleSheet(
                    "".join(("*{font-family:", str(font.toString()), "}"))
                    if KFontDialog.getFont(font)[0] == QDialog.Accepted
                    else ""
                )
            )
        else:
            qafnt.triggered.connect(
                lambda: self.setStyleSheet("".join(("*{font-family:", str(QFontDialog.getFont()[0].toString()), "}")))
            )
        qasrc = QAction(QIcon.fromTheme("applications-development"), "View Source Code", self)
        qasrc.triggered.connect(lambda: call("xdg-open {}".format(__file__), 1))
        qakb = QAction(QIcon.fromTheme("input-keyboard"), "Keyboard Shortcuts", self)
        qakb.triggered.connect(
            lambda: QMessageBox.information(self.mainwidget, "Keyboard Shortcuts", " Ctrl+Q = Quit ")
        )
        qapic = QAction(QIcon.fromTheme("camera-photo"), "Take a Screenshot", self)
        qapic.triggered.connect(
            lambda: QPixmap.grabWindow(QApplication.desktop().winId()).save(
                QFileDialog.getSaveFileName(
                    self.mainwidget, " Save Screenshot As ...", path.expanduser("~"), ";;(*.png) PNG", "png"
                )
            )
        )
        qatb = QAction(QIcon.fromTheme("go-top"), "Toggle ToolBar", self)
        qatb.triggered.connect(lambda: self.toolbar.hide() if self.toolbar.isVisible() is True else self.toolbar.show())
        qati = QAction(QIcon.fromTheme("help-browser"), "Switch ToolBar Icon Size", self)
        qati.triggered.connect(
            lambda: self.toolbar.setIconSize(self.toolbar.iconSize() * 4)
            if self.toolbar.iconSize().width() * 4 == 24
            else self.toolbar.setIconSize(self.toolbar.iconSize() / 4)
        )
        qasb = QAction(QIcon.fromTheme("zoom-in"), "Toggle Tabs Bar", self)
        qasb.triggered.connect(
            lambda: self.mainwidget.tabBar().hide()
            if self.mainwidget.tabBar().isVisible() is True
            else self.mainwidget.tabBar().show()
        )
        qadoc = QAction(QIcon.fromTheme("help-browser"), "On-line Docs", self)
        qadoc.triggered.connect(lambda: open_new_tab(__url__))
        qapy = QAction(QIcon.fromTheme("help-about"), "About Python", self)
        qapy.triggered.connect(lambda: open_new_tab("http://python.org/about"))
        qali = QAction(QIcon.fromTheme("help-browser"), "Read Licence", self)
        qali.triggered.connect(lambda: open_new_tab(__full_licence__))
        qacol = QAction(QIcon.fromTheme("preferences-system"), "Set GUI Colors", self)
        if KDE:
            color = QColor()
            qacol.triggered.connect(
                lambda: self.setStyleSheet("".join(("* { background-color: ", str(color.name()), "}")))
                if KColorDialog.getColor(color, self)
                else ""
开发者ID:juancarlospaco,项目名称:pyqt_app_template,代码行数:70,代码来源:pyqt_app_template.py


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