23 #include <QHeaderView> 24 #include <QPushButton> 26 #include <QToolButton> 27 #include <QFileDialog> 28 #include <QMessageBox> 29 #include <QDesktopWidget> 30 #include <QMouseEvent> 32 #include <QInputDialog> 33 #include <QVBoxLayout> 39 connect( mHueRadio, &QRadioButton::toggled,
this, &QgsCompoundColorWidget::mHueRadio_toggled );
40 connect( mSaturationRadio, &QRadioButton::toggled,
this, &QgsCompoundColorWidget::mSaturationRadio_toggled );
41 connect( mValueRadio, &QRadioButton::toggled,
this, &QgsCompoundColorWidget::mValueRadio_toggled );
42 connect( mRedRadio, &QRadioButton::toggled,
this, &QgsCompoundColorWidget::mRedRadio_toggled );
43 connect( mGreenRadio, &QRadioButton::toggled,
this, &QgsCompoundColorWidget::mGreenRadio_toggled );
44 connect( mBlueRadio, &QRadioButton::toggled,
this, &QgsCompoundColorWidget::mBlueRadio_toggled );
45 connect( mAddColorToSchemeButton, &QPushButton::clicked,
this, &QgsCompoundColorWidget::mAddColorToSchemeButton_clicked );
46 connect( mAddCustomColorButton, &QPushButton::clicked,
this, &QgsCompoundColorWidget::mAddCustomColorButton_clicked );
47 connect( mSampleButton, &QPushButton::clicked,
this, &QgsCompoundColorWidget::mSampleButton_clicked );
48 connect( mTabWidget, &QTabWidget::currentChanged,
this, &QgsCompoundColorWidget::mTabWidget_currentChanged );
49 connect( mActionShowInButtons, &QAction::toggled,
this, &QgsCompoundColorWidget::mActionShowInButtons_toggled );
54 QVBoxLayout *newLayout =
new QVBoxLayout();
55 newLayout->setMargin( 0 );
56 newLayout->setContentsMargins( 0, 0, 0, 0 );
57 newLayout->addWidget( mTabWidget );
58 newLayout->addWidget( mSlidersWidget );
59 newLayout->addWidget( mPreviewWidget );
60 newLayout->addWidget( mSwatchesWidget );
62 setLayout( newLayout );
67 mSchemeList->header()->hide();
68 mSchemeList->setColumnWidth( 0, 44 );
71 refreshSchemeComboBox();
75 int activeScheme = settings.
value( QStringLiteral(
"Windows/ColorDialog/activeScheme" ), 0 ).toInt();
76 activeScheme = activeScheme >= mSchemeComboBox->count() ? 0 : activeScheme;
78 mSchemeList->setScheme( schemeList.at( activeScheme ) );
80 mSchemeComboBox->setCurrentIndex( activeScheme );
81 updateActionsForCurrentScheme();
84 connect( mSchemeList->selectionModel(), &QItemSelectionModel::selectionChanged,
this, &QgsCompoundColorWidget::listSelectionChanged );
86 mActionCopyColors->setEnabled(
false );
92 connect( mActionImportPalette, &QAction::triggered,
this, &QgsCompoundColorWidget::importPalette );
93 connect( mActionRemovePalette, &QAction::triggered,
this, &QgsCompoundColorWidget::removePalette );
94 connect( mActionNewPalette, &QAction::triggered,
this, &QgsCompoundColorWidget::newPalette );
97 QMenu *schemeMenu =
new QMenu( mSchemeToolButton );
98 schemeMenu->addAction( mActionCopyColors );
99 schemeMenu->addAction( mActionPasteColors );
100 schemeMenu->addSeparator();
101 schemeMenu->addAction( mActionImportColors );
102 schemeMenu->addAction( mActionExportColors );
103 schemeMenu->addSeparator();
104 schemeMenu->addAction( mActionNewPalette );
105 schemeMenu->addAction( mActionImportPalette );
106 schemeMenu->addAction( mActionRemovePalette );
107 schemeMenu->addAction( mActionShowInButtons );
108 mSchemeToolButton->setMenu( schemeMenu );
110 connect( mSchemeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsCompoundColorWidget::schemeIndexChanged );
113 mOldColorLabel->hide();
116 mVerticalRamp->setInteriorMargin( 2 );
117 mVerticalRamp->setShowFrame(
true );
127 mSwatchButton1->setShowMenu(
false );
129 mSwatchButton2->setShowMenu(
false );
131 mSwatchButton3->setShowMenu(
false );
133 mSwatchButton4->setShowMenu(
false );
135 mSwatchButton5->setShowMenu(
false );
137 mSwatchButton6->setShowMenu(
false );
139 mSwatchButton7->setShowMenu(
false );
141 mSwatchButton8->setShowMenu(
false );
143 mSwatchButton9->setShowMenu(
false );
145 mSwatchButton10->setShowMenu(
false );
147 mSwatchButton11->setShowMenu(
false );
149 mSwatchButton12->setShowMenu(
false );
151 mSwatchButton13->setShowMenu(
false );
153 mSwatchButton14->setShowMenu(
false );
155 mSwatchButton15->setShowMenu(
false );
157 mSwatchButton16->setShowMenu(
false );
160 mSwatchButton1->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor1" ), QVariant( QColor() ) ).value<QColor>() );
161 mSwatchButton2->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor2" ), QVariant( QColor() ) ).value<QColor>() );
162 mSwatchButton3->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor3" ), QVariant( QColor() ) ).value<QColor>() );
163 mSwatchButton4->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor4" ), QVariant( QColor() ) ).value<QColor>() );
164 mSwatchButton5->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor5" ), QVariant( QColor() ) ).value<QColor>() );
165 mSwatchButton6->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor6" ), QVariant( QColor() ) ).value<QColor>() );
166 mSwatchButton7->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor7" ), QVariant( QColor() ) ).value<QColor>() );
167 mSwatchButton8->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor8" ), QVariant( QColor() ) ).value<QColor>() );
168 mSwatchButton9->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor9" ), QVariant( QColor() ) ).value<QColor>() );
169 mSwatchButton10->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor10" ), QVariant( QColor() ) ).value<QColor>() );
170 mSwatchButton11->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor11" ), QVariant( QColor() ) ).value<QColor>() );
171 mSwatchButton12->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor12" ), QVariant( QColor() ) ).value<QColor>() );
172 mSwatchButton13->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor13" ), QVariant( QColor() ) ).value<QColor>() );
173 mSwatchButton14->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor14" ), QVariant( QColor() ) ).value<QColor>() );
174 mSwatchButton15->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor15" ), QVariant( QColor() ) ).value<QColor>() );
175 mSwatchButton16->setColor( settings.
value( QStringLiteral(
"Windows/ColorDialog/customColor16" ), QVariant( QColor() ) ).value<QColor>() );
178 mSpinBoxRadius->setValue( settings.
value( QStringLiteral(
"Windows/ColorDialog/sampleRadius" ), 1 ).toInt() );
179 mSamplePreview->setColor( QColor() );
181 if ( color.isValid() )
187 int activeRadio = settings.
value( QStringLiteral(
"Windows/ColorDialog/activeComponent" ), 2 ).toInt();
188 switch ( activeRadio )
191 mHueRadio->setChecked(
true );
194 mSaturationRadio->setChecked(
true );
197 mValueRadio->setChecked(
true );
200 mRedRadio->setChecked(
true );
203 mGreenRadio->setChecked(
true );
206 mBlueRadio->setChecked(
true );
209 int currentTab = settings.
value( QStringLiteral(
"Windows/ColorDialog/activeTab" ), 0 ).toInt();
210 mTabWidget->setCurrentIndex( currentTab );
256 return mColorPreview->color();
261 mAllowAlpha = allowOpacity;
262 mAlphaLabel->setVisible( allowOpacity );
263 mAlphaSlider->setVisible( allowOpacity );
266 mAlphaLayout->setContentsMargins( 0, 0, 0, 0 );
267 mAlphaLayout->setSpacing( 0 );
271 void QgsCompoundColorWidget::refreshSchemeComboBox()
273 mSchemeComboBox->blockSignals(
true );
274 mSchemeComboBox->clear();
276 QList<QgsColorScheme *>::const_iterator schemeIt = schemeList.constBegin();
277 for ( ; schemeIt != schemeList.constEnd(); ++schemeIt )
279 mSchemeComboBox->addItem( ( *schemeIt )->schemeName() );
281 mSchemeComboBox->blockSignals(
false );
284 void QgsCompoundColorWidget::importPalette()
287 QString lastDir = s.
value( QStringLiteral(
"/UI/lastGplPaletteDir" ), QDir::homePath() ).toString();
288 QString filePath = QFileDialog::getOpenFileName(
this, tr(
"Select Palette File" ), lastDir, QStringLiteral(
"GPL (*.gpl);;All files (*.*)" ) );
290 if ( filePath.isEmpty() )
296 QFileInfo fileInfo( filePath );
297 if ( !fileInfo.exists() || !fileInfo.isReadable() )
299 QMessageBox::critical(
nullptr, tr(
"Import Color Palette" ), tr(
"Error, file does not exist or is not readable." ) );
303 s.
setValue( QStringLiteral(
"/UI/lastGplPaletteDir" ), fileInfo.absolutePath() );
304 QFile file( filePath );
312 QMessageBox::critical(
nullptr, tr(
"Import Color Palette" ), tr(
"Palette file is not readable." ) );
316 if ( importedColors.length() == 0 )
319 QMessageBox::critical(
nullptr, tr(
"Import Color Palette" ), tr(
"No colors found in palette file." ) );
325 importedScheme->
setName( paletteName );
326 importedScheme->
setColors( importedColors );
331 refreshSchemeComboBox();
332 mSchemeComboBox->setCurrentIndex( mSchemeComboBox->count() - 1 );
335 void QgsCompoundColorWidget::removePalette()
339 int prevIndex = mSchemeComboBox->currentIndex();
340 if ( prevIndex >= schemeList.length() )
352 if ( QMessageBox::question(
this, tr(
"Remove Color Palette" ),
353 QString( tr(
"Are you sure you want to remove %1?" ) ).arg( userScheme->
schemeName() ),
354 QMessageBox::Yes | QMessageBox::No, QMessageBox::No ) != QMessageBox::Yes )
361 if ( !userScheme->
erase() )
369 refreshSchemeComboBox();
370 prevIndex = std::max( std::min( prevIndex, mSchemeComboBox->count() - 1 ), 0 );
371 mSchemeComboBox->setCurrentIndex( prevIndex );
374 void QgsCompoundColorWidget::newPalette()
377 QString name = QInputDialog::getText(
this, tr(
"Create New Palette" ), tr(
"Enter a name for the new palette:" ),
378 QLineEdit::Normal, tr(
"New palette" ), &ok );
380 if ( !ok || name.isEmpty() )
387 QDir palettePath( gplFilePath() );
388 QRegExp badChars(
"[,^@={}\\[\\]~!?:&*\"|#%<>$\"'();`' /\\\\]" );
389 QString filename = name.simplified().toLower().replace( badChars, QStringLiteral(
"_" ) );
390 if ( filename.isEmpty() )
392 filename = tr(
"new_palette" );
394 QFileInfo destFileInfo( palettePath.filePath( filename +
".gpl" ) );
396 while ( destFileInfo.exists() )
399 destFileInfo = QFileInfo( palettePath.filePath( filename + QStringLiteral(
"%1.gpl" ).arg( fileNumber ) ) );
409 refreshSchemeComboBox();
410 mSchemeComboBox->setCurrentIndex( mSchemeComboBox->count() - 1 );
413 QString QgsCompoundColorWidget::gplFilePath()
418 if ( !localDir.mkpath( palettesDir ) )
426 void QgsCompoundColorWidget::schemeIndexChanged(
int index )
429 if ( mSchemeList->isDirty() )
431 mSchemeList->saveColorsToScheme();
436 if ( index >= schemeList.length() )
442 mSchemeList->setScheme( scheme );
444 updateActionsForCurrentScheme();
447 mActionCopyColors->setEnabled(
false );
450 void QgsCompoundColorWidget::listSelectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected )
452 Q_UNUSED( deselected );
453 mActionCopyColors->setEnabled( selected.length() > 0 );
456 void QgsCompoundColorWidget::mAddCustomColorButton_clicked()
458 switch ( mLastCustomColorIndex )
461 mSwatchButton1->setColor( mColorPreview->color() );
464 mSwatchButton2->setColor( mColorPreview->color() );
467 mSwatchButton3->setColor( mColorPreview->color() );
470 mSwatchButton4->setColor( mColorPreview->color() );
473 mSwatchButton5->setColor( mColorPreview->color() );
476 mSwatchButton6->setColor( mColorPreview->color() );
479 mSwatchButton7->setColor( mColorPreview->color() );
482 mSwatchButton8->setColor( mColorPreview->color() );
485 mSwatchButton9->setColor( mColorPreview->color() );
488 mSwatchButton10->setColor( mColorPreview->color() );
491 mSwatchButton11->setColor( mColorPreview->color() );
494 mSwatchButton12->setColor( mColorPreview->color() );
497 mSwatchButton13->setColor( mColorPreview->color() );
500 mSwatchButton14->setColor( mColorPreview->color() );
503 mSwatchButton15->setColor( mColorPreview->color() );
506 mSwatchButton16->setColor( mColorPreview->color() );
509 mLastCustomColorIndex++;
510 if ( mLastCustomColorIndex >= 16 )
512 mLastCustomColorIndex = 0;
516 void QgsCompoundColorWidget::mSampleButton_clicked()
522 mPickingColor =
true;
523 setMouseTracking(
true );
526 void QgsCompoundColorWidget::mTabWidget_currentChanged(
int index )
529 bool enabled = index == 0;
530 mRedRadio->setEnabled( enabled );
531 mBlueRadio->setEnabled( enabled );
532 mGreenRadio->setEnabled( enabled );
533 mHueRadio->setEnabled( enabled );
534 mSaturationRadio->setEnabled( enabled );
535 mValueRadio->setEnabled( enabled );
538 void QgsCompoundColorWidget::mActionShowInButtons_toggled(
bool state )
547 QScreen *QgsCompoundColorWidget::findScreenAt( QPoint pos )
549 for ( QScreen *screen : QGuiApplication::screens() )
551 if ( screen->geometry().contains( pos ) )
559 void QgsCompoundColorWidget::saveSettings()
562 if ( mSchemeList->isDirty() )
564 mSchemeList->saveColorsToScheme();
571 if ( mHueRadio->isChecked() )
573 if ( mSaturationRadio->isChecked() )
575 if ( mValueRadio->isChecked() )
577 if ( mRedRadio->isChecked() )
579 if ( mGreenRadio->isChecked() )
581 if ( mBlueRadio->isChecked() )
583 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/activeComponent" ), activeRadio );
586 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/activeScheme" ), mSchemeComboBox->currentIndex() );
589 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/activeTab" ), mTabWidget->currentIndex() );
592 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor1" ), QVariant( mSwatchButton1->color() ) );
593 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor2" ), QVariant( mSwatchButton2->color() ) );
594 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor3" ), QVariant( mSwatchButton3->color() ) );
595 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor4" ), QVariant( mSwatchButton4->color() ) );
596 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor5" ), QVariant( mSwatchButton5->color() ) );
597 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor6" ), QVariant( mSwatchButton6->color() ) );
598 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor7" ), QVariant( mSwatchButton7->color() ) );
599 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor8" ), QVariant( mSwatchButton8->color() ) );
600 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor9" ), QVariant( mSwatchButton9->color() ) );
601 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor10" ), QVariant( mSwatchButton10->color() ) );
602 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor11" ), QVariant( mSwatchButton11->color() ) );
603 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor12" ), QVariant( mSwatchButton12->color() ) );
604 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor13" ), QVariant( mSwatchButton13->color() ) );
605 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor14" ), QVariant( mSwatchButton14->color() ) );
606 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor15" ), QVariant( mSwatchButton15->color() ) );
607 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/customColor16" ), QVariant( mSwatchButton16->color() ) );
610 settings.
setValue( QStringLiteral(
"Windows/ColorDialog/sampleRadius" ), mSpinBoxRadius->value() );
613 void QgsCompoundColorWidget::stopPicking( QPoint eventPos,
const bool takeSample )
619 setMouseTracking(
false );
620 mPickingColor =
false;
629 QColor snappedColor = sampleColor( eventPos );
630 mSamplePreview->setColor( snappedColor );
631 mColorPreview->setColor( snappedColor,
true );
636 if ( !color.isValid() )
641 QColor fixedColor = QColor( color );
645 fixedColor.setAlpha( 255 );
647 QList<QgsColorWidget *> colorWidgets = this->findChildren<QgsColorWidget *>();
650 if ( widget == mSamplePreview )
654 widget->blockSignals(
true );
656 widget->blockSignals(
false );
663 mOldColorLabel->setVisible( color.isValid() );
664 mColorPreview->setColor2( color );
676 QWidget::mousePressEvent( e );
679 QColor QgsCompoundColorWidget::averageColor(
const QImage &image )
const 687 for (
int heightIndex = 0; heightIndex < image.height(); ++heightIndex )
689 QRgb *scanLine = ( QRgb * )image.constScanLine( heightIndex );
690 for (
int widthIndex = 0; widthIndex < image.width(); ++widthIndex )
692 tmpRgb = scanLine[widthIndex];
693 sumRed += qRed( tmpRgb );
694 sumBlue += qBlue( tmpRgb );
695 sumGreen += qGreen( tmpRgb );
700 double avgRed = ( double )sumRed / ( 255.0 * colorCount );
701 double avgGreen = ( double )sumGreen / ( 255.0 * colorCount );
702 double avgBlue = ( double )sumBlue / ( 255.0 * colorCount );
705 return QColor::fromRgbF( avgRed, avgGreen, avgBlue );
708 QColor QgsCompoundColorWidget::sampleColor( QPoint point )
const 710 int sampleRadius = mSpinBoxRadius->value() - 1;
711 QScreen *screen = findScreenAt( point );
716 QPixmap snappedPixmap = screen->grabWindow( QApplication::desktop()->winId(),
717 point.x() - sampleRadius,
718 point.y() - sampleRadius,
719 1 + sampleRadius * 2,
720 1 + sampleRadius * 2 );
721 QImage snappedImage = snappedPixmap.toImage();
723 return averageColor( snappedImage );
732 QColor hoverColor = sampleColor( e->globalPos() );
733 mSamplePreview->setColor( hoverColor );
739 QWidget::mouseMoveEvent( e );
747 stopPicking( e->globalPos() );
752 QWidget::mouseReleaseEvent( e );
757 if ( !mPickingColor )
765 stopPicking( QCursor::pos(), e->key() == Qt::Key_Space );
768 void QgsCompoundColorWidget::mHueRadio_toggled(
bool checked )
777 void QgsCompoundColorWidget::mSaturationRadio_toggled(
bool checked )
786 void QgsCompoundColorWidget::mValueRadio_toggled(
bool checked )
795 void QgsCompoundColorWidget::mRedRadio_toggled(
bool checked )
804 void QgsCompoundColorWidget::mGreenRadio_toggled(
bool checked )
813 void QgsCompoundColorWidget::mBlueRadio_toggled(
bool checked )
822 void QgsCompoundColorWidget::mAddColorToSchemeButton_clicked()
827 void QgsCompoundColorWidget::updateActionsForCurrentScheme()
831 mActionImportColors->setEnabled( scheme->
isEditable() );
832 mActionPasteColors->setEnabled( scheme->
isEditable() );
833 mAddColorToSchemeButton->setEnabled( scheme->
isEditable() );
834 mRemoveColorsFromSchemeButton->setEnabled( scheme->
isEditable() );
837 mActionRemovePalette->setEnabled( static_cast< bool >( userScheme ) );
840 mActionShowInButtons->setEnabled(
true );
846 mActionShowInButtons->setEnabled(
false );
A color scheme which stores its colors in a gpl palette file within the "palettes" subfolder off the ...
void setName(const QString &name)
Sets the name for the scheme.
void colorSelected(const QColor &color)
Emitted when a color is selected from the list.
bool erase()
Erases the associated gpl palette file from the users "palettes" folder.
static QString qgisSettingsDirPath()
Returns the path to the settings directory in user's home dir.
void removeSelection()
Removes any selected colors from the list.
This class is a composition of two QSettings instances:
Abstract base class for color schemes.
bool setColors(const QgsNamedColorList &colors, const QString &context=QString(), const QColor &baseColor=QColor()) override
Sets the colors for the scheme.
QgsColorScheme::SchemeFlags flags() const override
Returns the current flags for the color scheme.
void pasteColors()
Pastes colors from clipboard to the list.
Show scheme in color button drop-down menu.
bool removeColorScheme(QgsColorScheme *scheme)
Removes all matching color schemes from the registry.
QList< QgsColorScheme * > schemes() const
Returns all color schemes in the registry.
void setValue(const QString &key, const QVariant &value, const QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
void showExportColorsDialog()
Displays a file picker dialog allowing users to export colors from the list into a file...
static QgsNamedColorList importColorsFromGpl(QFile &file, bool &ok, QString &name)
Imports colors from a gpl GIMP palette file.
void setShowSchemeInMenu(bool show)
Sets whether a this scheme should be shown in color button menus.
void showImportColorsDialog()
Displays a file picker dialog allowing users to import colors into the list from a file...
static QString colorToName(const QColor &color)
Returns a friendly display name for a color.
QList< QPair< QColor, QString > > QgsNamedColorList
List of colors paired with a friendly display name identifying the color.
void addColorScheme(QgsColorScheme *scheme)
Adds a color scheme to the registry.
static void addRecentColor(const QColor &color)
Adds a color to the list of recent colors.
Show scheme in color picker dialog.
virtual bool isEditable() const
Returns whether the color scheme is editable.
static QgsColorSchemeRegistry * colorSchemeRegistry()
Returns the application's color scheme registry, used for managing color schemes. ...
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.
QString schemeName() const override
Gets the name for the color scheme.
void copyColors()
Copies colors from the list to the clipboard.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), const Section section=NoSection) const
Returns the value for setting key.
static QCursor getThemeCursor(Cursor cursor)
Helper to get a theme cursor.