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


C++ QCoreApplication::property方法代码示例

本文整理汇总了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);
}
开发者ID:josephgreer,项目名称:ultrasteer,代码行数:13,代码来源:ctkErrorLogQtMessageHandler.cpp

示例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;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:101,代码来源:qtestblacklist.cpp


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