本文整理汇总了C++中MainWidget类的典型用法代码示例。如果您正苦于以下问题:C++ MainWidget类的具体用法?C++ MainWidget怎么用?C++ MainWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MainWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
Q_INIT_RESOURCE(makaron);
QApplication app(argc, argv);
QIcon icon(":/images/makaron.jpg");
app.setWindowIcon(icon);
//QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
//QTextCodec *codec = QTextCodec::codecForName("cp1251");
//QTextCodec::setCodecForCStrings(codec);
//QTextCodec::setCodecForTr(codec);
MainWidget mw;
mw.setWindowTitle("VerticalPermutations");
QSize size;
size.setWidth(1000);
size.setHeight(300);
mw.setMinimumSize(size);
//mw.setMaximumSize(size);
mw.show();
return app.exec();
}
示例2: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTranslator translator;
translator.load(":/lang/" + QString("zh_CN"));
app.installTranslator(&translator);
QFile file(":/qss/stylesheet-1");
file.open(QFile::ReadOnly);
app.setStyleSheet(file.readAll());
app.setFont(QFont("微软雅黑", 12));
//
app.setOrganizationDomain("iclosure.com");
app.setOrganizationName("Smartsoft");
app.setApplicationName("CarMonitor");
app.setApplicationDisplayName(QApplication::tr("Car System Monitor"));
app.setApplicationVersion(QString("%1.%2.%3")
.arg(TARGET_VER_MAJ)
.arg(TARGET_VER_MIN)
.arg(TARGET_VER_PAT));
//
MainWidget mainWidget;
mainWidget.showFullScreen();
return app.exec();
}
示例3: switch
void ApiWrap::gotWebPages(const MTPmessages_Messages &msgs, mtpRequestId req) {
const QVector<MTPMessage> *v = 0;
switch (msgs.type()) {
case mtpc_messages_messages:
App::feedUsers(msgs.c_messages_messages().vusers);
App::feedChats(msgs.c_messages_messages().vchats);
v = &msgs.c_messages_messages().vmessages.c_vector().v;
break;
case mtpc_messages_messagesSlice:
App::feedUsers(msgs.c_messages_messagesSlice().vusers);
App::feedChats(msgs.c_messages_messagesSlice().vchats);
v = &msgs.c_messages_messagesSlice().vmessages.c_vector().v;
break;
}
QMap<int32, int32> msgsIds; // copied from feedMsgs
for (int32 i = 0, l = v->size(); i < l; ++i) {
const MTPMessage &msg(v->at(i));
switch (msg.type()) {
case mtpc_message:
msgsIds.insert(msg.c_message().vid.v, i);
break;
case mtpc_messageEmpty:
msgsIds.insert(msg.c_messageEmpty().vid.v, i);
break;
case mtpc_messageService:
msgsIds.insert(msg.c_messageService().vid.v, i);
break;
}
}
MainWidget *m = App::main();
for (QMap<int32, int32>::const_iterator i = msgsIds.cbegin(), e = msgsIds.cend(); i != e; ++i) {
HistoryItem *item = App::histories().addToBack(v->at(*i), -1);
if (item) {
item->initDimensions();
if (m) m->itemResized(item);
}
}
const WebPageItems &items(App::webPageItems());
for (WebPagesPending::iterator i = _webPagesPending.begin(); i != _webPagesPending.cend();) {
if (i.value() == req) {
if (i.key()->pendingTill > 0) {
i.key()->pendingTill = -1;
WebPageItems::const_iterator j = items.constFind(i.key());
if (j != items.cend()) {
for (HistoryItemsMap::const_iterator k = j.value().cbegin(), e = j.value().cend(); k != e; ++k) {
k.key()->initDimensions();
if (m) m->itemResized(k.key());
}
}
}
i = _webPagesPending.erase(i);
} else {
++i;
}
}
}
示例4: main
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
// 使系统对话框中文化
QTranslator translator;
translator.load("qt_zh_CN.qm");
app.installTranslator(&translator);
// 注册窗口:
{
RegisterDialog dialog;
dialog.checkRegister();
}
{
LoginDialog loginDialog;
loginDialog.setWindowFlags(Qt::WindowCloseButtonHint);
if (QDialog::Accepted != loginDialog.exec()) {
return 1;
}
}
// Backup the files.
Global::backup();
MainWidget w;
w.show();
int result = app.exec();
Global::backup();
Settings::release();
return result;
}
示例5: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
a.setApplicationName("DoubanFM");
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
//QResource::registerResource("icons.qrc");
QTranslator translator;
QLocale locale;
translator.load(QString(":/lang/")
+ QLocale::countryToString(locale.country())
+ QString("_")
+ QLocale::languageToString(locale.language()));
qDebug() << QString("Load Language: ")
+ QLocale::countryToString(locale.country())
+ QString("_")
+ QLocale::languageToString(locale.language());
a.installTranslator(&translator);
MainWidget mw;
mw.show();
return a.exec();
}
示例6: main
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
MainWidget *main = new MainWidget();
main->setVisible(true);
return app.exec();
}
示例7: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setApplicationName("objects");
app.setApplicationVersion("0.1");
QCommandLineParser parser;
parser.setApplicationDescription("OpenGL objects");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption objectOption(QStringList() << "o" << "object",
QCoreApplication::translate("main", "Use object <object>."),
QCoreApplication::translate("main", "object"),
QString::fromLatin1("earth.obj"));
parser.addOption(objectOption);
QCommandLineOption shaderOption(QStringList() << "s" << "shader",
QCoreApplication::translate("main", "Use shaders <shader>.[fv].glsl."),
QCoreApplication::translate("main", "shader"),
QString::fromLatin1("simple"));
parser.addOption(shaderOption);
parser.process(app);
#ifndef QT_NO_OPENGL
MainWidget widget;
widget.setObject(parser.value(objectOption));
widget.setShader(parser.value(shaderOption));
widget.show();
#else
QLabel note("OpenGL Support required");
note.show();
#endif
return app.exec();
}
示例8: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWidget w;
w.showMaximized();
return a.exec();
}
示例9: main
int main(int argc, char ** argv)
{
QApplication app(argc, argv);
MainWidget glWid;
glWid.show();
//glWid.start();
return app.exec();
}
示例10: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8"));
MainWidget win;
win.show();
return app.exec();
}
示例11: main
int main(int argc, char **argv)
{
QApplication a(argc, argv);
MainWidget w;
w.show();
return a.exec();
}
示例12: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MainWidget mainWidget;
mainWidget.show();
return app.exec();
}
示例13: main
int main(int argc, char **argv)
{
QApplication app(argc, argv);
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
MainWidget widget;
widget.show();
return app.exec();
}
示例14: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWidget w;
w.resize(1000,600);
w.show();
return a.exec();
}
示例15: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
app.setApplicationName("Qt Multimedia spectrum analyzer");
MainWidget w;
w.show();
return app.exec();
}