本文整理汇总了C++中QCoreApplication::property方法的典型用法代码示例。如果您正苦于以下问题:C++ QCoreApplication::property方法的具体用法?C++ QCoreApplication::property怎么用?C++ QCoreApplication::property使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCoreApplication
的用法示例。
在下文中一共展示了QCoreApplication::property方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Superclass
// --------------------------------------------------------------------------
ctkErrorLogQtMessageHandler::ctkErrorLogQtMessageHandler() : Superclass()
{
this->SavedQtMessageHandler = 0;
QCoreApplication * coreApp = QCoreApplication::instance();
// Keep track of all instantiated ctkErrorLogModel
QList<QVariant> handlers = coreApp->property("ctkErrorLogQtMessageHandlers").toList();
handlers << QVariant::fromValue(this);
//handlers << QVariant::fromValue(QPointer<ctkErrorLogQtMessageHandler>(this));
coreApp->setProperty("ctkErrorLogQtMessageHandlers", handlers);
}
示例2: with
//.........这里部分代码省略.........
A key names a platform, O/S, distribution, tool-chain or architecture; a !
prefix reverses what it checks. A version, joined to a key (at present, only
for distributions and for msvc) with a hyphen, limits the key to the specific
version. A keyword line matches if every key on it applies to the present
run. Successive lines are alternate conditions for ignoring a test.
Ungrouped lines at the beginning of a file apply to the whole testcase.
A group starts with a [square-bracketed] identification of a test function,
optionally with (after a colon, the name of) a specific data set, to ignore.
Subsequent lines give conditions for ignoring this test.
# See qtbase/src/testlib/qtestblacklist.cpp for format
osx
# QTBUG-12345
[testFunction]
linux
windows 64bit
# Needs basic C++11 support
[testfunction2:testData]
msvc-2010
Keys are lower-case. Distribution name and version are supported if
QSysInfo's productType() and productVersion() return them.
The other known keys are listed below:
*/
static QSet<QByteArray> keywords()
{
// this list can be extended with new keywords as required
QSet<QByteArray> set = QSet<QByteArray>()
<< "*"
#ifdef Q_OS_LINUX
<< "linux"
#endif
#ifdef Q_OS_OSX
<< "osx"
#endif
#ifdef Q_OS_WIN
<< "windows"
#endif
#ifdef Q_OS_IOS
<< "ios"
#endif
#ifdef Q_OS_ANDROID
<< "android"
#endif
#ifdef Q_OS_QNX
<< "qnx"
#endif
#ifdef Q_OS_WINRT
<< "winrt"
#endif
#ifdef Q_OS_WINCE
<< "wince"
#endif
#if QT_POINTER_SIZE == 8
<< "64bit"
#else
<< "32bit"
#endif
#ifdef Q_CC_GNU
<< "gcc"
#endif
#ifdef Q_CC_CLANG
<< "clang"
#endif
#ifdef Q_CC_MSVC
<< "msvc"
#ifdef _MSC_VER
#if _MSC_VER == 1900
<< "msvc-2015"
#elif _MSC_VER == 1800
<< "msvc-2013"
#elif _MSC_VER == 1700
<< "msvc-2012"
#elif _MSC_VER == 1600
<< "msvc-2010"
#endif
#endif
#endif
#ifdef Q_AUTOTEST_EXPORT
<< "developer-build"
#endif
;
QCoreApplication *app = QCoreApplication::instance();
if (app) {
const QVariant platformName = app->property("platformName");
if (platformName.isValid())
set << platformName.toByteArray();
}
return set;
}