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


C++ setApplicationName函数代码示例

本文整理汇总了C++中setApplicationName函数的典型用法代码示例。如果您正苦于以下问题:C++ setApplicationName函数的具体用法?C++ setApplicationName怎么用?C++ setApplicationName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: BaseApplication

Application::Application(const QString &id, int &argc, char **argv)
    : BaseApplication(id, argc, argv)
    , m_running(false)
    , m_shutdownAct(ShutdownDialogAction::Exit)
    , m_commandLineArgs(parseCommandLine(this->arguments()))
#ifndef DISABLE_WEBUI
    , m_webui(nullptr)
#endif
{
    qRegisterMetaType<Log::Msg>("Log::Msg");

    setApplicationName("qBittorrent");
    validateCommandLineParameters();

    QString profileDir = m_commandLineArgs.portableMode
        ? QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(DEFAULT_PORTABLE_MODE_PROFILE_DIR)
        : m_commandLineArgs.profileDir;

    Profile::initialize(profileDir, m_commandLineArgs.configurationName,
                        m_commandLineArgs.relativeFastresumePaths || m_commandLineArgs.portableMode);

    Logger::initInstance();
    SettingsStorage::initInstance();
    Preferences::initInstance();

    if (m_commandLineArgs.webUiPort > 0) // it will be -1 when user did not set any value
        Preferences::instance()->setWebUiPort(m_commandLineArgs.webUiPort);

    setApplicationName("qBittorrent");
    initializeTranslation();

#if !defined(DISABLE_GUI)
    setAttribute(Qt::AA_UseHighDpiPixmaps, true);  // opt-in to the high DPI pixmap support
    setQuitOnLastWindowClosed(false);
#endif

#if defined(Q_OS_WIN) && !defined(DISABLE_GUI)
    connect(this, SIGNAL(commitDataRequest(QSessionManager &)), this, SLOT(shutdownCleanup(QSessionManager &)), Qt::DirectConnection);
#endif

    connect(this, SIGNAL(messageReceived(const QString &)), SLOT(processMessage(const QString &)));
    connect(this, SIGNAL(aboutToQuit()), SLOT(cleanup()));

    if (isFileLoggerEnabled())
        m_fileLogger = new FileLogger(fileLoggerPath(), isFileLoggerBackup(), fileLoggerMaxSize(), isFileLoggerDeleteOld(), fileLoggerAge(), static_cast<FileLogger::FileLogAgeType>(fileLoggerAgeType()));

    Logger::instance()->addMessage(tr("qBittorrent %1 started", "qBittorrent v3.2.0alpha started").arg(QBT_VERSION));
}
开发者ID:Gelmir,项目名称:qBittorrent,代码行数:48,代码来源:application.cpp

示例2: QApplication

IQmolApplication::IQmolApplication(int &argc, char **argv )
  : QApplication(argc, argv)
{
   setOrganizationDomain("iqmol.org");
   setApplicationName("IQmol");
   // Can't log anything yet as the logger hasn't been initialized
}
开发者ID:bjnano,项目名称:IQmol,代码行数:7,代码来源:IQmolApplication.C

示例3: QApplication

/**
  * Constructor
  */
BursarApp::BursarApp(int argc, char *argv[])
    : QApplication(argc, argv)
{
    // set application properties
    setApplicationName(APP_NAME);
    setApplicationVersion(APP_VERSION);

    // mac specific
#ifdef Q_WS_MAC
    // don't quit application when last window closes
    //setQuitOnLastWindowClosed(false);

    // create mac style menu
    //createMacStyleMenu();
#endif

    // create bursar document
    m_doc = new BurDoc(FULL);

    // create main window
    m_mainWindow = new MainWindow(m_doc);

#ifndef Q_WS_MAC
    // show main window
    m_mainWindow->show();
#endif
}
开发者ID:BackupTheBerlios,项目名称:bursar,代码行数:30,代码来源:bursarapp.cpp

示例4: QApplication

