本文整理汇总了C++中qtsupport::BaseQtVersion::qtVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseQtVersion::qtVersion方法的具体用法?C++ BaseQtVersion::qtVersion怎么用?C++ BaseQtVersion::qtVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtsupport::BaseQtVersion
的用法示例。
在下文中一共展示了BaseQtVersion::qtVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateFiles
Core::GeneratedFiles ClassWizard::generateFiles(const QWizard *w,
QString *errorMessage) const
{
Q_UNUSED(errorMessage);
const ClassWizardDialog *wizard = qobject_cast<const ClassWizardDialog *>(w);
const ClassWizardParameters params = wizard->parameters();
const QString fileName = Core::BaseFileWizard::buildFileName(
params.path, params.fileName, QLatin1String(Constants::C_PY_EXTENSION));
Core::GeneratedFile sourceFile(fileName);
SourceGenerator generator;
generator.setPythonQtBinding(SourceGenerator::PySide);
Kit *kit = kitForWizard(wizard);
if (kit) {
QtSupport::BaseQtVersion *baseVersion = QtSupport::QtKitInformation::qtVersion(kit);
if (baseVersion && baseVersion->qtVersion().majorVersion == 5)
generator.setPythonQtVersion(SourceGenerator::Qt5);
else
generator.setPythonQtVersion(SourceGenerator::Qt4);
}
QString sourceContent = generator.generateClass(
params.className, params.baseClass, params.classType
);
sourceFile.setContents(sourceContent);
sourceFile.setAttributes(Core::GeneratedFile::OpenEditorAttribute);
return Core::GeneratedFiles() << sourceFile;
}
示例2: deducedArguments
QMakeStepConfig QMakeStep::deducedArguments()
{
ProjectExplorer::Kit *kit = target()->kit();
QMakeStepConfig config;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(kit);
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
config.archConfig = QMakeStepConfig::targetArchFor(targetAbi, version);
config.osType = QMakeStepConfig::osTypeFor(targetAbi, version);
if (linkQmlDebuggingLibrary() && version && version->qtVersion().majorVersion >= 5)
config.linkQmlDebuggingQQ2 = true;
if (useQtQuickCompiler() && version)
config.useQtQuickCompiler = true;
if (separateDebugInfo())
config.separateDebugInfo = true;
return config;
}
示例3: switch
QList<Core::Id> QmlProjectRunConfigurationFactory::availableCreationIds(ProjectExplorer::Target *parent) const
{
if (!canHandle(parent))
return QList<Core::Id>();
QtSupport::BaseQtVersion *version
= QtSupport::QtKitInformation::qtVersion(parent->kit());
// First id will be the default run configuration
QList<Core::Id> list;
if (version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0)) {
QmlProject *project = static_cast<QmlProject*>(parent->project());
switch (project->defaultImport()) {
case QmlProject::QtQuick1Import:
list << Core::Id(Constants::QML_VIEWER_RC_ID);
break;
case QmlProject::QtQuick2Import:
list << Core::Id(Constants::QML_SCENE_RC_ID);
break;
case QmlProject::UnknownImport:
default:
list << Core::Id(Constants::QML_SCENE_RC_ID);
list << Core::Id(Constants::QML_VIEWER_RC_ID);
break;
}
} else {
list << Core::Id(Constants::QML_VIEWER_RC_ID);
}
return list;
}
示例4: pathToQt
QString DesignDocumentController::pathToQt() const
{
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::instance()->version(d->qt_versionId);
if (activeQtVersion && (activeQtVersion->qtVersion().majorVersion > 3)
&& (activeQtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|| activeQtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)))
return activeQtVersion->qmakeProperty("QT_INSTALL_DATA");
return QString();
}
示例5: pathToQt
QString DesignDocumentController::pathToQt() const
{
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::instance()->version(d->qt_versionId);
if (activeQtVersion && (activeQtVersion->qtVersion().majorVersion > 3)
&& (activeQtVersion->supportsTargetId(Qt4ProjectManager::Constants::QT_SIMULATOR_TARGET_ID)
|| activeQtVersion->supportsTargetId(Qt4ProjectManager::Constants::DESKTOP_TARGET_ID)))
return activeQtVersion->versionInfo().value("QT_INSTALL_DATA");
return QString();
}
示例6: pathToQt
QString DesignDocument::pathToQt() const
{
QtSupport::BaseQtVersion *activeQtVersion = QtSupport::QtVersionManager::version(m_qtVersionId);
if (activeQtVersion && (activeQtVersion->qtVersion() >= QtSupport::QtVersionNumber(4, 7, 1))
&& (activeQtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|| activeQtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)))
return activeQtVersion->qmakeProperty("QT_INSTALL_DATA");
return QString();
}
示例7: deducedArguments
///
/// moreArguments,
/// -unix for Maemo
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
QStringList arguments;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainProfileInformation::toolChain(target()->profile());
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
if ((targetAbi.osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
|| targetAbi.osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
arguments << QLatin1String("-unix");
#endif
// explicitly add architecture to CONFIG
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=x86");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=x86_64");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=ppc");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=ppc64");
}
}
QtSupport::BaseQtVersion *version = QtSupport::QtProfileInformation::qtVersion(target()->profile());
if (linkQmlDebuggingLibrary() && version) {
if (!version->needsQmlDebuggingLibrary()) {
// This Qt version has the QML debugging services built in, however
// they still need to be enabled at compile time
arguments << (version->qtVersion().majorVersion >= 5 ?
QLatin1String(Constants::QMAKEVAR_DECLARATIVE_DEBUG5) :
QLatin1String(Constants::QMAKEVAR_DECLARATIVE_DEBUG4));
} else {
const QString qmlDebuggingHelperLibrary = version->qmlDebuggingHelperLibrary(true);
if (!qmlDebuggingHelperLibrary.isEmpty()) {
// Do not turn debugger path into native path separators: Qmake does not like that!
const QString debuggingHelperPath
= QFileInfo(qmlDebuggingHelperLibrary).dir().path();
arguments << QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)
+ QLatin1Char('=') + debuggingHelperPath;
}
}
}
return arguments;
}
示例8: fromMap
bool AndroidDeployStep::fromMap(const QVariantMap &map)
{
m_deployAction = AndroidDeployAction(map.value(QLatin1String(DEPLOY_ACTION_KEY), NoDeploy).toInt());
QVariant useLocalQt = map.value(QLatin1String(USE_LOCAL_QT_KEY));
if (useLocalQt.isValid()) { // old settings
if (useLocalQt.toBool() && m_deployAction == NoDeploy)
m_deployAction = BundleLibraries;
}
if (m_deployAction == InstallQASI)
m_deployAction = NoDeploy;
QtSupport::BaseQtVersion *qtVersion
= QtSupport::QtKitInformation::qtVersion(target()->kit());
if (m_deployAction == BundleLibraries)
if (!qtVersion || qtVersion->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0))
m_deployAction = NoDeploy; // the kit changed to a non qt5 kit
m_bundleQtAvailable = qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0);
return ProjectExplorer::BuildStep::fromMap(map);
}
示例9: qtIsSupported
bool PuppetCreator::qtIsSupported() const
{
QtSupport::BaseQtVersion *currentQtVersion = QtSupport::QtKitInformation::qtVersion(m_kit);
if (currentQtVersion
&& currentQtVersion->isValid()
&& currentQtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 2, 0)
&& (currentQtVersion->type() == QLatin1String(QtSupport::Constants::DESKTOPQT)
|| currentQtVersion->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)))
return true;
return false;
}
示例10:
QList<Core::Id> AndroidDeployQtStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
{
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
return QList<Core::Id>();
if (!AndroidManager::supportsAndroid(parent->target()))
return QList<Core::Id>();
if (parent->contains(AndroidDeployQtStep::Id))
return QList<Core::Id>();
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(parent->target()->kit());
if (!qtVersion || qtVersion->qtVersion() < QtSupport::QtVersionNumber(5, 2, 0))
return QList<Core::Id>();
return QList<Core::Id>() << AndroidDeployQtStep::Id;
}
示例11: supportsKit
bool GoProject::supportsKit(ProjectExplorer::Kit *k, QString *errorMessage) const
{
Id deviceType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k);
if (deviceType != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) {
if (errorMessage)
*errorMessage = tr("Device type is not desktop.");
return false;
}
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(k);
if (!version) {
if (errorMessage)
*errorMessage = tr("No Qt version set in kit.");
return false;
}
#if 0
if (version->qtVersion() < QtSupport::QtVersionNumber(4, 7, 0)) {
if (errorMessage)
*errorMessage = tr("Qt version is too old.");
return false;
}
if (version->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0)
&& defaultImport() == QtQuick2Import) {
if (errorMessage)
*errorMessage = tr("Qt version is too old.");
return false;
}
#endif
if (!GoToolChainKitInformation::toolChain(k)) {
if (errorMessage)
*errorMessage = tr("No Go toolchain is set in the Kit.");
return false;
}
return true;
}
示例12: minimumVersion
IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
QmlProfilerEngine *engine = new QmlProfilerEngine(this, sp, runConfiguration);
engine->registerProfilerStateManager(d->m_profilerState);
bool isTcpConnection = true;
if (runConfiguration) {
// Check minimum Qt Version. We cannot really be sure what the Qt version
// at runtime is, but guess that the active build configuraiton has been used.
QtSupport::QtVersionNumber minimumVersion(4, 7, 4);
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(runConfiguration->target()->kit());
if (version) {
if (version->isValid() && version->qtVersion() < minimumVersion) {
int result = QMessageBox::warning(QApplication::activeWindow(), tr("QML Profiler"),
tr("The QML profiler requires Qt 4.7.4 or newer.\n"
"The Qt version configured in your active build configuration is too old.\n"
"Do you want to continue?"), QMessageBox::Yes, QMessageBox::No);
if (result == QMessageBox::No)
return 0;
}
}
}
// FIXME: Check that there's something sensible in sp.connParams
if (isTcpConnection) {
d->m_profilerConnections->setTcpConnection(sp.connParams.host, sp.connParams.port);
}
d->m_runConfiguration = runConfiguration;
//
// Initialize m_projectFinder
//
QString projectDirectory;
if (d->m_runConfiguration) {
Project *project = d->m_runConfiguration->target()->project();
projectDirectory = project->projectDirectory();
}
populateFileFinder(projectDirectory, sp.sysroot);
connect(engine, SIGNAL(processRunning(quint16)), d->m_profilerConnections, SLOT(connectClient(quint16)));
connect(d->m_profilerConnections, SIGNAL(connectionFailed()), engine, SLOT(cancelProcess()));
return engine;
}
示例13: kitUpdated
void AndroidDeployStep::kitUpdated(Kit *kit)
{
if (kit != target()->kit())
return;
QtSupport::BaseQtVersion *qtVersion
= QtSupport::QtKitInformation::qtVersion(target()->kit());
bool newBundleQtAvailable = qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0);
if (m_bundleQtAvailable != newBundleQtAvailable) {
m_bundleQtAvailable = newBundleQtAvailable;
if (!m_bundleQtAvailable && m_deployAction == BundleLibraries)
m_deployAction = NoDeploy; // the kit changed to a non qt5 kit
emit deployOptionsChanged();
}
}
示例14: canCreate
bool QmlProjectRunConfigurationFactory::canCreate(ProjectExplorer::Target *parent,
const Core::Id id) const
{
if (!canHandle(parent))
return false;
if (id == Constants::QML_VIEWER_RC_ID)
return true;
if (id == Constants::QML_SCENE_RC_ID) {
// only support qmlscene if it's Qt5
QtSupport::BaseQtVersion *version
= QtSupport::QtKitInformation::qtVersion(parent->kit());
return version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0);
}
return false;
}
示例15: deducedArguments
///
/// moreArguments,
/// iphoneos/iphonesimulator for ios
/// QMAKE_VAR_QMLJSDEBUGGER_PATH
QStringList QMakeStep::deducedArguments()
{
QStringList arguments;
ProjectExplorer::ToolChain *tc
= ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
ProjectExplorer::Abi targetAbi;
if (tc)
targetAbi = tc->targetAbi();
// explicitly add architecture to CONFIG
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=x86");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=x86_64");
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // from Ios::Constants (include header?)
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (version && version->type() == QLatin1String(IOSQT))
arguments << QLatin1String("CONFIG+=iphonesimulator");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::PowerPCArchitecture) {
if (targetAbi.wordWidth() == 32)
arguments << QLatin1String("CONFIG+=ppc");
else if (targetAbi.wordWidth() == 64)
arguments << QLatin1String("CONFIG+=ppc64");
} else if (targetAbi.architecture() == ProjectExplorer::Abi::ArmArchitecture) {
arguments << QLatin1String("CONFIG+=iphoneos");
}
}
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
if (linkQmlDebuggingLibrary() && version) {
arguments << QLatin1String(Constants::QMAKEVAR_QUICK1_DEBUG);
if (version->qtVersion().majorVersion >= 5)
arguments << QLatin1String(Constants::QMAKEVAR_QUICK2_DEBUG);
}
return arguments;
}