100 if ( !index.isValid() || index.row() >=
rowCount() )
105 if ( role == Qt::UserRole )
109 if ( role == Qt::CheckStateRole )
111 return mCategories.testFlag( category ) ? Qt::Checked : Qt::Unchecked;
114 QString htmlStylePattern = QStringLiteral(
"<p><b>%1</b><br/><span style='color:gray;'>%2</span></p>" );
119 QString name = tr(
"Layer Configuration" );
120 QString description = tr(
"The layers display expression and the datasource flags: identifiable, removable, searchable, read-only and hidden from the project settings" );
125 case Qt::DisplayRole:
126 return htmlStylePattern.arg( name ).arg( description );
127 case Qt::ToolTipRole:
129 case Qt::DecorationRole:
136 QString name = tr(
"Symbology" );
137 QString description = tr(
"Everything from the symbology section" );
142 case Qt::DisplayRole:
144 return htmlStylePattern.arg( name ).arg( description );
145 case Qt::ToolTipRole:
147 case Qt::DecorationRole:
154 QString name = tr(
"3D Symbology" );
155 QString description = tr(
"Everything from the 3D symbology section" );
160 case Qt::DisplayRole:
162 return htmlStylePattern.arg( name ).arg( description );
163 case Qt::ToolTipRole:
165 case Qt::DecorationRole:
172 QString name = tr(
"Labels" );
173 QString description = tr(
"Everything from the labels section" );
178 case Qt::DisplayRole:
180 return htmlStylePattern.arg( name ).arg( description );
181 case Qt::ToolTipRole:
183 case Qt::DecorationRole:
190 QString name = tr(
"Fields" );
191 QString description = tr(
"Virtual fields, aliases, default value expressions and constraints from the form section and WMS/WFS exposure" );
196 case Qt::DisplayRole:
198 return htmlStylePattern.arg( name ).arg( description );
199 case Qt::ToolTipRole:
201 case Qt::DecorationRole:
208 QString name = tr(
"Attribute Form" );
209 QString description = tr(
"Form layout and widget configuration (no constraints and default value expressions)" );
214 case Qt::DisplayRole:
216 return htmlStylePattern.arg( name ).arg( description );
217 case Qt::ToolTipRole:
219 case Qt::DecorationRole:
226 QString name = tr(
"Actions" );
227 QString description = tr(
"Everything from the actions section" );
232 case Qt::DisplayRole:
234 return htmlStylePattern.arg( name ).arg( description );
235 case Qt::ToolTipRole:
237 case Qt::DecorationRole:
244 QString name = tr(
"Map Tips" );
245 QString description = tr(
"Map tips settings (no layer display expression)" );
250 case Qt::DisplayRole:
252 return htmlStylePattern.arg( name ).arg( description );
253 case Qt::ToolTipRole:
255 case Qt::DecorationRole:
262 QString name = tr(
"Diagrams" );
263 QString description = tr(
"Everything from the diagram section" );
268 case Qt::DisplayRole:
270 return htmlStylePattern.arg( name ).arg( description );
271 case Qt::ToolTipRole:
273 case Qt::DecorationRole:
280 QString name = tr(
"Attribute Table Configuration" );
281 QString description = tr(
"Attribute table settings: choice and order of columns and conditional styling" );
286 case Qt::DisplayRole:
288 return htmlStylePattern.arg( name ).arg( description );
289 case Qt::ToolTipRole:
291 case Qt::DecorationRole:
298 QString name = tr(
"Rendering" );
299 QString description = tr(
"Everything from the rendering section: Scale visibility, simplify method, opacity, auto refresh etc." );
304 case Qt::DisplayRole:
306 return htmlStylePattern.arg( name ).arg( description );
307 case Qt::ToolTipRole:
309 case Qt::DecorationRole:
316 QString name = tr(
"Custom Properties" );
317 QString description = tr(
"Layer variables and embedded legend widgets as well as all the custom properties (often used by plugins and custom python code)" );
322 case Qt::DisplayRole:
324 return htmlStylePattern.arg( name ).arg( description );
325 case Qt::ToolTipRole:
327 case Qt::DecorationRole:
334 QString name = tr(
"Geometry Options" );
335 QString description = tr(
"Geometry constraints and validity checks" );
340 case Qt::DisplayRole:
342 return htmlStylePattern.arg( name ).arg( description );
343 case Qt::ToolTipRole:
345 case Qt::DecorationRole:
352 QString name = tr(
"Relations" );
353 QString description = tr(
"The relations this layer has with other layers" );
358 case Qt::DisplayRole:
360 return htmlStylePattern.arg( name ).arg( description );
361 case Qt::ToolTipRole:
363 case Qt::DecorationRole:
370 QString name = tr(
"Temporal Properties" );
371 QString description = tr(
"Everything from the temporal section" );
376 case Qt::DisplayRole:
378 return htmlStylePattern.arg( name ).arg( description );
379 case Qt::ToolTipRole:
381 case Qt::DecorationRole:
388 QString name = tr(
"Legend Settings" );
389 QString description = tr(
"Legend settings (no embedded legend widgets)" );
394 case Qt::DisplayRole:
396 return htmlStylePattern.arg( name ).arg( description );
397 case Qt::ToolTipRole:
399 case Qt::DecorationRole:
406 QString name = tr(
"Elevation Properties" );
407 QString description = tr(
"Everything from the elevation section" );
412 case Qt::DisplayRole:
414 return htmlStylePattern.arg( name ).arg( description );
415 case Qt::ToolTipRole:
417 case Qt::DecorationRole:
424 QString name = tr(
"Notes" );
425 QString description = tr(
"The layer notes" );
430 case Qt::DisplayRole:
432 return htmlStylePattern.arg( name ).arg( description );
433 case Qt::ToolTipRole:
435 case Qt::DecorationRole:
442 QString name = tr(
"All Style Categories" );
443 QString description = tr(
"All style categories" );
448 case Qt::DisplayRole:
450 return htmlStylePattern.arg( name ).arg( description );
451 case Qt::ToolTipRole:
453 case Qt::DecorationRole:
464 if ( !index.isValid() || index.row() >=
rowCount() )
467 if ( role == Qt::CheckStateRole )
470 if ( value.value<Qt::CheckState>() == Qt::Checked )
472 mCategories |= category;
473 emit dataChanged( index, index );
476 else if ( value.value<Qt::CheckState>() == Qt::Unchecked )
478 mCategories &= ~category;
479 emit dataChanged( index, index );
500 label.setText( text );
501 label.setEnabled( option.state & QStyle::State_Enabled );
502 label.setAttribute( Qt::WA_TranslucentBackground );
503 label.setMargin( 3 );
504 label.setWordWrap(
true );
506 painter->translate( rect.topLeft() );
507 label.resize( rect.size() );
508 label.render( painter );