22 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
26 : QConcatenateTablesProxyModel( parent )
33 return QgsStyleModel::headerDataStatic( section, orientation, role );
38 connect( style, &QgsStyle::destroyed,
this, [
this, style]()
42 removeSourceModel( model );
43 mTitleModels.remove( style );
47 if (
QgsStyleModel *model = mOwnedStyleModels.value( style ) )
49 removeSourceModel( model );
50 mOwnedStyleModels.remove( style );
53 mStyles.removeAll( style );
56 mStyles.append( style );
61 { Qt::DisplayRole, style->
name() },
62 { Qt::ToolTipRole, style->
name() },
72 addSourceModel( titleModel );
73 mTitleModels.insert( style, titleModel );
77 for ( QSize size : std::as_const( mAdditionalSizes ) )
82 addSourceModel( styleModel );
83 mOwnedStyleModels.insert( style, styleModel );
90 removeSourceModel( model );
91 mTitleModels.remove( style );
95 if (
QgsStyleModel *model = mOwnedStyleModels.value( style ) )
97 removeSourceModel( model );
98 mOwnedStyleModels.remove( style );
101 mStyles.removeAll( style );
108 if ( !defaultStyle || !styleModel )
111 mStyles.append( defaultStyle );
116 { Qt::DisplayRole, defaultStyle->
name() },
117 { Qt::ToolTipRole, defaultStyle->
name() },
128 addSourceModel( titleModel );
129 mTitleModels.insert( defaultStyle, titleModel );
131 for ( QSize size : std::as_const( mAdditionalSizes ) )
136 addSourceModel( styleModel );
146 if ( !mAdditionalSizes.contains( size ) )
147 mAdditionalSizes.append( size );
149 for (
auto it = mOwnedStyleModels.constBegin(); it != mOwnedStyleModels.constEnd(); ++it )
151 it.value()->addDesiredIconSize( size );