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.
This commit is contained in:
mgrojo
2017-12-15 17:58:28 +01:00
parent 982a88b5e2
commit 05559d4727
2 changed files with 3 additions and 3 deletions

View File

@@ -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());

View File

@@ -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)}");
}