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


C++ KApplication::setQuitOnLastWindowClosed方法代码示例

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


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

示例1: main

int main(int argc, char * argv[]) {
    Q_INIT_RESOURCE(multiplevideoplayer);

#ifdef KDE4_FOUND
    KAboutData aboutData("multiplevideoplayer", 0,
                         ki18n(""), "",
                         ki18n(""),
                         KAboutData::License_GPL,
                         ki18n(""));

    KCmdLineArgs::init(argc, argv, &aboutData);

    KApplication app;
#else
    QApplication app(argc, argv);
#endif	//KDE4_FOUND

    app.setApplicationName("VideoPlayer");
    app.setQuitOnLastWindowClosed(true);

    MainWindow window(NULL);
    window.show();

    return app.exec();
}
开发者ID:vilkov,项目名称:phonon-vlc-mplayer,代码行数:25,代码来源:main.cpp

示例2: main

int main(int argc, char *argv[])
{
    KAboutData about("kgpg", 0, ki18n("KGpg"), version, ki18n(description), KAboutData::License_GPL, ki18n("(C) 2003 Jean-Baptiste Mardelle"), KLocalizedString(), "http://utils.kde.org/projects/kgpg");
    about.addAuthor(ki18n("Jean-Baptiste Mardelle"), ki18n("Author and former maintainer"), "[email protected]");
    about.addAuthor(ki18n("Jimmy Gilles"), KLocalizedString(), "[email protected]");
    about.addAuthor(ki18n("Rolf Eike Beer"), ki18n("Maintainer"), "[email protected]");

    KCmdLineArgs::init(argc, argv, &about);

    KCmdLineOptions options;
    options.add("e", ki18n("Encrypt file"));
    options.add("k", ki18n("Open key manager"));
    options.add("d", ki18n("Open editor"));
    options.add("s", ki18n("Show encrypted file"));
    options.add("S", ki18n("Sign File"));
    options.add("V", ki18n("Verify signature"));
    options.add("+[File]", ki18n("File to open"));
    KCmdLineArgs::addCmdLineOptions(options);
    KUniqueApplication::addCmdLineOptions();

    if (!KUniqueApplication::start())
        return 0;

    KApplication *app = new KGpgApp();
    app->setQuitOnLastWindowClosed(false);
    return app->exec();
}
开发者ID:fluxer,项目名称:kde-extraapps,代码行数:27,代码来源:main.cpp

示例3: main

int main( int argc, char **argv )
{
    KCmdLineArgs::init(argc, argv, "kurlrequestertest", 0, ki18n("kurlrequestertest"), "0", ki18n("test app"));
    KApplication app;
    app.setQuitOnLastWindowClosed(false);
 
    KUrl url = KUrlRequesterDialog::getUrl( "ftp://ftp.kde.org" );
    qDebug( "Selected url: %s", url.url().toLatin1().constData());

    KUrlRequester *req = new KUrlRequester();
#ifndef KDE_NO_DEPRECATED
    KEditListBox *el = new KEditListBox( QLatin1String("Test"), req->customEditor() );
#else
    KEditListWidget *el = new KEditListWidget( req->customEditor() );
    el->setWindowTitle( QLatin1String("Test") );
#endif
    el->show();

    KUrlRequester *req1 = new KUrlRequester();
    req1->fileDialog();
    req1->setWindowTitle("AAAAAAAAAAAA");
    req1->show();
   
    return app.exec();
}
开发者ID:vasi,项目名称:kdelibs,代码行数:25,代码来源:kurlrequestertest.cpp

示例4: main