QkUiApplication::QkUiApplication(int& pArgc, char** pArgv, const QString& pCompanyName, const QString& pAppName)
    : QApplication(pArgc, pArgv)
{
    setApplicationName(pAppName);
    setOrganizationName(pCompanyName);
    initMyResource();
}
开发者ID:koloboid,项目名称:qk-cpp,代码行数:7,代码来源:qkuiapplication.cpp

示例5: QApplication

WiresharkApplication::WiresharkApplication(int &argc,  char **argv) :
    QApplication(argc, argv),
    initialized_(false),
    is_reloading_lua_(false),
    if_notifier_(NULL),
    active_captures_(0)
{
    wsApp = this;
    setApplicationName("Wireshark");

    Q_INIT_RESOURCE(about);
    Q_INIT_RESOURCE(i18n);
    Q_INIT_RESOURCE(layout);
    Q_INIT_RESOURCE(toolbar);
    Q_INIT_RESOURCE(wsicon);
    Q_INIT_RESOURCE(languages);

#ifdef Q_OS_WIN
    /* RichEd20.DLL is needed for native file dialog filter entries. */
    ws_load_library("riched20.dll");
#endif // Q_OS_WIN

#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
    setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif

    QList<int> icon_sizes = QList<int>() << 16 << 24 << 32 << 48 << 64 << 128 << 256 << 512 << 1024;
    foreach (int icon_size, icon_sizes) {
        QString icon_path = QString(":/wsicon/wsicon%1.png").arg(icon_size);
        normal_icon_.addFile(icon_path);
        icon_path = QString(":/wsicon/wsiconcap%1.png").arg(icon_size);
        capture_icon_.addFile(icon_path);
    }
开发者ID:Piping,项目名称:wireshark,代码行数:33,代码来源:wireshark_application.cpp

示例6: Libertine

/**
 * Constraucts a Libertine application wrapper object.
 * @param[in] argc  The count of the number of command-line arguments.
 * @param[in] argv  A vector of command-line arguments.
 *
 * Sets up the Libertine application from the command-line arguments,
 * environment variables, and configurations files and displays the GUI.
 */
Libertine::
Libertine(int argc, char* argv[])
: QGuiApplication(argc, argv)
, main_qml_source_file_(find_main_qml_source_file())
{
  setApplicationName(LIBERTINE_APPLICATION_NAME);
  setApplicationVersion(LIBERTINE_VERSION);
  config_.reset(new LibertineConfig(*this));
  qmlRegisterType<ContainerConfig>("Libertine", 1, 0, "ContainerConfig");
  qmlRegisterType<ContainerManagerWorker>("Libertine", 1, 0, "ContainerManagerWorker");
  qmlRegisterType<PasswordHelper>("Libertine", 1, 0, "PasswordHelper");

  initialize_python();

  if (main_qml_source_file_.isEmpty())
  {
    qWarning() << "Can not locate " << s_main_QML_source_file;
  }

  containers_ = new ContainerConfigList(config_.data(), this);
  container_apps_ = new ContainerAppsList(containers_, this);
  password_helper_ = new PasswordHelper();

  initialize_view();
  view_.show();
}
开发者ID:attente,项目名称:libertine,代码行数:34,代码来源:libertine.cpp

示例7: BaseApplication

Application::Application(const QString &id, int &argc, char **argv)
    : BaseApplication(id, argc, argv)
    , m_running(false)
#ifndef DISABLE_GUI
    , m_shutdownAct(ShutdownAction::None)
#endif
{
    Logger::initInstance();
    Preferences::initInstance();

#if defined(Q_OS_MACX) && !defined(DISABLE_GUI)
    if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_8) {
        // fix Mac OS X 10.9 (mavericks) font issue
        // https://bugreports.qt-project.org/browse/QTBUG-32789
        QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
    }
#endif
    setApplicationName("qBittorrent");
    initializeTranslation();
#ifndef DISABLE_GUI
    setStyleSheet("QStatusBar::item { border-width: 0; }");
    setQuitOnLastWindowClosed(false);
#ifdef Q_OS_WIN
    connect(this, SIGNAL(commitDataRequest(QSessionManager &)), this, SLOT(shutdownCleanup(QSessionManager &)), Qt::DirectConnection);
#endif // Q_OS_WIN
#endif // DISABLE_GUI

    connect(this, SIGNAL(messageReceived(const QString &)), SLOT(processMessage(const QString &)));
    connect(this, SIGNAL(aboutToQuit()), SLOT(cleanup()));

    Logger::instance()->addMessage(tr("qBittorrent %1 started", "qBittorrent v3.2.0alpha started").arg(VERSION));
}
开发者ID:JXPrime,项目名称:qBittorrent,代码行数:32,代码来源:application.cpp

