1

Here is the structure of a QToolBox :

QToolBox
    QWidget
    Qwidget
    ...

I know that I can add a Layout before the Toolbox, in a widget, but can we add a Layout to a QToolBox page or is this impossible as QToolBox is a pre-build widget?

Layout
    QToolBox
      (Layout?)
        QWidget
            Layout
        QWidget

Is it possible to add a Layout where I put the (Layout?)? Is there any manner that a widget in a toolbox can be layout to the entire toolbox?

Layout
    QToolBox
        Page1 ( widget )
            Layout
                widget
                widget
                ...
        Page2 ( widget )
            ...

I tried to add a layout in the page using QtDesigner, that is formatting the widgets, and it is working, but what I can't do, is to have the widgets over the entire Page. So I thought that if I add a Layout between the Toolbox and the page, it would work. I tried the setLayout() method of widget, but it wasn't successful

Syrupsystem
  • 181
  • 1
  • 11
  • Sorry, but I don't understand what you're trying to do. What would the `layout` inside the `QToolBox` do? If you want to put a single widget inside `QToolBox`, why are you even using a `QToolBox`? – Avaris Feb 20 '13 at 09:59
  • I want a layout IN the Toolbox for all the widgets in the Tool box. Actually, the widgets I am describing here are the pages of the toolbox. What I can't do, is actually having the widgets in the pages with a useful layout in it – Syrupsystem Feb 20 '13 at 10:12
  • OK, but what's the point of that layout? `QToolBox` has already a layout and certain functionality. What else would that layout do? – Avaris Feb 20 '13 at 10:14
  • I've tried to explain it better =x – Syrupsystem Feb 20 '13 at 10:19
  • OK, now, you can do _that_. Still, I'm unclear about your trouble. Do you want a uniform/identical layout for _all_ your pages? – Avaris Feb 20 '13 at 10:22
  • Exactly, but what I don't understand is that when I put my widgets ( these in the page) in a Layout, as the layout in not dependant of the page ( cause the page is the parent of the layout ), I can't format my page as I want... – Syrupsystem Feb 20 '13 at 10:28
  • If you're trying to 'share' the layout, that won't work. Each page should get its own layout. Usually, you'd create a custom `Page` widget/subclass that has your layout (either in Designer, or by code), instantiate it for each of your pages and add that to the `QToolBox`. – Avaris Feb 20 '13 at 10:47

0 Answers0