Пример #1
0
int main(int argc, char **argv)
{
    KAboutData aboutData( "husky_test", "husky_test",
        ki18n("husky_test"), "0.1",
        ki18n("test."),
        KAboutData::License_GPL,
        ki18n("Copyright (c) 2013") );

    KCmdLineArgs::init( argc, argv, &aboutData );
    KCmdLineOptions options;
    options.add("+[file]", ki18n("demo argument"));
    KCmdLineArgs::addCmdLineOptions(options);
 
    // parse command line arguments
    KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
    if(args->count()) {
        std::cout << "have args " << args->count() << std::endl;
    }

    KApplication app;

    Mainwin *p = new Mainwin;
    p->show();

    return app.exec();
}
Пример #2
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QFont font("AR PL KaitiM GB", 12);
    a.setFont(font);

    //设置APP图标
    QIcon icon;

    icon.addPixmap(QPixmap(":/logo_48.png"));
    icon.addPixmap(QPixmap(":/logo_72.png"));
    icon.addPixmap(QPixmap(":/logo_96.png"));
    QApplication::setWindowIcon(icon);

    Mainwin w;
    LoginDialog dlg;

    if(dlg.exec() == QDialog::Accepted){
        w.show();
        return a.exec();
    }else{
        return 0;
    }

}