示例8: QApplication

AgrosApplication::AgrosApplication(int& argc, char ** argv) : QApplication(argc, argv), m_scriptEngineRemote(NULL)
{
    setWindowIcon(icon("agros2d"));
    setApplicationVersion(versionString());
    setOrganizationName("hpfem.org");
    setOrganizationDomain("hpfem.org");
    setApplicationName("Agros2D-3");

#ifdef Q_WS_MAC
    // don't show icons in menu
    setAttribute(Qt::AA_DontShowIconsInMenus, true);
#endif

    // std::string codec
#if QT_VERSION < 0x050000
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
#endif
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));

    // force number format
    QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));

    // init singleton
    Agros2D::createSingleton();
}
开发者ID:LukasKoudela,项目名称:agros2d,代码行数:26,代码来源:global.cpp

示例9: QApplication

Application::Application(int& argc, char** argv)
	: QApplication(argc, argv),
	m_window(0)
{
	setApplicationName("FocusWriter");
	setApplicationVersion("1.3.3");
	setOrganizationDomain("gottcode.org");
	setOrganizationName("GottCode");
	{
		QIcon fallback(":/hicolor/256x256/apps/focuswriter.png");
		fallback.addFile(":/hicolor/128x128/apps/focuswriter.png");
		fallback.addFile(":/hicolor/64x64/apps/focuswriter.png");
		fallback.addFile(":/hicolor/48x48/apps/focuswriter.png");
		fallback.addFile(":/hicolor/32x32/apps/focuswriter.png");
		fallback.addFile(":/hicolor/24x24/apps/focuswriter.png");
		fallback.addFile(":/hicolor/22x22/apps/focuswriter.png");
		fallback.addFile(":/hicolor/16x16/apps/focuswriter.png");
		setWindowIcon(QIcon::fromTheme("focuswriter", fallback));
	}
#ifndef Q_WS_MAC
	setAttribute(Qt::AA_DontUseNativeMenuBar);
	setAttribute(Qt::AA_DontShowIconsInMenus, !QSettings().value("Window/MenuIcons", false).toBool());
#else
	setAttribute(Qt::AA_DontShowIconsInMenus, true);
	new RTF::Converter;
#endif

	qputenv("UNICODEMAP_JP", "cp932");

	m_files = arguments().mid(1);
	processEvents();
}
开发者ID:svenna,项目名称:focuswriter,代码行数:32,代码来源:main.cpp

示例10: QtSingleApplication

Application::Application(int& argc, char** argv) :
	QtSingleApplication("org.gottcode.FocusWriter", argc, argv),
	m_window(0)
{
	setApplicationName("FocusWriter");
	setApplicationVersion(VERSIONSTR);
	setApplicationDisplayName(Window::tr("FocusWriter"));
	setOrganizationDomain("gottcode.org");
	setOrganizationName("GottCode");
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
	setWindowIcon(QIcon::fromTheme("focuswriter", QIcon(":/focuswriter.png")));
#endif

	setAttribute(Qt::AA_UseHighDpiPixmaps, true);

#ifndef Q_OS_MAC
	setAttribute(Qt::AA_DontUseNativeMenuBar);
#else
	setAttribute(Qt::AA_DontShowIconsInMenus, true);
#endif

#ifdef RTFCLIPBOARD
	new RTF::Clipboard;
#endif

	qputenv("UNICODEMAP_JP", "cp932");

	m_files = arguments().mid(1);
	processEvents();
}
开发者ID:barak,项目名称:focuswriter,代码行数:30,代码来源:application.cpp

示例11: setOrganizationName

bool
Mp3tunesHarmonyDaemon::allAboardTheDBus()
{

    setOrganizationName( "Amarok" );
    setOrganizationDomain( "amarok.kde.org" );
    setApplicationName( "Mp3tunes Harmony Daemon" );

    QDBusConnectionInterface *bus = 0;
    bus = QDBusConnection::sessionBus().interface();
    if( !bus ) {
        qFatal("No dbus!!");
        ::exit(126);
        return false;
    }
    QStringList parts = this->organizationDomain().split(QLatin1Char('.'), QString::SkipEmptyParts);
    QString reversedDomain;
    if (parts.isEmpty())
        reversedDomain = QLatin1String("local.");
    else
        foreach (const QString& s, parts)
        {
            reversedDomain.prepend(QLatin1Char('.'));
            reversedDomain.prepend(s);
        }
开发者ID:ErrAza,项目名称:amarok,代码行数:25,代码来源:Mp3tunesHarmonyDaemon.cpp

示例12: QCoreApplication

tcPlayApp::tcPlayApp ( int & argc, char ** argv)
: QCoreApplication (argc, argv)
{
    setApplicationName("Play App");
    setOrganizationName("Acme");
    setObjectName ("tcPlayApp");
}
开发者ID:hello-xk,项目名称:kiwi,代码行数:7,代码来源:main.cpp

示例13: QApplication

Application::Application(int& argc, char* argv[]) : QApplication(argc, argv)
{
    setApplicationName("Communi");
    setOrganizationName("Communi");
    setApplicationVersion(Irc::version());

    QIcon icon;
    icon.addFile(":/resources/icons/16x16/communi.png");
    icon.addFile(":/resources/icons/24x24/communi.png");
    icon.addFile(":/resources/icons/32x32/communi.png");
    icon.addFile(":/resources/icons/48x48/communi.png");
    icon.addFile(":/resources/icons/64x64/communi.png");
    icon.addFile(":/resources/icons/128x128/communi.png");
    setWindowIcon(icon);

    qRegisterMetaTypeStreamOperators<Settings>("Settings");
    qRegisterMetaTypeStreamOperators<ConnectionInfo>("ConnectionInfo");
    qRegisterMetaTypeStreamOperators<ConnectionInfos>("ConnectionInfos");

    QSettings settings;
    if (arguments().contains("-reset"))
        settings.clear();
    ApplicationData::settings = settings.value("settings").value<Settings>();

    QFile file(":resources/stylesheet.css");
    if (file.open(QFile::ReadOnly | QIODevice::Text))
        setStyleSheet(QString::fromUtf8(file.readAll()));
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:28,代码来源:application.cpp

示例14: setApplicationName

    :KUniqueApplication()
#endif	
{    
    setApplicationName("karakaxa");
    setApplicationVersion(VERSION);
    setOrganizationName("karakaxa");
}
开发者ID:tavu,项目名称:karakaxa,代码行数:7,代码来源:application.cpp

示例15: QApplication

IDEApplication::IDEApplication(int& argc, char **argv)
    : QApplication(argc, argv),
      mSettings(NULL)
{
    setOrganizationName(PROJECT_ORGANIZATION);
    setApplicationName(PROJECT_NAME);
    setApplicationVersion(PROJECT_VERSION);
    setWindowIcon(QIcon(":/images/arduide.png"));

    // translation support
    initializeTranslator();

    // fix the data path
    mDataPath = QDir(DATA_PATH).absolutePath();

    registerMetaTypes();

    // initialize Grantlee
    initializeTemplates();

    // start the GUI
    initializeGui();

    // check the settings are correct, or start the wizard
    initializeSettings();

    // further gui initialization
    mMainWindow->initialize();

    // initialize the plugins
    initializePlugins();
}
开发者ID:coolshou,项目名称:arduide,代码行数:32,代码来源:IDEApplication.cpp


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