示例#1
0
int main( int argc, char * argv[]){
	
	// to init resources, we'd use the following ( -> we need an 'application.qrc' file for that (..) )
	//Q_INIT_RESOURCES( application );
	
	QApplication app(argc, argv);
	
	// basic parameters of the status bar (..)
	app.setOrganizationName("Seeds Design");
	app.setApplicationName("Digital Neurophone v0.1a");
	
	// simplest setup ever -> we create a basic QWindow widget (..)
	//QMainWindow mainWin; // basic test with Qt original class for main windows objects (..)
	ConfigWindow mainWin;
	
#if defined( Q_OS_SYMBIAN )
	mainWin.showMaximized();
#else
	mainWin.show();
#endif
	
	// as usual, end the loop returning 'app.exec()'
	return app.exec();
	
}
示例#2
0
int main(int argc, char *argv[])
{
    CSVParser::AddParseTypes("Behavior", Behavior::OptionTypes);
    CSVParser::AddParseTypes("Effect", Effect::OptionTypes);
    CSVParser::AddParseTypes("Speak", Speak::OptionTypes);

    QApplication app(argc, argv);
    QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
    QCoreApplication::setOrganizationName("qt-ponies");
    QCoreApplication::setApplicationName("qt-ponies");

    QString locale = QLocale::system().name().left(2).toLatin1();
    QString trans_dir = QCoreApplication::applicationDirPath() + "/translations";

    QTranslator translator;
    translator.load(QString("qt-ponies_%1").arg(locale), trans_dir);
    app.installTranslator(&translator);

    app.setQuitOnLastWindowClosed(false);
    QSettings::setDefaultFormat(QSettings::IniFormat);

    QFile qss(":/styles/res/style.qss");
    qss.open(QFile::ReadOnly);
    app.setStyleSheet( QString::fromUtf8(qss.readAll()) );
    qss.close();

    ConfigWindow config;

    qDebug() << "Locale:" << locale;

    if(config.ponies.size() == 0) {
        config.show();
    }

    return app.exec();
}
示例#3
0
void MainWindow::on_configAction_triggered() {
    ConfigWindow *cfg = new ConfigWindow(config_, this);
    cfg->show();
}