当前位置: 首页>>代码示例>>C++>>正文


C++ MainWidget类代码示例

本文整理汇总了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();
}
开发者ID:o2gy84,项目名称:makaroni,代码行数:32,代码来源:main.cpp

示例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();
}
开发者ID:iclosure,项目名称:carmonitor,代码行数:28,代码来源:main.cpp

示例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;
        }
    }
}
开发者ID:sseshachala,项目名称:tdesktop,代码行数:60,代码来源:apiwrap.cpp

示例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;
}
开发者ID:xtuer,项目名称:Qt,代码行数:34,代码来源:main.cpp

示例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();
}
开发者ID:fileyeah,项目名称:doubanfm-qt,代码行数:26,代码来源:main.cpp

示例6: main

int main(int argc, char *argv[]) {
  QApplication app(argc, argv);
  MainWidget *main = new MainWidget();
  main->setVisible(true);

  return app.exec();
}
开发者ID:lopespt,项目名称:QtOpenGL,代码行数:7,代码来源:QOglTest.cpp

示例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();
}
开发者ID:daniel-j-h,项目名称:home,代码行数:35,代码来源:main.cpp

示例8: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWidget w;
    w.showMaximized();

    return a.exec();
}
开发者ID:tucna,项目名称:image_reconstruction,代码行数:8,代码来源:main.cpp

示例9: main

int main(int argc, char ** argv)
{
	QApplication app(argc, argv);
	MainWidget glWid;
	glWid.show();
	//glWid.start();
	return app.exec();
}
开发者ID:BourotBenjamin,项目名称:Space_Wars,代码行数:8,代码来源:main.cpp

示例10: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8"));
    MainWidget win;
    win.show();

    return app.exec();
}
开发者ID:LittleKey,项目名称:FTPDownload,代码行数:9,代码来源:main.cpp

示例11: main

int main(int argc, char **argv)
{
	QApplication a(argc, argv);

	MainWidget w;
	w.show();

	return a.exec();
}
开发者ID:tisalexander,项目名称:internetmonitoring,代码行数:9,代码来源:main.cpp

示例12: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    MainWidget mainWidget;
    mainWidget.show();

    return app.exec();
}
开发者ID:montredo,项目名称:sqlite-thread,代码行数:9,代码来源:main.cpp

示例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();
}
开发者ID:shujaatak,项目名称:QtTileDual,代码行数:9,代码来源:main.cpp

示例14: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWidget w;
    w.resize(1000,600);
    w.show();

    return a.exec();
}
开发者ID:wangyun123,项目名称:Third,代码行数:10,代码来源:main.cpp

示例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();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:10,代码来源:main.cpp


注:本文中的MainWidget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。