int main(int argc, char** argv) { bool d = (argc > 1 && strcmp(argv[1], "-d") == 0) ? true : false; QApplication *app = new QApplication(argc, argv); app->setOrganizationName("F-list.net"); app->setOrganizationDomain("www.f-list.net"); app->setApplicationName("F-list Messenger"); globalInit(); QFile stylefile("default.qss"); stylefile.open(QFile::ReadOnly); QString stylesheet = QLatin1String(stylefile.readAll()); app->setStyleSheet(stylesheet); flist_messenger::init(); flist_messenger *fmessenger = new flist_messenger(d); fmessenger->show(); return app->exec(); //todo: globalQuit(); }
int main(int argc, char *argv[]) { QString path(":/style"); QFile stylefile(path); QApplication a(argc, argv); stylefile.open(QFile::ReadOnly); a.setStyleSheet(stylefile.readAll()); a.setFont(QFont("simfang",11)); QTextCodec *code=QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(code); //QTextCodec::setCodecForCStrings(code); //QTextCodec::setCodecForTr(code); Phone w; w.setWindowFlags(Qt::FramelessWindowHint); //w.setGeometry(0, 0, 800, 480); w.resize(800,480); w.show(); return a.exec(); }