int main(int argc, char **argv)
{

	KAboutData aboutData("liri-control-kde4",
		0,
		ki18n("Liri Control"), //programname
		ABOUT_VERSION, //version
		ki18n(ABOUT_SUMMARY), //short Desc
		KAboutData::License_LGPL_V3, //license
		ki18n(ABOUT_COPYRIGHT), //copywrite statement
		ki18n("Status of liri components"), //text
		"http://cerebro.webhop.net/liri", //homepage
		ABOUT_AUTHOR_EMAIL); //bugsemail address
	aboutData.addAuthor(ki18n(ABOUT_AUTHOR), ki18n("Lead developer"), ABOUT_AUTHOR_EMAIL);
	aboutData.setProgramIconName(QLatin1String("liri-control"));

	KCmdLineArgs::init( argc, argv, &aboutData );
	KApplication app;

	app.setWindowIcon(KIcon(QLatin1String("liri-control")));
	app.setQuitOnLastWindowClosed(true);

	BusConnection* busconnection = new BusConnection();

	/* self freeing object! */
	MainWindow* window = new MainWindow(busconnection);
	window->show();

	int res = app.exec();

	delete busconnection;

	return res;
}
开发者ID:davidgraeff,项目名称:oldstuff,代码行数:34,代码来源:main.cpp

示例5: main

int main(int argc, char **argv)
{
    KCmdLineArgs::init(argc, argv, "demo", 0, KLocalizedString(), "version", KLocalizedString());

    KApplication app;
    app.setQuitOnLastWindowClosed( true );

    QWidget *mainWidget = new QWidget;
    QVBoxLayout* l = new QVBoxLayout;

    KTextEditor::Message* m = new KTextEditor::Message(KTextEditor::Message::Information, "This is an information message, awesome!");
    QAction* a = new QAction("Action 1", m);
    m->addAction(a);
    a = new QAction("Action 2", m);
    m->addAction(a, false);

    KateMessageWidget* mw = new KateMessageWidget(m);
    l->addWidget(mw);
    mw = new KateMessageWidget(m);
    l->addWidget(mw);
    l->addWidget(new QLabel("some text in the middle", mw));
    mw = new KateMessageWidget(m);
    l->addWidget(mw);
    l->addWidget(new QLabel("some text at the bottom", mw));

    mainWidget->setLayout(l);
    mainWidget->show();

    return app.exec();
}
开发者ID:azat-archive,项目名称:kate,代码行数:30,代码来源:main.cpp

示例6: main

int main(int argc, char **argv)
{
  KAboutData about("ksimond", 0, ki18n("KSimond"), simon_version, ki18n(description),
    KAboutData::License_GPL, ki18n("(C) 2008 Peter Grasch"), KLocalizedString(), 0, "[email protected]");
  about.addAuthor( ki18n("Peter Grasch"), KLocalizedString(), "[email protected]" );
  KCmdLineArgs::init(argc, argv, &about);

  KApplication app;
  QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath()+"/../plugins");
  app.setQuitOnLastWindowClosed(false);
  KSimondView *widget = new KSimondView();
  //widget->show();

  int ret = app.exec();
  delete widget;
  return ret;
}
开发者ID:KDE,项目名称:simon,代码行数:17,代码来源:main.cpp

示例7: main

int main( int argc, char* argv[] )
{
  KAboutData aboutData( "klan",
                        0,
                        ki18n("KLan"),
                        "0.1",
                        ki18n("A lan communication tool for KDE"),
                        KAboutData::License_GPL_V3,
                        ki18n( "(c) 2010 Felix Rohrbach" ),
                        ki18n(""), // Futher description
                        "", // Website
                        "[email protected]" );
  
  KCmdLineArgs::init( argc, argv, &aboutData );
  KApplication app;
  app.setQuitOnLastWindowClosed(true);
  MainWindow window;
  return app.exec();
}
开发者ID:Fxrh,项目名称:KLan,代码行数:19,代码来源:main.cpp

示例8: about

extern "C" KDE_EXPORT int kdemain(int argc, char** argv)
{
    KAboutData about("cvsservice", 0, ki18n("CVS D-Bus service"), "0.1",
            ki18n("D-Bus service for CVS"), KAboutData::License_LGPL,
            ki18n("Copyright (c) 2002-2003 Christian Loose"));
    about.addAuthor(ki18n("Christian Loose"), ki18n("Developer"),
            "[email protected]");

    KCmdLineArgs::init(argc, argv, &about);

    KApplication app;

    // Don't quit if password dialog for login is closed
    app.setQuitOnLastWindowClosed(false);

    // This app is started automatically, no need for session management
    app.disableSessionManagement();

    CvsService service;

    return app.exec();
}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:22,代码来源:main.cpp

