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


Python KApplication.setMainWidget方法代码示例

本文整理汇总了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()
开发者ID:BackupTheBerlios,项目名称:lovi-svn,代码行数:31,代码来源:main.py

示例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()
开发者ID:Alwnikrotikz,项目名称:lilykde,代码行数:28,代码来源:lilypond-servicemenu-helper.py

示例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()
开发者ID:BackupTheBerlios,项目名称:kpybt-svn,代码行数:32,代码来源:KPyBTTorrentBase.py

示例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()
开发者ID:dhirajkhatiwada1,项目名称:uludag,代码行数:32,代码来源:pakito.py

示例5: setMainWidget

# 需要导入模块: from kdecore import KApplication [as 别名]
# 或者: from kdecore.KApplication import setMainWidget [as 别名]
 def setMainWidget(self, win):
     self.mainwindow = win
     KApplication.setMainWidget(self, win)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:5,代码来源:application.py

示例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()
开发者ID:pipacs,项目名称:etc,代码行数:14,代码来源:config.py

示例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()
    
开发者ID:BackupTheBerlios,项目名称:kpybt-svn,代码行数:29,代码来源:KPyBT.py

示例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()
    
开发者ID:pombredanne,项目名称:pyjamas-desktop,代码行数:31,代码来源:textbrowser_image.py


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