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


C++ qVersion函数代码示例

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


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

示例1: saveToSettings

void SettingsDialog::accept()
{
    saveToSettings();
    // Due to a bug in Qt <= 4.5.1, enabling/disabling cache requires the browser to be restarted.
    if (QLatin1String(qVersion()) <= QLatin1String("4.5.1") && networkCache->isChecked() != m_cacheEnabled) {
        QMessageBox::information(this, tr("Restart required"),
                                 tr("The network cache configuration has changed. "
                                    "So that it can be taken into account, the browser has to be restarted."));
    }
    QDialog::accept();
}
开发者ID:lionhearting,项目名称:arora,代码行数:11,代码来源:settings.cpp

示例2: QMainWindow

MaraServerWindow::MaraServerWindow() : QMainWindow()
{
	setupUi(this);
	setWindowIcon(QIcon(":images/MaraServer.ico"));
	setObjectName("MaraServerWindow");
	qteConsole->setFont(QFont("Courier New", 8));
	_hidden = false;
	_wasMaximized = false;

	setWindowTitle(QString("Mara Server 2.2.7 - Qt %1").arg(qVersion()));
}
开发者ID:Darineth,项目名称:Mara-2,代码行数:11,代码来源:MaraServerWindow.cpp

示例3: QDialog

AboutDialog::AboutDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    ui->setupUi(this);
    QString text = QString("<h1>%1</h1>QT v.%2<br>bzlib v.%3")
            .arg(CommonData::getInstance()->getAppId())
            .arg(qVersion())
            .arg(BZ2_bzlibVersion());
    this->ui->text->setText(text);
}
开发者ID:mirkoviviani76,项目名称:gestcoll,代码行数:11,代码来源:aboutdialog.cpp

示例4: switch

/*!
    Returns the version of QSystemInfo::Version \a type, with optional platform dependent
    \a parameter as a string.

    In case of error or not available, an empty string is returned.
*/
QString QSystemInfo::version(QSystemInfo::Version type, const QString &parameter)
{
    switch(type) {
    case QSystemInfo::QtMobility:
        return QLatin1String(QTM_VERSION_STR);
    case QSystemInfo::QtCore:
        return QString(qVersion());
    default:
        return sysinfoPrivate()->version(type, parameter);
    }
}
开发者ID:KDE,项目名称:android-qt-mobility,代码行数:17,代码来源:qsystemgeneralinfo.cpp

示例5: QDialog