示例9: main

int main(int argc, char **argv)
{
    KCmdLineOptions options;
    options.add("+[cmd]");
    options.add("+[url]");

    KCmdLineArgs::init(argc, argv, "kfstest", 0, ki18n("kfstest"), "0", ki18n("test app"));
    KCmdLineArgs::addCmdLineOptions(options);
    KApplication a;
    a.setQuitOnLastWindowClosed(false);

    QString name1;
    QStringList names;

    QString argv1;
    KUrl startDir;
    if (argc > 1)
        argv1 = QLatin1String(argv[1]);
    if ( argc > 2 )
        startDir = KUrl( argv[2] );

#if 0 // SPLIT-TODO
    if (argv1 == QLatin1String("diroperator")) {
        KDirOperator *op = new KDirOperator(startDir, 0);
        KConfigGroup grp(KGlobal::config(), "TestGroup" );
        op->setViewConfig(grp);
        op->setView(KFile::Simple);
        op->show();
        a.exec();
    } else
#endif
    if (argv1 == QLatin1String("localonly")) {
        QString name = KFileDialog::getOpenFileName(startDir);
        qDebug("filename=%s",name.toLatin1().constData());
    }
    else if (argv1 == QLatin1String("oneurl")) {
        KUrl url = KFileDialog::getOpenUrl(startDir);
        qDebug() << "url=" << url;
    }

    else if (argv1 == QLatin1String("existingDirectoryUrl")) {
        KUrl url = KFileDialog::getExistingDirectoryUrl();
        qDebug("URL=%s",url.url().toLatin1().constData());
        name1 = url.url();
    }

    else if (argv1 == QLatin1String("preview")) {
        KUrl u =  KFileDialog::getImageOpenUrl();
        qDebug("filename=%s", u.url().toLatin1().constData());
    }

    else if (argv1 == QLatin1String("preselect")) {
        names = KFileDialog::getOpenFileNames(KUrl("/etc/passwd"));
        QStringList::Iterator it = names.begin();
        while ( it != names.end() ) {
            qDebug("selected file: %s", (*it).toLatin1().constData());
            ++it;
        }
    }

    else if (argv1 == QLatin1String("dirs"))
        name1 = KFileDialog::getExistingDirectory();

    else if (argv1 == QLatin1String("heap")) {
        KFileDialog *dlg = new KFileDialog( startDir, QString(), 0L);
        dlg->setMode( KFile::File);
        dlg->setOperationMode( KFileDialog::Saving );
        QStringList filter;
        filter << "all/allfiles" << "text/plain";
        dlg->setMimeFilter( filter, "all/allfiles" );
#if 0 // SPLIT-TODO
        KUrlBar *urlBar = dlg->speedBar();
        if ( urlBar )
        {
            urlBar->insertDynamicItem( KUrl("ftp://ftp.kde.org"),
                                       QLatin1String("KDE FTP Server") );
        }
#endif
        if ( dlg->exec() == KDialog::Accepted )
            name1 = dlg->selectedUrl().url();
    }

    else if ( argv1 == QLatin1String("eventloop") )
    {
        new KFDTest( startDir );
        return a.exec();
    }

    else if (argv1 == QLatin1String("save")) {
        KUrl u = KFileDialog::getSaveUrl(startDir);
//        QString(QDir::homePath() + QLatin1String("/testfile")),
//        QString(), 0L);
        name1 = u.url();
    }

    else if (argv1 == QLatin1String("icon")) {
        KIconDialog dlg;
        QString icon = dlg.getIcon();
        kDebug() << icon;
    }
//.........这里部分代码省略.........
开发者ID:vasi,项目名称:kdelibs,代码行数:101,代码来源:kfstest.cpp


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