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


C++ ConfigDialog::setWindowTitle方法代码示例

本文整理汇总了C++中ConfigDialog::setWindowTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigDialog::setWindowTitle方法的具体用法?C++ ConfigDialog::setWindowTitle怎么用?C++ ConfigDialog::setWindowTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigDialog的用法示例。


在下文中一共展示了ConfigDialog::setWindowTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

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

    //all the translation stuff was taken from minitube
    const QString locale = QLocale::system().name();

    // qt translations
    QTranslator qtTranslator;
    qtTranslator.load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
    app.installTranslator(&qtTranslator);

    // app translations
    QString dataDir = QLatin1String(PKGDATADIR);
    qDebug() << __METHOD_NAME__ << "Data dir: " << __FUNCTION__ << dataDir;
  
#ifdef USE_DEVELOPING
    qDebug() << __METHOD_NAME__ << "Developing";
    QString    localeDir = qApp->applicationDirPath() + QDir::separator() + "locale";
#else
    qDebug() << __METHOD_NAME__ << "Not developing";
#if defined(Q_OS_OS2) //|| defined(Q_OS_WIN) ->this isn't checked
    QString    localeDir = qApp->applicationDirPath() + QDir::separator() + "locale";
#else
    QString    localeDir = dataDir + QDir::separator() + "locale";
#endif
#endif

    qDebug() << __METHOD_NAME__ << "Locale dir: " << localeDir;
    QTranslator translator;
    translator.load(locale, localeDir);
    app.installTranslator(&translator);

#ifndef Q_OS_LINUX
    QString BUILTIN_ICON_THEME = "oxygen";
    QIcon::setThemeName(BUILTIN_ICON_THEME);
#endif

    /**
      *command line stuff
      */
    int next_option;
    int re = 0;
    const char* const short_options = "hevc";
    const struct option long_options[] =
    {
        {"help",     0, NULL, 'h'},
        {"eggs",     0, NULL, 'e'},
        {"version",  0, NULL, 'v'},
        {"configure",0, NULL, 'c'},
        {NULL,       0, NULL, 0}
    };

    next_option = getopt_long(argc, argv, short_options, long_options, NULL);

    if (next_option == 'h')
    {
        std::cout << QString("If you have problems with the toolbar and the actions, try deleting the file .config/QIviewer/qiviewer.conf\n"
			     "How to use: qiviewer [OPTION/FILE]\n"
                             "Avaible options:\n"
                             "    -h --help shows this help and finish\n"
                             "    -v --version shows qiviewer version\n"
                             "    -e --eggs shows eggs dialog\n"
                             "    -c --configuration shows the configuration dialog\n").toStdString();
        re = 0;
    }

    else if (next_option == 'c')
    {
        ConfigDialog con;
        con.setWindowTitle("QIviewer configuration");
        con.exec();
        re = 0;
    }

    else if (next_option == '?')
    {
        std::cout << QString("Try 'qiviewer --help' for more information\n").toStdString();
        re = 0;
    }

    else if (next_option == 'v')
    {
        std::cout << QString("QIviewer %1\n"
                                 "Copyright (C) 2011 Aguilera Dario.\n"
                                 "License GPLv2+.\n"
                                 "<http://gnu.org/licenses/gpl.html>.\n"
                                 "This is free software: you are free to change it and redistribute.\n"
                                 "There is NO WARRANTY.\n"
                                 ).arg(QLatin1String(PROJECT_VERSION)).toStdString();
        re = 0;
    }

    else if (next_option == 'e')
    {
        EggsDialog ed;
        re = ed.exec();
    }

    else if (next_option == -1)
//.........这里部分代码省略.........
开发者ID:MyLittleRobo,项目名称:qiviewer,代码行数:101,代码来源:main.cpp


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