Exemple #1
0
int main( int argc, char **argv )
{
    QApplication app( argc, argv );
    TopLevel tl;
    tl.show();
    app.exec();
};
Exemple #2
0
int main( int argc, char ** argv )
{
    a = new KApplication ( argc, argv, "KNuminputTest" );

    TopLevel *toplevel = new TopLevel(0, "knuminputtest");

    toplevel->show();
    a->setMainWidget(toplevel);
    a->exec();
}
int main( int argc, char ** argv )
{
    app = new TDEApplication ( argc, argv, "ItemContainerTest" );

    TopLevel *toplevel = new TopLevel(0, "itemcontainertest");

    toplevel->show();
    toplevel->resize( 600, 300 );
    app->setMainWidget(toplevel);
    app->exec();
}
Exemple #4
0
int main( int argc, char ** argv )
{
    QApplication a(argc, argv);
    KLocalizedString::setApplicationDomain("kcachegrind");
    KAboutData aboutData(QStringLiteral("kcachegrind"),
                         i18n("KCachegrind"),
                         KCACHEGRIND_VERSION,
                         i18n("KDE Frontend for Callgrind/Cachegrind"),
                         KAboutLicense::GPL,
                         i18n("(C) 2002 - 2016"), QString(),
                         QStringLiteral("https://kcachegrind.github.io"));
    aboutData.addAuthor(i18n("Josef Weidendorfer"),
                        i18n("Author/Maintainer"),
                        QStringLiteral("*****@*****.**"));

    KAboutData::setApplicationData(aboutData);

    //   KGlobal::locale()->insertCatalog("kcachegrind_qt");
    Loader::initLoaders();

    KConfig* kc = KSharedConfig::openConfig().data();
    ConfigStorage::setStorage(new KDEConfigStorage(kc));

    if (a.isSessionRestored()){
        int n = 1;
        while (KMainWindow::canBeRestored(n)){
            (new TopLevel())->restore(n);
            n++;
        }
    }
    else {
        TopLevel* t;

        QCommandLineParser parser;
        parser.addPositionalArgument(QStringLiteral("trace"), i18n("Show information of this trace"), i18n("[trace...]"));
        parser.addVersionOption();
        parser.addHelpOption();
        aboutData.setupCommandLine(&parser);
        parser.process(a);
        aboutData.processCommandLine(&parser);

        int nbArgs = parser.positionalArguments().count();
        if (nbArgs>0) {
            t = new TopLevel();
            t->show();
            foreach(const QString &arg, parser.positionalArguments()) {
                t->loadDelayed(arg);
            }
        }
        else {
Exemple #5
0
int main(int argc, char *argv[])
{
  KAboutData aboutData( "kteatime", I18N_NOOP("KTeaTime"),
    version, description, KAboutData::License_GPL,
    "(c) 1998-1999, Matthias Hoelzer-Kluepfel\n(c) 2002-2003, Martin Willers");
  aboutData.addAuthor("Matthias Hoelzer-Kluepfel",0, "*****@*****.**");
  aboutData.addAuthor("Martin Willers", 0, "*****@*****.**");
  aboutData.addCredit("Daniel Teske", I18N_NOOP("Many patches"), "*****@*****.**");
  KCmdLineArgs::init( argc, argv, &aboutData );

  KApplication app;

  TopLevel toplevel;
  KWin::setSystemTrayWindowFor(toplevel.winId(), 0);
  toplevel.show();

  app.setTopWidget(&toplevel);
  KStartupInfo::appStarted();

  return app.exec();
}
Exemple #6
0
int main( int argc, char ** argv )
{
  KAboutData aboutData("kcachegrind", 0,
                       ki18n("KCachegrind"),
                       KCACHEGRIND_VERSION,
                       ki18n("KDE Frontend for Callgrind/Cachegrind"),
                       KAboutData::License_GPL,
                       ki18n("(C) 2002 - 2011"), KLocalizedString(),
                       "http://kcachegrind.sf.net");
  aboutData.addAuthor(ki18n("Josef Weidendorfer"),
                      ki18n("Author/Maintainer"),
                      "*****@*****.**");

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

  KCmdLineOptions options;
  //options.add("r <exec>", ki18n("Run <exec> under cachegrind"));
  options.add("+[trace]", ki18n("Show information of this trace"));
  KCmdLineArgs::addCmdLineOptions( options );

  KApplication a;
  KGlobal::locale()->insertCatalog("kcachegrind_qt");
  TopLevel* t;
  Loader::initLoaders();

  KConfig* kc = KGlobal::config().data();
  ConfigStorage::setStorage(new KDEConfigStorage(kc));

  if (a.isSessionRestored()){
    int n = 1;
    while (KMainWindow::canBeRestored(n)){
      (new TopLevel())->restore(n);
      n++;
    }
  }
  else {
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    int nbArgs = args->count();
    if (nbArgs>0) {
      for(int i = 0; i < nbArgs; i++) {
        t = new TopLevel();
        t->show();
        t->loadDelayed(args->arg(i));
      }
    }
    else {
      // load trace in current dir
      t = new TopLevel();
      t->show();
      t->loadDelayed(".");
    }
  }

  a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
  int res = a.exec();

  // to make leak checking in valgrind happy...
  Loader::deleteLoaders();
  ProfileContext::cleanup();
  ConfigStorage::cleanup();

  return res;
}