PDA

View Full Version : QFrame makes contents inaccessable.



paie
12th August 2011, 23:19
Well, it didn't take me long to get back in here.

I'm trying to create custom frames for some of my subclassed QComboBox and QLineEdit widgets.

But when I set the QFrame as a child of the widget, it does not show.

If I make it a child of the same parent as the widget, I can see the frame, but I can no longer access the contents of the widget.

What am I doing wrong?

norobro
13th August 2011, 00:22
From the docs:
The frame around the combobox can be styled using the box model which is the same as a QPushButton.

Just for giggles use your style sheet string from the previous thread and change QPushButton to QComboBox:
setStyleSheet("QComboBox { "
"color:black;background-color:aqua;"
"background-color:"
"qlineargradient(x1:0,y1:0,x2:0,y2:1,"
"stop:0#eaebfe,stop:1#76878a);"
"min-width : 75; min-height : 15;"
"border-style:outset;border-width:2px;"
"border-radius4px;border-color:black; }"
"QComboBox:pressed {"
"color:white;"
"background-color:"
"qlineargradient(x1:0,y1:0,x2:0,y2:1,"
"stop:0#08080a,stop:1#66777a);"
"border:6pxsolidwhite;"
"border-style:inset;border-width:2px;"
"border-radius6px;border-color:white; }");BTW you're welcome :D

paie
13th August 2011, 00:52
WOW!!

Thanks AGAIN!!!

Great stuff!!

What a riot! Now I must do these tests from the command line to avoid rebuilding all the time.

Added after 6 minutes:

One more thing. Thanks to the info I got from this thread and the last thread I posted, I've eliminated over a hundred lines of cruft.

Once you get the hang of style sheets, there's no other way to go.

And it preserves your look across platforms.

Many thanks.

norobro
13th August 2011, 01:43
Now I must do these tests from the command line to avoid rebuilding all the time.Since you are a "grep'er" here is a hint:
grep "\-stylesheet=" *Hopefully Wysota won't get mad ;)