You are not logged in.

e_val

Beginner

  • "e_val" is male
  • "e_val" started this thread

Posts: 7

Location: Russian Federation

  • Send private message

1

Monday, November 13th 2006, 9:07am

Laying out widgets

Hi,

I've came across the strange problem while laying out widgets.
Imagine you have a dialog with QTabWidget and three pages.
Your open one page .ui file (let's say, in Qt Designer) and add one checkbox above all the widgets it already has then lay them out vertically. So the page looks like

Source code

1
2
3
4
[x] Your new checkbox
+--------------------------+
|  Old page content     |
+--------------------------+


The problem is, when dialog is created, tab contents are truncated - the dialog does not adjust its size for the new contents, although it looks just fine in Qt Designer. What could cause this behavior? I certainly expect layout manager to cope with things like dialog size automatically - but it doesn't do this job. I'm sure I'm missing something obvious. Thanks in advance

The second example: create QButtonGroup and add buttons layed in a grid to it. Chances are they would get truncated - QButtonGroup also doesn't adjust it's size (even if I ask it - it has ity's own opinion on what the correct size is).

P.S. I'm posting this question here because it doesnot seem to be Designer-specific.

cs_raja

Trainee

  • "cs_raja" is male

Posts: 103

Location: Hyderabad

Occupation: Software Engineer

  • Send private message

2

Monday, November 13th 2006, 11:12am

RE: Laying out widgets

Select both check box and tabwidget and click on the vertical layout button in the too bar
" An expert is a man who has made all the mistakes which can be made in a very narrow field. "

e_val

Beginner

  • "e_val" is male
  • "e_val" started this thread

Posts: 7

Location: Russian Federation

  • Send private message

3

Monday, November 13th 2006, 2:37pm

RE: Laying out widgets

Quoted


Select both check box and tabwidget and click on the vertical layout button in the too bar


Thank you for your advice, but I can't do this... It's plugin-based system and I don not have direct access to the tab widget, neither programmatically nor in the Designer. I'm just writing KDE plugin which export the widget created in Designer.

e_val

Beginner

  • "e_val" is male
  • "e_val" started this thread

Posts: 7

Location: Russian Federation

  • Send private message

4

Tuesday, November 14th 2006, 10:35am

RE: Laying out widgets

I've resolved the issue. :)

As expected, it was my stupid error. I thought that if I select subwidgets and choose, say, Lay Out Vertically, I'll get a form with QVBoxLayout installed. That's not true (and I've forgotten it after a two-month break in my Qt programming) - you need to select widget (i.e. form) itself and lay it out vertically. The same applies to other containers i.e. QButtonGroup.