本文整理汇总了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()
示例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 ""