Qt5 app doesn't showing correct palette
General and Desktop
1
Posts
0
Posters
536
Views
1
Watching
-
Hey there,
I'm currently porting my Qt app from Qt4 to Qt5. Compiling works fine, but my app now looks different.
Here's a small example of my problem. The output of qDebug(...) is with Qt4 and Qt5 the same, both: RGB (255,0,0) but the shadow is not visible if i compile it with Qt5.
I'm using openSUSE with KDE desktop. I also tried it on icewm. There the same problem appears.
Does anyone know this problem?@#include "mainwindow.h"
#include "ui_mainwindow.h"#include <QCheckBox>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);QPalette palette; palette.setBrush(QPalette::Shadow, QBrush(Qt::red, Qt::SolidPattern)); ui->checkBox->setPalette(palette); QColor color = ui->checkBox->palette().shadow().color(); qDebug("palette: RGB(%i,%i,%i)", color.red(), color.green(), color.blue());}
MainWindow::~MainWindow()
{
delete ui;
}@