本文整理汇总了C++中QApplication::applicationVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ QApplication::applicationVersion方法的具体用法?C++ QApplication::applicationVersion怎么用?C++ QApplication::applicationVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QApplication
的用法示例。
在下文中一共展示了QApplication::applicationVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showVersion
static void showVersion (const QApplication& app) {
std::cout << QString("VdomBrowser version %1\n"
"Copyright (c) 2009 by Yahoo! China EEEE Works, Alibaba Inc.\n"
).arg(app.applicationVersion()).toUtf8().data();
}
示例2: ico
BaseWindow::BaseWindow(QWidget *parent)
: QWidget(parent), ui(new Ui::BaseWindow)
{
this->setAttribute(Qt::WA_QuitOnClose, false);
serverCounter = 1;
ui->setupUi(this);
QApplication *app = (QApplication*)QApplication::instance();
this->setWindowTitle(QString("%1 %2 (v%3)").arg(app->organizationName(), app->applicationName(), app->applicationVersion()));
// Icon
QIcon ico(":resources/RKnock.ico");
this->setWindowIcon(ico);
// Find the config file, does it exist?
#ifdef Q_WS_WIN
QString fSection;
QString mSection;
QString lSection = "Settings.xml";
if (QSysInfo::windowsVersion() < QSysInfo::WV_2000)
{
// All Versions before win2000
fSection = QDir::currentPath(); // Where we are :)
mSection = "";
}
else if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA)
{
fSection = QDir::homePath();
mSection = QString("Application Data/%1/%2").arg(app->organizationName(), app->applicationName());
}
else
{
fSection = QDir::homePath();
mSection = QString("AppData/Roaming/%1/%2").arg(app->organizationName(), app->applicationName());
}
if (mSection.size() == 0)
this->cfgFileLocation = QString("%1/%2").arg(fSection, lSection);
else
this->cfgFileLocation = QString("%1/%2/%3").arg(fSection, mSection, lSection);
//this->cfgFileLocation = QtDir::homePath().append("\\").append("
#else
QString path = QString("%1/.%2/%3").arg(QDir::homePath(), app->organizationName(), app->applicationName());
QString file = QString("%1/Settings.xml").arg(path);
this->cfgFileLocation = file;
#endif
if (QFile(this->cfgFileLocation).exists())
this->loadSettings();
this->tray = new QSystemTrayIcon(this);
this->trayMenu = new QMenu(this);
this->trayServersMenu = new QMenu("Servers", this->trayMenu);
this->tray->setContextMenu(this->trayMenu);
this->tray->setIcon(ico);
this->tray->setVisible(true);
QAction *subaction = 0;
QMenu *submenu = 0;
// Open Dialog
subaction = this->trayMenu->addAction("Open Configuration Dialog...");
connect(subaction, SIGNAL(triggered()), this, SLOT(show()));
subaction = this->trayMenu->addAction("About RKnock...");
connect(subaction, SIGNAL(triggered()), this, SLOT(showAbout()));
this->trayMenu->addMenu(trayServersMenu);
this->trayMenu->addSeparator();
subaction = this->trayMenu->addAction("Exit...");
connect(subaction, SIGNAL(triggered()), app, SLOT(quit()));
connect(tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(activateMenu(QSystemTrayIcon::ActivationReason)));
this->rebuildActions();
}