[Test] Remove deprecated Qt < 5.9 code
This commit is contained in:
@@ -85,11 +85,6 @@ UnitTestDialog::UnitTestDialog(QWidget* parent, Qt::WindowFlags f)
|
||||
, ui(new Ui_UnitTest)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
#if QT_VERSION < 0x050000
|
||||
// As it doesn't seem to be able to change the "Highlight" color for the active colorgroup
|
||||
// we force e.g. the "Motif" style only for the progressbar to change the color to green or red.
|
||||
ui->progressBar->setStyle(QStyleFactory::create(QString::fromLatin1("Motif")));
|
||||
#endif
|
||||
setProgressColor(QColor(40,210,43)); // a darker green
|
||||
ui->progressBar->setAlignment(Qt::AlignCenter);
|
||||
|
||||
@@ -111,7 +106,6 @@ UnitTestDialog::~UnitTestDialog()
|
||||
*/
|
||||
void UnitTestDialog::setProgressColor(const QColor& col)
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
QString qss = QString::fromLatin1(
|
||||
"QProgressBar {\n"
|
||||
" border: 2px solid grey;\n"
|
||||
@@ -123,12 +117,6 @@ void UnitTestDialog::setProgressColor(const QColor& col)
|
||||
"}"
|
||||
).arg(col.name());
|
||||
ui->progressBar->setStyleSheet(qss);
|
||||
#else
|
||||
QPalette pl = ui->progressBar->palette();
|
||||
pl.setColor(QPalette::Active, QPalette::Highlight, col);
|
||||
pl.setColor(QPalette::Inactive, QPalette::Highlight, col);
|
||||
ui->progressBar->setPalette(pl);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user