QtAboutWidget::QtAboutWidget() : QDialog() {
#ifndef Q_OS_MAC
	setWindowTitle(QString(tr("About %1")).arg("Swift"));
#endif
	setWindowIcon(QIcon(":/logo-icon-16.png"));

	resize(180, 240);
	QVBoxLayout *mainLayout = new QVBoxLayout(this);
	mainLayout->setAlignment(Qt::AlignHCenter);
	setLayout(mainLayout);
	
	QLabel* iconLabel = new QLabel(this);
	iconLabel->setPixmap(QIcon(":/logo-shaded-text.256.png").pixmap(90, 90));
	iconLabel->setAlignment(Qt::AlignHCenter);
	mainLayout->addWidget(iconLabel);
	
	QLabel* appNameLabel = new QLabel("<center><font size='+1'><b>" + QCoreApplication::applicationName() + "</b></font></center>", this);
	mainLayout->addWidget(appNameLabel);
	
	QLabel* versionLabel = new QLabel(QString("<center><font size='-1'>") + tr("Version %1").arg(QCoreApplication::applicationVersion()) + "</font></center>", this);
	mainLayout->addWidget(versionLabel);

	QString buildString = QString("<center><font size='-1'>") + QString(tr("Built with Qt %1")).arg(QT_VERSION_STR);
	buildString += QString("<br/>") + QString(tr("Running with Qt %1")).arg(qVersion());
	buildString += "</font></center>";
	QLabel* buildLabel = new QLabel(buildString, this);
	mainLayout->addWidget(buildLabel);

	if (QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR") != "TRANSLATION_AUTHOR") {
		mainLayout->addWidget(new QLabel(QString("<center><font size='-1'>") + QString(tr("Using the English translation by\n%1")).arg(QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_AUTHOR")).replace("\n", "<br/>") + "</font></center>", this));
	}
	QCoreApplication::translate("TRANSLATION_INFO", "TRANSLATION_LICENSE", "This string contains the license under which this translation is licensed. We ask you to license the translation under the BSD license. Please read http://www.opensource.org/licenses/bsd-license.php, and if you agree to release your translation under this license, use the following (untranslated) text: 'This translation is licensed under the BSD License. See http://www.opensource.org/licenses/bsd-license.php'");
#if defined(SWIFTEN_PLATFORM_WINDOWS) || defined(SWIFTEN_PLATFORM_MACOSX)
	QPushButton* licenseButton = new QPushButton(tr("View License"), this);
	mainLayout->addWidget(licenseButton);
	connect(licenseButton, SIGNAL(clicked()), this, SLOT(handleLicenseClicked()));
#else
	// Some Linux desktops have dialog window decorations without close window buttons.
	// This code adds a dedicated button to close the about window dialog.
	QHBoxLayout* buttonLayout = new QHBoxLayout();
	mainLayout->addLayout(buttonLayout);

	QPushButton* licenseButton = new QPushButton(tr("View License"), this);
	buttonLayout->addWidget(licenseButton);
	connect(licenseButton, SIGNAL(clicked()), this, SLOT(handleLicenseClicked()));

	buttonLayout->addItem(new QSpacerItem(20,20));

	QPushButton* closeButton = new QPushButton(tr("Close"), this);
	buttonLayout->addWidget(closeButton);
	connect(closeButton, SIGNAL(clicked()), this, SLOT(accept()));
#endif
	setFixedSize(minimumSizeHint());
}
开发者ID:scopeInfinity,项目名称:swift,代码行数:54,代码来源:QtAboutWidget.cpp

示例6: QString

void MainWindow::showAbout()
{
    QString info;
    info += QString("QConnect %1\n\n").arg(VERSION);
    info += "Simple TCP/IP server & client.\n";
    info += "Author: Kuba Sejdak\n";
    info += "Contact: [email protected]\n\n";
    info += QString("Compiled with: Qt %1").arg(qVersion());

    QMessageBox::information(this, "About QConnect", info, QMessageBox::Ok);
}
开发者ID:ksejdak,项目名称:qconnect,代码行数:11,代码来源:MainWindow.cpp

示例7: tableWidgetUpdateBug

void tableWidgetUpdateBug(QTableWidget* table)
{
	//this is for a bug appeared in Qt 4.5.3. The bug seems to be solved in Qt subsequent versions.

	QString buggy1=QString("4.5.3");
	QString crtVersion=qVersion();
	if(crtVersion==buggy1){
		if(table->viewport())
			table->viewport()->update();
	}
}
开发者ID:RaminNietzsche,项目名称:POSFET,代码行数:11,代码来源:tablewidgetupdatebug.cpp

示例8: main

int main(int argc, char *argv[])
{
    qRegisterMetaType<CurrentStatusUpdate>("CurrentStatusUpdate");
    qRegisterMetaType<Items>("Items");
    qRegisterMetaType<std::vector<std::string>>("std::vector<std::string>");
    qRegisterMetaType<QsLogging::Level>("QsLogging::Level");

    QLocale::setDefault(QLocale::C);

//#if defined(CRASHRPT) && !defined(DEBUG)
//    CR_INSTALL_INFOW info;
//    memset(&info, 0, sizeof(CR_INSTALL_INFOW));
//    info.cb = sizeof(CR_INSTALL_INFOW);
//    info.pszAppName = L"Acquisition";
//    info.pszAppVersion = L"0.0";
//    info.pszUrl = L"https://xyz.is/acquisition/utils/crashrpt.php";
//    CrAutoInstallHelper cr_install_helper(&info);
//#endif

    InitModlist();

    QApplication a(argc, argv);
    Filesystem::Init();

    QCommandLineParser parser;
    QCommandLineOption option_data_dir("data-dir", "Where to save Acquisition data.", "data-dir");
    parser.addOption(option_data_dir);
    parser.process(a);

    if (parser.isSet(option_data_dir))
        Filesystem::SetUserDir(parser.value(option_data_dir).toStdString());

    QsLogging::Logger& logger = QsLogging::Logger::instance();
    logger.setLoggingLevel(QsLogging::InfoLevel);
    const QString sLogPath(QDir(Filesystem::UserDir().c_str()).filePath("log.txt"));

    QsLogging::DestinationPtr fileDestination(
        QsLogging::DestinationFactory::MakeFileDestination(sLogPath, true, 10 * 1024 * 1024, 0) );
    QsLogging::DestinationPtr debugDestination(
        QsLogging::DestinationFactory::MakeDebugOutputDestination() );
    logger.addDestination(debugDestination);
    logger.addDestination(fileDestination);

    qApp->setStyle(QStyleFactory::create("Fusion"));

    QLOG_INFO() << "--------------------------------------------------------------------------------";
    QLOG_INFO() << "Built with Qt" << QT_VERSION_STR << "running on" << qVersion();

    LoginDialog login(std::make_unique<Application>());
    login.show();

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

示例9: initLogger

void initLogger(QsLogging::Level logLevel)
{
	QsLogging::Logger &logger = QsLogging::Logger::instance();
	QsLogging::DestinationPtr debugDestination(
			QsLogging::DestinationFactory::MakeDebugOutputDestination() );
	logger.addDestination(debugDestination);

	QLOG_INFO() << "dbus_modbustcp" << "v" VERSION << "started";
	QLOG_INFO() << "Built with Qt" << QT_VERSION_STR << "running on" << qVersion();
	QLOG_INFO() << "Built on" << __DATE__ << "at" << __TIME__;
	logger.setLoggingLevel(logLevel);
}
开发者ID:victronenergy,项目名称:dbus_modbustcp,代码行数:12,代码来源:main.cpp

示例10: QLatin1String

QNetworkReply* NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
{
    QString agentStr = QString::fromLatin1("%1/%2 (QNetworkAccessManager %3; %4; %5; %6 bit)")
                    .arg(QCoreApplication::applicationName(),
                         QCoreApplication::applicationVersion(),
                         QLatin1String(qVersion()),
                         getOsString(), QLocale::system().name())
                    .arg(QSysInfo::WordSize);
    QNetworkRequest req(request);
    req.setRawHeader("User-Agent", agentStr.toLatin1());
    return QNetworkAccessManager::createRequest(op, req, outgoingData);
}
开发者ID:C-sjia,项目名称:qt-creator,代码行数:12,代码来源:networkaccessmanager.cpp

示例11: QDialog

DiagnosticsDialog::DiagnosticsDialog( QWidget *parent )
:	QDialog( parent )
{
	setupUi( this );
	setAttribute( Qt::WA_DeleteOnClose, true );

	QString info;
	QTextStream s( &info );

	s << "<b>" << tr("Locale (time-, number format / codepage):") << "</b> ";
	QLocale::Language language = QLocale::system().language();
	QString locale = (language == QLocale::C ? "English/United States" : QLocale::languageToString( language ) );
	CPINFOEX CPInfoEx;
	if ( GetCPInfoEx( GetConsoleCP(), 0, &CPInfoEx ) != 0 )
		locale.append( " / " ).append( CPInfoEx.CodePageName );
	s << locale << "<br />";
	s << "<b>" << tr("User rights: ") << "</b>" << getUserRights() << "<br />";

	QStringList base = Common::packages( QStringList() << "Eesti ID kaardi tarkvara", false );
	if ( !base.isEmpty() )
		s << "<b>" << tr("Base version:") << "</b> " << base.join( "<br />" ) << "<br />";
	s << "<b>" << tr("ID-card utility version:") << "</b> "<< QCoreApplication::applicationVersion() << "<br />";

	s << "<b>" << tr("OS:") << "</b> " << Common::applicationOs() << "<br />";
	s << "<b>" << tr("CPU:") << "</b> " << getProcessor() << "<br /><br />";

	s << "<b>" << tr("Library paths:") << "</b> " << QCoreApplication::libraryPaths().join( ";" ) << "<br />";

	s << "<b>" << tr("Libraries") << ":</b><br />";
	s << getLibVersion( "digidoc" ) << "<br />";
	s << getLibVersion( "digidocpp" ) << "<br />";
	s << getLibVersion( "advapi32" ) << "<br />";
	s << getLibVersion( "crypt32" ) << "<br />";
	s << getLibVersion( "winscard" ) << "<br />";
	s << getLibVersion( "esteidcsp|esteidcm" ) << "<br />";
	s << getLibVersion( "libeay32" ) << "<br />";
	s << getLibVersion( "ssleay32" ) << "<br />";
	s << getLibVersion( "opensc-pkcs11" ) << "<br />";
	s << "QT (" << qVersion() << ")<br />" << "<br />";

	s << "<b>" << tr("Smart Card service status: ") << "</b>" << " " << (isPCSCRunning() ? tr("Running") : tr("Not running")) << "<br /><br />";

	s << "<b>" << tr("Card readers") << ":</b><br />" << getReaderInfo() << "<br />";

	QStringList browsers = Common::packages( QStringList() << "Mozilla" << "Google Chrome" );
	QSettings reg( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer", QSettings::NativeFormat );
	browsers << QString( "Internet Explorer (%1)" ).arg( reg.value( "Version" ).toString() );
	s << "<b>" << tr("Browsers:") << "</b><br />" << browsers.join( "<br />" ) << "<br /><br />";

	diagnosticsText->setHtml( info );

	details = buttonBox->addButton( tr( "More info" ), QDialogButtonBox::HelpRole );
}
开发者ID:Krabi,项目名称:idkaart_public,代码行数:53,代码来源:DiagnosticsDialog_win.cpp

示例12: printVersion

static void printVersion()
{
	QTextStream str(stdout);
	str << qApp->applicationName() << " version " << versionString() << endl
		<< "Using Qt version " << qVersion() << endl
		<< "GPL v3 or any later" << endl;
//	foreach (Plugin *plugin, p->plugins) {
//		PluginInfo info = plugin->info();
//		str << "  " << info.name() << ' ' << formatVersion(info.version())
//			<< ' ' << info.description() <<  '\n';
//	}
}
开发者ID:nico-izo,项目名称:qutim,代码行数:12,代码来源:modulemanager.cpp

示例13: initLogger

void initLogger(QsLogging::Level logLevel)
{
	// init the logging mechanism
	QsLogging::DestinationPtr debugDestination(
			QsLogging::DestinationFactory::MakeDebugOutputDestination() );
	logger.addDestination(debugDestination);

	QLOG_INFO() << "dbus_qwacs" << "v" VERSION << "started";
	QLOG_INFO() << "Built with Qt" << QT_VERSION_STR << "running on" << qVersion();
	QLOG_INFO() << "Built on" << __DATE__ << "at" << __TIME__;
	logger.setLoggingLevel(logLevel);
}
开发者ID:victronenergy,项目名称:dbus_qwacs,代码行数:12,代码来源:main.cpp

示例14: QDialog

AboutDialog::AboutDialog(QWidget* parent_)
  : QDialog(parent_), m_ui(new Ui::AboutDialog)
{
  m_ui->setupUi(this);

  QString html("<html><head/><body><p>" \
               "<span style=\" font-size:%1pt; font-weight:600;\">%2</span>" \
               "</p></body></html>");

  m_ui->version->setText(html.arg("20").arg(MoleQueue_VERSION));
  m_ui->qtVersion->setText(html.arg("10").arg(qVersion()));
}
开发者ID:OpenChemistry,项目名称:molequeue,代码行数:12,代码来源:aboutdialog.cpp

示例15: qVersion

void QTestLightXmlStreamer::output(QTestElement *element) const
{
    QTestCharBuffer buf;
    QTest::qt_asprintf(&buf, "<Environment>\n    <QtVersion>%s</QtVersion>\n    <QTestVersion>%s</QTestVersion>\n",
                       qVersion(), QTEST_VERSION_STR );
    outputString(buf.constData());

    QTest::qt_asprintf(&buf, "</Environment>\n");
    outputString(buf.constData());

    QTestBasicStreamer::output(element);
}
开发者ID:venkatarajasekhar,项目名称:ECE497,代码行数:12,代码来源:qtestlightxmlstreamer.cpp


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