Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 app doesn't showing correct palette

Qt5 app doesn't showing correct palette

Scheduled Pinned Locked Moved General and Desktop
1 Posts 0 Posters 536 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved