本文整理汇总了Python中kdecore.KApplication.setMainWidget方法的典型用法代码示例。如果您正苦于以下问题:Python KApplication.setMainWidget方法的具体用法?Python KApplication.setMainWidget怎么用?Python KApplication.setMainWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kdecore.KApplication
的用法示例。
在下文中一共展示了KApplication.setMainWidget方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
def main():
"""Main program."""
description = str(i18n("Simple log file viewer"))
version = "0.3"
about = KAboutData("lovi", "lovi", version, description,
KAboutData.License_GPL, "Copyright (C) 2005-2006 by Akos Polster")
about.addAuthor("Akos Polster", "", "[email protected]")
KCmdLineArgs.init(sys.argv, about)
KCmdLineArgs.addCmdLineOptions([("+files", "Files to monitor")])
app = KApplication()
mainWindow = MainWin(None, "lovi#")
app.setMainWidget(mainWindow)
# Get list of monitored files from the command line or from the cfg file
args = KCmdLineArgs.parsedArgs()
if args.count() > 0:
for i in range(0, args.count()):
mainWindow.monitor(args.arg(i))
else:
cfg = app.config()
cfg.setGroup("Monitor")
files = cfg.readListEntry("files")
for f in files:
mainWindow.monitor(str(f))
mainWindow.show()
app.exec_loop()
示例2: main
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
def main():
aboutData = KAboutData(
PACKAGE, PROGRAMNAME, VERSION,
I18N_NOOP("LilyKDE servicemenu helper"),
KAboutData.License_GPL,
"Copyright (c) 2008, " + AUTHOR,
"", HOMEPAGE)
KCmdLineArgs.init (sys.argv, aboutData)
KCmdLineArgs.addCmdLineOptions([
("+files", I18N_NOOP("LilyPond files to convert"))
])
app = KApplication()
log = LogWidget()
app.setMainWidget(log)
log.setMinimumHeight(240)
log.setMinimumWidth(400)
log.setCaption(PROGRAMNAME)
log.show()
# get the files to convert
pa = KCmdLineArgs.parsedArgs()
files = map(pa.arg, range(pa.count()))
# start the first job. Itself takes care of running the rest.
Job(files, log)
app.exec_loop()
示例3: languageChange
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
self.tabTorrent.setCurrentPage(-1)
KPyBTTorrentBaseLayout.addWidget(self.tabTorrent,0,0)
self.languageChange()
self.resize(QSize(431,270).expandedTo(self.minimumSizeHint()))
self.clearWState(Qt.WState_Polished)
def languageChange(self):
self.setCaption(self.__tr("Form1"))
def __tr(self,s,c = None):
return qApp.translate("KPyBTTorrentBase",s,c)
if __name__ == "__main__":
appname = ""
description = ""
version = ""
KCmdLineArgs.init (sys.argv, appname, description, version)
a = KApplication ()
QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
w = KPyBTTorrentBase()
a.setMainWidget(w)
w.show()
a.exec_loop()
示例4: I18N_NOOP
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from kdecore import KApplication, KAboutData, KCmdLineArgs, KGlobal, KIcon
from qt import QObject, SIGNAL, SLOT
from pakito.gui.mainwindow import MainWindow
def I18N_NOOP(x):
return x
name = "Pakito"
version = "0.3"
mail = "[email protected]"
description = I18N_NOOP("A tool for accelerating package making process")
if __name__ == "__main__":
about = KAboutData(name.lower(), name, version, description, KAboutData.License_GPL_V2, "(C) Gökçen Eraslan 2007", None, None, mail)
about.addAuthor("Gökçen Eraslan", None, mail)
KCmdLineArgs.init(sys.argv, about)
app = KApplication()
programLogo = KGlobal.iconLoader().loadIcon("pisikga", KIcon.Desktop)
about.setProgramLogo(programLogo.convertToImage())
QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()"))
pac = MainWindow(None, name)
app.setMainWidget(pac)
pac.show()
app.exec_loop()
示例5: setMainWidget
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
def setMainWidget(self, win):
self.mainwindow = win
KApplication.setMainWidget(self, win)
示例6: KAboutData
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
import sys
from kdecore import KAboutData, KApplication, KCmdLineArgs, KConfigSkeleton
from kdeui import KConfigDialog, KMainWindow
KCmdLineArgs.init(sys.argv, KAboutData("test", "test", "1.0"))
app = KApplication()
mainWin = KMainWindow(None, "test")
app.setMainWidget(mainWin)
cfg = KConfigSkeleton("test")
dlg = KConfigDialog(mainWin, "settings", cfg)
mainWin.show()
app.exec_loop()
示例7:
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
#!/usr/bin/python2.4
import sys
import os
from qt import SIGNAL
from kdecore import i18n, KAboutData, KApplication, KGlobal, KIcon, KCmdLineArgs
from KPyBTMain import *
if __name__=="__main__":
mainpath = os.path.dirname (os.path.abspath (sys.argv[0]))
print mainpath
authorname='Stephan Hermann'
authormail='[email protected]'
prgVersion='0.1'
lic=KAboutData.License_GPL
prgName='KPyBT'
prgDesc='A Python KDE BitTorrent Client'
authordesc=i18n("Maintainer and Core Developer")
about=KAboutData(prgName,prgName,prgVersion,prgDesc,lic,"© 2005")
about.addAuthor(authorname,str(authordesc),authormail)
KCmdLineArgs.init(sys.argv,about)
app=KApplication()
mainWindow=KPyBTMainWindow(mainpath)
mainWindow.show()
app.setMainWidget(mainWindow)
app.exec_loop()
示例8: set_main_frame
# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
set_main_frame(self)
DOM.init()
for m in pygwt_processMetas():
minst = module_load(m)
minst.onModuleLoad()
class MainSplitter(QSplitter):
def __init__(self, parent, name='MainSplitter'):
QSplitter.__init__(self, parent, name)
#self.browser = TestTextBrowser(self)
self.kpart = TestTextPart(self)
if __name__ == '__main__':
appname = 'textbrowser_image'
version = '-1'
about = KAboutData(appname, appname, version)
KCmdLineArgs.init(sys.argv, about)
app = KApplication()
win = KMainWindow()
split = MainSplitter(win)
win.setCentralWidget(split)
win.show()
app.setMainWidget(win)
app.exec_loop()