本文整理汇总了C++中QStyle::setName方法的典型用法代码示例。如果您正苦于以下问题:C++ QStyle::setName方法的具体用法?C++ QStyle::setName怎么用?C++ QStyle::setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStyle
的用法示例。
在下文中一共展示了QStyle::setName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keys
/*!
Creates a QStyle object that matches \a key case-insensitively.
This is either a built-in style, or a style from a style plugin.
\sa keys()
*/
QStyle *QStyleFactory::create( const QString& key )
{
QStyle *ret = 0;
QString style = key.lower();
#ifndef QT_NO_STYLE_WINDOWS
if ( style == "windows" )
ret = new QWindowsStyle;
else
#endif
#ifndef QT_NO_STYLE_WINDOWSXP
if ( style == "windowsxp" )
ret = new QWindowsXPStyle;
else
#endif
#ifndef QT_NO_STYLE_MOTIF
if ( style == "motif" )
ret = new QMotifStyle;
else
#endif
#ifndef QT_NO_STYLE_CDE
if ( style == "cde" )
ret = new QCDEStyle;
else
#endif
#ifndef QT_NO_STYLE_MOTIFPLUS
if ( style == "motifplus" )
ret = new QMotifPlusStyle;
else
#endif
#ifndef QT_NO_STYLE_PLATINUM
if ( style == "platinum" )
ret = new QPlatinumStyle;
else
#endif
#ifndef QT_NO_STYLE_SGI
if ( style == "sgi")
ret = new QSGIStyle;
else
#endif
#ifndef QT_NO_STYLE_COMPACT
if ( style == "compact" )
ret = new QCompactStyle;
else
#endif
#ifndef QT_NO_STYLE_AQUA
if ( style == "aqua" )
ret = new QAquaStyle;
#endif
#ifndef QT_NO_STYLE_POCKETPC
if ( style == "pocketpc" )
ret = new QPocketPCStyle;
#endif
#if !defined( QT_NO_STYLE_MAC ) && defined( Q_WS_MAC )
if( style.left(9) == "macintosh" )
ret = new QMacStyle;
#endif
{ } // Keep these here - they make the #ifdefery above work
#ifndef QT_NO_COMPONENT
if(!ret) {
if ( !instance )
instance = new QStyleFactoryPrivate;
QInterfacePtr<QStyleFactoryInterface> iface;
QStyleFactoryPrivate::manager->queryInterface( style, &iface );
if ( iface )
ret = iface->create( style );
}
if(ret)
ret->setName(key);
#endif
return ret;
}