diff options
author | lbartoletti <l.bartoletti@free.fr> | 2019-10-22 21:18:50 +0200 |
---|---|---|
committer | lbartoletti <l.bartoletti@free.fr> | 2019-10-22 21:18:50 +0200 |
commit | 66912e699e8f2586c923025242482e596e9790c1 (patch) | |
tree | efb7ea90f533685b64e99ce1bbe3f568a34f9f91 /src-qt5/core/lumina-theme-engine/src | |
parent | fix warning: 'created' is deprecated: Use either birthTime() or metadataChang... (diff) | |
download | lumina-66912e699e8f2586c923025242482e596e9790c1.tar.gz lumina-66912e699e8f2586c923025242482e596e9790c1.tar.bz2 lumina-66912e699e8f2586c923025242482e596e9790c1.zip |
fix (set)backgroundColor
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src')
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp index 6c5b0665..1c377965 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/paletteeditdialog.cpp @@ -28,9 +28,9 @@ PaletteEditDialog::~PaletteEditDialog(){ QPalette PaletteEditDialog::selectedPalette() const{ QPalette palette; for(int i = 0; i < QPalette::NColorRoles; i++){ - palette.setBrush(QPalette::Active, QPalette::ColorRole(i), m_ui->tableWidget->item(i,0)->backgroundColor()); - palette.setBrush(QPalette::Inactive, QPalette::ColorRole(i), m_ui->tableWidget->item(i,1)->backgroundColor()); - palette.setBrush(QPalette::Disabled, QPalette::ColorRole(i), m_ui->tableWidget->item(i,2)->backgroundColor()); + palette.setBrush(QPalette::Active, QPalette::ColorRole(i), m_ui->tableWidget->item(i,0)->background().color()); + palette.setBrush(QPalette::Inactive, QPalette::ColorRole(i), m_ui->tableWidget->item(i,1)->background().color()); + palette.setBrush(QPalette::Disabled, QPalette::ColorRole(i), m_ui->tableWidget->item(i,2)->background().color()); } return palette; } @@ -40,9 +40,9 @@ void PaletteEditDialog::setPalette(const QPalette &palette){ if(!m_ui->tableWidget->item(i,0)){ m_ui->tableWidget->setItem(i, 0, new QTableWidgetItem()); } if(!m_ui->tableWidget->item(i,1)){ m_ui->tableWidget->setItem(i, 1, new QTableWidgetItem()); } if(!m_ui->tableWidget->item(i,2)){ m_ui->tableWidget->setItem(i, 2, new QTableWidgetItem()); } - m_ui->tableWidget->item(i,0)->setBackgroundColor(palette.color(QPalette::Active, QPalette::ColorRole(i))); - m_ui->tableWidget->item(i,1)->setBackgroundColor(palette.color(QPalette::Inactive, QPalette::ColorRole(i))); - m_ui->tableWidget->item(i,2)->setBackgroundColor(palette.color(QPalette::Disabled, QPalette::ColorRole(i))); + m_ui->tableWidget->item(i,0)->setBackground(QBrush(palette.color(QPalette::Active, QPalette::ColorRole(i)))); + m_ui->tableWidget->item(i,1)->setBackground(QBrush(palette.color(QPalette::Inactive, QPalette::ColorRole(i)))); + m_ui->tableWidget->item(i,2)->setBackground(QBrush(palette.color(QPalette::Disabled, QPalette::ColorRole(i)))); } QStringList labels; labels << tr("Window text") << tr("Button background") << tr("Bright") << tr("Less bright") << tr("Dark") << tr("Less dark") << tr("Normal text") << tr("Bright text") << tr("Button text") << tr("Normal background") << tr("Window") << tr("Shadow") << tr("Highlight") << tr("Highlighted text") << tr("Link") << tr("Visited link") << tr("Alternate background") << tr("Default") << tr("Tooltip background") << tr("Tooltip text") << tr("Placeholder text"); @@ -55,9 +55,9 @@ void PaletteEditDialog::hideEvent(QHideEvent *){ } void PaletteEditDialog::on_tableWidget_itemClicked(QTableWidgetItem *item){ - QColor color = QColorDialog::getColor(item->backgroundColor(), this, tr("Select Color")); + QColor color = QColorDialog::getColor(item->background().color(), this, tr("Select Color")); if(color.isValid()){ - item->setBackgroundColor(color); + item->setBackground(QBrush(color)); emit paletteChanged(selectedPalette()); } } |