110 if ( !index.isValid() || index.row() >=
rowCount() )
115 if ( role == Qt::UserRole )
119 if ( role == Qt::CheckStateRole )
121 return mCategories.testFlag( category ) ? Qt::Checked : Qt::Unchecked;
124 QString htmlStylePattern = QStringLiteral(
"<p><b>%1</b><br/><span style='color:gray;'>%2</span></p>" );
129 QString name = tr(
"Layer Configuration" );
130 QString description = tr(
"The layers display expression and the datasource flags: identifiable, removable, searchable, read-only and hidden from the project settings" );
135 case Qt::DisplayRole:
136 return htmlStylePattern.arg( name ).arg( description );
137 case Qt::ToolTipRole:
139 case Qt::DecorationRole:
146 QString name = tr(
"Symbology" );
147 QString description = tr(
"Everything from the symbology section" );
152 case Qt::DisplayRole:
154 return htmlStylePattern.arg( name ).arg( description );
155 case Qt::ToolTipRole:
157 case Qt::DecorationRole:
164 QString name = tr(
"3D Symbology" );
165 QString description = tr(
"Everything from the 3D symbology section" );
170 case Qt::DisplayRole:
172 return htmlStylePattern.arg( name ).arg( description );
173 case Qt::ToolTipRole:
175 case Qt::DecorationRole:
182 QString name = tr(
"Labels" );
183 QString description = tr(
"Everything from the labels section" );
188 case Qt::DisplayRole:
190 return htmlStylePattern.arg( name ).arg( description );
191 case Qt::ToolTipRole:
193 case Qt::DecorationRole:
200 QString name = tr(
"Fields" );
201 QString description = tr(
"Virtual fields, aliases, default value expressions and constraints from the form section and WMS/WFS exposure" );
206 case Qt::DisplayRole:
208 return htmlStylePattern.arg( name ).arg( description );
209 case Qt::ToolTipRole:
211 case Qt::DecorationRole:
218 QString name = tr(
"Attribute Form" );
219 QString description = tr(
"Form layout and widget configuration (no constraints and default value expressions)" );
224 case Qt::DisplayRole:
226 return htmlStylePattern.arg( name ).arg( description );
227 case Qt::ToolTipRole:
229 case Qt::DecorationRole:
236 QString name = tr(
"Actions" );
237 QString description = tr(
"Everything from the actions section" );
242 case Qt::DisplayRole:
244 return htmlStylePattern.arg( name ).arg( description );
245 case Qt::ToolTipRole:
247 case Qt::DecorationRole:
254 QString name = tr(
"Map Tips" );
255 QString description = tr(
"Map tips settings (no layer display expression)" );
260 case Qt::DisplayRole:
262 return htmlStylePattern.arg( name ).arg( description );
263 case Qt::ToolTipRole:
265 case Qt::DecorationRole:
272 QString name = tr(
"Diagrams" );
273 QString description = tr(
"Everything from the diagram section" );
278 case Qt::DisplayRole:
280 return htmlStylePattern.arg( name ).arg( description );
281 case Qt::ToolTipRole:
283 case Qt::DecorationRole:
290 QString name = tr(
"Attribute Table Configuration" );
291 QString description = tr(
"Attribute table settings: choice and order of columns and conditional styling" );
296 case Qt::DisplayRole:
298 return htmlStylePattern.arg( name ).arg( description );
299 case Qt::ToolTipRole:
301 case Qt::DecorationRole:
308 QString name = tr(
"Rendering" );
309 QString description = tr(
"Everything from the rendering section: Scale visibility, simplify method, opacity, auto refresh etc." );
314 case Qt::DisplayRole:
316 return htmlStylePattern.arg( name ).arg( description );
317 case Qt::ToolTipRole:
319 case Qt::DecorationRole:
326 QString name = tr(
"Custom Properties" );
327 QString description = tr(
"Layer variables and embedded legend widgets as well as all the custom properties (often used by plugins and custom python code)" );
332 case Qt::DisplayRole:
334 return htmlStylePattern.arg( name ).arg( description );
335 case Qt::ToolTipRole:
337 case Qt::DecorationRole:
344 QString name = tr(
"Geometry Options" );
345 QString description = tr(
"Geometry constraints and validity checks" );
350 case Qt::DisplayRole:
352 return htmlStylePattern.arg( name ).arg( description );
353 case Qt::ToolTipRole:
355 case Qt::DecorationRole:
362 QString name = tr(
"Relations" );
363 QString description = tr(
"The relations this layer has with other layers" );
368 case Qt::DisplayRole:
370 return htmlStylePattern.arg( name ).arg( description );
371 case Qt::ToolTipRole:
373 case Qt::DecorationRole:
380 QString name = tr(
"Temporal Properties" );
381 QString description = tr(
"Everything from the temporal section" );
386 case Qt::DisplayRole:
388 return htmlStylePattern.arg( name ).arg( description );
389 case Qt::ToolTipRole:
391 case Qt::DecorationRole:
398 QString name = tr(
"Legend Settings" );
399 QString description = tr(
"Legend settings (no embedded legend widgets)" );
404 case Qt::DisplayRole:
406 return htmlStylePattern.arg( name ).arg( description );
407 case Qt::ToolTipRole:
409 case Qt::DecorationRole:
416 QString name = tr(
"Elevation Properties" );
417 QString description = tr(
"Everything from the elevation section" );
422 case Qt::DisplayRole:
424 return htmlStylePattern.arg( name ).arg( description );
425 case Qt::ToolTipRole:
427 case Qt::DecorationRole:
434 QString name = tr(
"Notes" );
435 QString description = tr(
"The layer notes" );
440 case Qt::DisplayRole:
442 return htmlStylePattern.arg( name ).arg( description );
443 case Qt::ToolTipRole:
445 case Qt::DecorationRole:
452 QString name = tr(
"All Style Categories" );
453 QString description = tr(
"All style categories" );
458 case Qt::DisplayRole:
460 return htmlStylePattern.arg( name ).arg( description );
461 case Qt::ToolTipRole:
463 case Qt::DecorationRole:
474 if ( !index.isValid() || index.row() >=
rowCount() )
477 if ( role == Qt::CheckStateRole )
480 if ( value.value<Qt::CheckState>() == Qt::Checked )
482 mCategories |= category;
483 emit dataChanged( index, index );
486 else if ( value.value<Qt::CheckState>() == Qt::Unchecked )
488 mCategories &= ~category;
489 emit dataChanged( index, index );
510 label.setText( text );
511 label.setEnabled( option.state & QStyle::State_Enabled );
512 label.setAttribute( Qt::WA_TranslucentBackground );
513 label.setMargin( 3 );
514 label.setWordWrap(
true );
516 painter->translate( rect.topLeft() );
517 label.resize( rect.size() );
518 label.render( painter );