本文整理汇总了C++中qVersion函数的典型用法代码示例。如果您正苦于以下问题:C++ qVersion函数的具体用法?C++ qVersion怎么用?C++ qVersion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qVersion函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ¶meter)
{
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
示例16: qInfo
GuiApplicationImpl::GuiApplicationImpl()
:
#ifndef NDEBUG
owner{std::this_thread::get_id()},
#endif
app{argc, &argv}
{
// Set locale back to POSIX for the decimal point parsing (see qcoreapplication.html#locale-settings).
std::locale::global(std::locale().combine<std::numpunct<char>>(std::locale::classic()));
qInfo() << "Compiled with Qt" << QT_VERSION_STR << "and run with Qt" << qVersion();
}
开发者ID:SFTtech,项目名称:openage,代码行数:12,代码来源:gui_application_impl.cpp
示例17: QTestElement
void QTestLogger::stopLogging()
{
QTestElement *iterator = listOfTestcases;
if(format == TLF_XunitXml ){
char buf[10];
currentLogElement = new QTestElement(QTest::LET_TestSuite);
currentLogElement->addAttribute(QTest::AI_Name, QTestResult::currentTestObjectName());
QTest::qt_snprintf(buf, sizeof(buf), "%i", testCounter);
currentLogElement->addAttribute(QTest::AI_Tests, buf);
QTest::qt_snprintf(buf, sizeof(buf), "%i", failureCounter);
currentLogElement->addAttribute(QTest::AI_Failures, buf);
QTest::qt_snprintf(buf, sizeof(buf), "%i", errorCounter);
currentLogElement->addAttribute(QTest::AI_Errors, buf);
QTestElement *property;
QTestElement *properties = new QTestElement(QTest::LET_Properties);
property = new QTestElement(QTest::LET_Property);
property->addAttribute(QTest::AI_Name, "QTestVersion");
property->addAttribute(QTest::AI_PropertyValue, QTEST_VERSION_STR);
properties->addLogElement(property);
property = new QTestElement(QTest::LET_Property);
property->addAttribute(QTest::AI_Name, "QtVersion");
property->addAttribute(QTest::AI_PropertyValue, qVersion());
properties->addLogElement(property);
currentLogElement->addLogElement(properties);
currentLogElement->addLogElement(iterator);
/* For correct indenting, make sure every testcase knows its parent */
QTestElement* testcase = iterator;
while (testcase) {
testcase->setParent(currentLogElement);
testcase = testcase->nextElement();
}
currentLogElement->addLogElement(errorLogElement);
QTestElement *it = currentLogElement;
logFormatter->output(it);
}else{
logFormatter->output(iterator);
}
logFormatter->stopStreaming();
}
开发者ID:husninazer,项目名称:qt,代码行数:53,代码来源:qtestlogger.cpp
示例18: qVersion
qint64 SQLiteModDbi::getNearestUserModStepVersion(const U2DataId &masterObjId, qint64 version, U2OpStatus &os) {
SQLiteReadQuery qVersion("SELECT MAX(version) FROM UserModStep WHERE object = ?1 AND version <= ?2", db, os);
qVersion.bindDataId(1, masterObjId);
qVersion.bindInt64(2, version);
qint64 userStepVersion = version;
if (qVersion.step()) {
userStepVersion = qVersion.getInt64(0);
}
SAFE_POINT_OP(os, userStepVersion);
return userStepVersion;
}
开发者ID:ggrekhov,项目名称:ugene,代码行数:12,代码来源:SQLiteModDbi.cpp
示例19: arguments
bool QmlProfilerApplication::parseArguments()
{
for (int argPos = 1; argPos < arguments().size(); ++argPos) {
const QString arg = arguments().at(argPos);
if (arg == QLatin1String("-attach") || arg == QLatin1String("-a")) {
if (argPos + 1 == arguments().size()) {
return false;
}
m_hostName = arguments().at(++argPos);
m_runMode = AttachMode;
} else if (arg == QLatin1String("-port") || arg == QLatin1String("-p")) {
if (argPos + 1 == arguments().size()) {
return false;
}
const QString portStr = arguments().at(++argPos);
bool isNumber;
m_port = portStr.toUShort(&isNumber);
if (!isNumber) {
logError(QString("'%1' is not a valid port").arg(portStr));
return false;
}
} else if (arg == QLatin1String("-fromStart")) {
m_qmlProfilerClient.setRecording(true);
m_v8profilerClient.setRecording(true);
} else if (arg == QLatin1String("-help") || arg == QLatin1String("-h") || arg == QLatin1String("/h") || arg == QLatin1String("/?")) {
return false;
} else if (arg == QLatin1String("-verbose") || arg == QLatin1String("-v")) {
m_verbose = true;
} else if (arg == QLatin1String("-version")) {
print(QString("QML Profiler based on Qt %1.").arg(qVersion()));
::exit(1);
return false;
} else {
if (m_programPath.isEmpty()) {
m_programPath = arg;
m_tracePrefix = QFileInfo(m_programPath).fileName();
} else {
m_programArguments << arg;
}
}
}
if (m_runMode == LaunchMode
&& m_programPath.isEmpty())
return false;
if (m_runMode == AttachMode
&& !m_programPath.isEmpty())
return false;
return true;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:52,代码来源:qmlprofilerapplication.cpp
示例20: GetNaturalRotation
long GalleryUtil::GetNaturalRotation(void *exifData)
{
long rotateAngle = 0;
#ifdef EXIF_SUPPORT
// Qt 5.4.1 automatically orientates images according to their EXIF data
if (strcmp(qVersion(), "5.4.1") == 0)
return 0;
ExifData *data = (ExifData *)exifData;
if (!data)
return 0;
for (int i = 0; i < EXIF_IFD_COUNT; i++)
{
ExifEntry *entry = exif_content_get_entry(data->ifd[i],
EXIF_TAG_ORIENTATION);
ExifByteOrder byteorder = exif_data_get_byte_order(data);
if (entry)
{
ExifShort v_short = exif_get_short(entry->data, byteorder);
LOG(VB_GENERAL, LOG_DEBUG,
QString("Exif entry=%1").arg(v_short));
/* See http://sylvana.net/jpegcrop/exif_orientation.html*/
switch (v_short)
{
case 3:
rotateAngle = 180;
break;
case 6:
rotateAngle = 90;
break;
case 8:
rotateAngle = -90;
break;
default:
rotateAngle = 0;
break;
}
break;
}
}
#else
// Shut the compiler up about the unused argument
(void)exifData;
#endif // EXIF_SUPPORT
return rotateAngle;
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:52,代码来源:galleryutil.cpp
注:本文中的qVersion函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论