From 05559d4727683392ece2ea20c58e8eeb62c78331 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Fri, 15 Dec 2017 17:58:28 +0100 Subject: [PATCH] Avoid inheriting the style sheet in child widgets Avoid inheriting the style sheet in child widgets by naming the widget type where it is set. This had the effect, reported in issue #838, of setting an unwanted style in child widgets, like the tool-tip of the "Load all data" button, the tool-tip of the SQL results pane or the context menu of the search-bar edit line. --- src/PlotDock.cpp | 2 +- src/SqlExecutionArea.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PlotDock.cpp b/src/PlotDock.cpp index f7b3ba88..03e208cf 100644 --- a/src/PlotDock.cpp +++ b/src/PlotDock.cpp @@ -302,7 +302,7 @@ void PlotDock::updatePlot(SqliteTableModel* model, BrowseDataTableSettings* sett // Warn user if not all data has been fetched and hint about the button for loading all the data if (ui->plotWidget->graphCount() > 0 && model->canFetchMore()) { ui->buttonLoadAllData->setEnabled(true); - ui->buttonLoadAllData->setStyleSheet("color: white; background-color: rgb(255, 102, 102)"); + ui->buttonLoadAllData->setStyleSheet("QToolButton {color: white; background-color: rgb(255, 102, 102)}"); ui->buttonLoadAllData->setToolTip(tr("Load all data and redraw plot.\n" "Warning: not all data has been fetched from the table yet due to the partial fetch mechanism.")); QToolTip::showText(ui->buttonLoadAllData->mapToGlobal(QPoint(0, 0)), ui->buttonLoadAllData->toolTip()); diff --git a/src/SqlExecutionArea.cpp b/src/SqlExecutionArea.cpp index 810091f2..372a61c0 100644 --- a/src/SqlExecutionArea.cpp +++ b/src/SqlExecutionArea.cpp @@ -65,7 +65,7 @@ void SqlExecutionArea::finishExecution(const QString& result, const bool ok) if (ok) ui->editErrors->setStyleSheet(""); else - ui->editErrors->setStyleSheet("color: white; background-color: rgb(255, 102, 102)"); + ui->editErrors->setStyleSheet("QTextEdit {color: white; background-color: rgb(255, 102, 102)}"); } } @@ -146,7 +146,7 @@ void SqlExecutionArea::find(QString expr, bool forward) if (found || expr == "") ui->findLineEdit->setStyleSheet(""); else - ui->findLineEdit->setStyleSheet("color: white; background-color: rgb(255, 102, 102)"); + ui->findLineEdit->setStyleSheet("QLineEdit {color: white; background-color: rgb(255, 102, 102)}"); }