Solved Qt 4.8 qss QHeaderViiew::section
-
Hi. Can anybody help me. When i using in style sheet of QTableWidget some like this
QHeaderView::section
{
background-color: rgb(85, 0, 0);
}
I get all row headers are red (no meter what color i set in styles heet) -
Hi and welcome
if you change to
background-color: rgb(0, 0,255);
And select menu
Build->clean all
and
Build->rebuild allIt must be a blue color. else u set style sheet somewhere else or have something that
overrules this one.
like
Qwidget
{
background-color: rgb(85, 0, 0);
} -
No changes. A get red row headers (in editor i see blue row headers, but in runtime its red)
-
@SU_Shadow
If it changes when u run program,
it must mean u also set StyleSheet in code.
Or set stylesheet on a parent where it also affects
the childs.
They are cascading -
I create empty QWidget project and add QTableWidget on main widget. Then i add button. On button i connected slot which excute :
ui->tableWidget->setStyleSheet("QHeaderView::section { background-color: rgb(0, 0,255);}");
After form loads i get normal (default) background of rows headers, but when i press button i get row headers red (not blue) -
@SU_Shadow said:
ok ?!?! ( strange :)
I tried the same and I do get blue.
you want to try the test project ?
https://www.dropbox.com/s/syt1xipmx6171co/notblue.zip?dl=0 -
I download project and when i run it i get the same result (rows header are red)
Link to screen -
@SU_Shadow
Also you get no text?? (!)It seems stylesheets are somehow broken in your Qt.
Did you compile Qt yourself?
What version of Qt ?
Looks like a linux platform? -
Platform fedora 22. Qt 4.8. When i greate qt5 qwdiget application ( or when i change kit from qt4 to qt5 and make clean all and rebuild all) all look's fine. But on qt4 i get this error.
-
@SU_Shadow
ok. must be a bug in 4.8 then. ?
Maybe to that platform.
Not heard about it before.
I have 5.6 only so cant test. -
Found some solution. Think problem in QStyle of application on qt 4.8 under fedora (plasma DE). When i write in main some like
QApplication a(argc, argv); a.setStyle(new QWindowsStyle); MainWindow w; w.show();
All works fine.
-
ok !?
good found :)