![]() Registered Member ![]()
|
Hi,
I'm writing an application having a QFrame object which has the following widget structure inside: 1.- QHBoxLayout 1.1.- QVBoxLayout 1.1.1.-QHBoxLayout 1.1.1.1.- QLabel 1.1.1.2.- QLabel 1.1.1.3.- QLabel 1.1.2.-QHBoxLayout 1.1.2.1.- QLabel 1.1.3.-QHBoxLayout 1.1.3.1.- QLabel 1.1.3.2.- QUrlLabel 1.2.- QLabel The QFrame has the [Expanding, Fixed] sizePolicy, so it expands only horizontally and it does fine as expected. However, inner objects described in the above structure remain still and do not move as the QFrame resizes. Just doing some tests, I have moved the whole structure out of the QFrame and it moves as the MainWindow resizes, but when I put back it inside the QFrame it doesn't. How could a fix this? Best regards!
Last edited by Musikolo on Sat Jan 22, 2011 9:46 am, edited 1 time in total.
|
![]() Administrator ![]()
|
You probably want to look at a QGridLayout for your items, which should also simplify the code.
In any case make sure you have set a layout on the QFrame, which should be "1." from your diagram.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
@bcooksley: Thanks for your reply.
![]() The problem I have, please, let me know if I'm wrong, it's that QGridLayout does not allow the same visual effects as a QFrame does. It currently has framShape=StyledPanel and frameShadow=Raised. What I'm intended to is to have a kind-of panel (QFrame) using the Raised visual effect and place all those QLabels on it. Is it possible to do the same thing with a QGridLaout or by some other way? ![]() Best regards! ![]() |
![]() Administrator ![]()
|
You are getting things confused here. You would use QFrame with QGridLayout managing it's contents. Your current approach has you using a QFrame with QHBoxLayout managing it's contents.
In any case, your current code, assuming it doesn't use designer, is probably missing the needed QFrame setLayout() call.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
@bcooksley: I love you man, by doing what you said fixed the issue:
Thanks a million! |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft