99 if ( !index.isValid() || index.row() >=
rowCount() )
104 if ( role == Qt::UserRole )
108 if ( role == Qt::CheckStateRole )
110 return mCategories.testFlag( category ) ? Qt::Checked : Qt::Unchecked;
113 QString htmlStylePattern = QStringLiteral(
"<p><b>%1</b><br/><span style='color:gray;'>%2</span></p>" );
118 QString name = tr(
"Layer Configuration" );
119 QString description = tr(
"The layers display expression and the datasource flags: identifiable, removable, searchable, read-only and hidden from the project settings" );
124 case Qt::DisplayRole:
125 return htmlStylePattern.arg( name ).arg( description );
126 case Qt::ToolTipRole:
128 case Qt::DecorationRole:
135 QString name = tr(
"Symbology" );
136 QString description = tr(
"Everything from the symbology section" );
141 case Qt::DisplayRole:
143 return htmlStylePattern.arg( name ).arg( description );
144 case Qt::ToolTipRole:
146 case Qt::DecorationRole:
153 QString name = tr(
"3D Symbology" );
154 QString description = tr(
"Everything from the 3D symbology section" );
159 case Qt::DisplayRole:
161 return htmlStylePattern.arg( name ).arg( description );
162 case Qt::ToolTipRole:
164 case Qt::DecorationRole:
171 QString name = tr(
"Labels" );
172 QString description = tr(
"Everything from the labels section" );
177 case Qt::DisplayRole:
179 return htmlStylePattern.arg( name ).arg( description );
180 case Qt::ToolTipRole:
182 case Qt::DecorationRole:
189 QString name = tr(
"Fields" );
190 QString description = tr(
"Virtual fields, aliases, default value expressions and constraints from the form section and WMS/WFS exposure" );
195 case Qt::DisplayRole:
197 return htmlStylePattern.arg( name ).arg( description );
198 case Qt::ToolTipRole:
200 case Qt::DecorationRole:
207 QString name = tr(
"Attribute Form" );
208 QString description = tr(
"Form layout and widget configuration (no constraints and default value expressions)" );
213 case Qt::DisplayRole:
215 return htmlStylePattern.arg( name ).arg( description );
216 case Qt::ToolTipRole:
218 case Qt::DecorationRole:
225 QString name = tr(
"Actions" );
226 QString description = tr(
"Everything from the actions section" );
231 case Qt::DisplayRole:
233 return htmlStylePattern.arg( name ).arg( description );
234 case Qt::ToolTipRole:
236 case Qt::DecorationRole:
243 QString name = tr(
"Map Tips" );
244 QString description = tr(
"Map tips settings (no layer display expression)" );
249 case Qt::DisplayRole:
251 return htmlStylePattern.arg( name ).arg( description );
252 case Qt::ToolTipRole:
254 case Qt::DecorationRole:
261 QString name = tr(
"Diagrams" );
262 QString description = tr(
"Everything from the diagram section" );
267 case Qt::DisplayRole:
269 return htmlStylePattern.arg( name ).arg( description );
270 case Qt::ToolTipRole:
272 case Qt::DecorationRole:
279 QString name = tr(
"Attribute Table Configuration" );
280 QString description = tr(
"Attribute table settings: choice and order of columns and conditional styling" );
285 case Qt::DisplayRole:
287 return htmlStylePattern.arg( name ).arg( description );
288 case Qt::ToolTipRole:
290 case Qt::DecorationRole:
297 QString name = tr(
"Rendering" );
298 QString description = tr(
"Everything from the rendering section: Scale visibility, simplify method, opacity, auto refresh etc." );
303 case Qt::DisplayRole:
305 return htmlStylePattern.arg( name ).arg( description );
306 case Qt::ToolTipRole:
308 case Qt::DecorationRole:
315 QString name = tr(
"Custom Properties" );
316 QString description = tr(
"Layer variables and embedded legend widgets as well as all the custom properties (often used by plugins and custom python code)" );
321 case Qt::DisplayRole:
323 return htmlStylePattern.arg( name ).arg( description );
324 case Qt::ToolTipRole:
326 case Qt::DecorationRole:
333 QString name = tr(
"Geometry Options" );
334 QString description = tr(
"Geometry constraints and validity checks" );
339 case Qt::DisplayRole:
341 return htmlStylePattern.arg( name ).arg( description );
342 case Qt::ToolTipRole:
344 case Qt::DecorationRole:
351 QString name = tr(
"Relations" );
352 QString description = tr(
"The relations this layer has with other layers" );
357 case Qt::DisplayRole:
359 return htmlStylePattern.arg( name ).arg( description );
360 case Qt::ToolTipRole:
362 case Qt::DecorationRole:
369 QString name = tr(
"Temporal Properties" );
370 QString description = tr(
"Everything from the temporal section" );
375 case Qt::DisplayRole:
377 return htmlStylePattern.arg( name ).arg( description );
378 case Qt::ToolTipRole:
380 case Qt::DecorationRole:
387 QString name = tr(
"Legend Settings" );
388 QString description = tr(
"Legend settings (no embedded legend widgets)" );
393 case Qt::DisplayRole:
395 return htmlStylePattern.arg( name ).arg( description );
396 case Qt::ToolTipRole:
398 case Qt::DecorationRole:
405 QString name = tr(
"Elevation Properties" );
406 QString description = tr(
"Everything from the elevation section" );
411 case Qt::DisplayRole:
413 return htmlStylePattern.arg( name ).arg( description );
414 case Qt::ToolTipRole:
416 case Qt::DecorationRole:
423 QString name = tr(
"Notes" );
424 QString description = tr(
"The layer notes" );
429 case Qt::DisplayRole:
431 return htmlStylePattern.arg( name ).arg( description );
432 case Qt::ToolTipRole:
434 case Qt::DecorationRole:
441 QString name = tr(
"All Style Categories" );
442 QString description = tr(
"All style categories" );
447 case Qt::DisplayRole:
449 return htmlStylePattern.arg( name ).arg( description );
450 case Qt::ToolTipRole:
452 case Qt::DecorationRole:
463 if ( !index.isValid() || index.row() >=
rowCount() )
466 if ( role == Qt::CheckStateRole )
469 if ( value.value<Qt::CheckState>() == Qt::Checked )
471 mCategories |= category;
472 emit dataChanged( index, index );
475 else if ( value.value<Qt::CheckState>() == Qt::Unchecked )
477 mCategories &= ~category;
478 emit dataChanged( index, index );
499 label.setText( text );
500 label.setEnabled( option.state & QStyle::State_Enabled );
501 label.setAttribute( Qt::WA_TranslucentBackground );
502 label.setMargin( 3 );
503 label.setWordWrap(
true );
505 painter->translate( rect.topLeft() );
506 label.resize( rect.size() );
507 label.render( painter );