Qt-interest Archive, April 2007
Qt Designer problem
Message 1 in thread
Hi,
(Qt 4.2.2, Windows XP)
I am having trouble creating a form that is a QDockWidget that contains
a QToolBox.
Designer (as well as the Visual Studio integration) won't let me create
a form that has QDockWidget as the base class and contains a QToolBox.
Note, I have successfully done this using QDockWidget as base class
containing a QTabWidget and it works fine. However, Designer simply
won't let me "drop" a QToolBox onto a QDockWidget-based form.
If I make the form base class QWidget, then I can put a QDockWidget onto
it and then place a QToolBox inside the QDockWidget. However, this form
does not actually function as a dockable widget in the application.
I have looked throught the Qt help and have not found anything
addressing this.
Mark
--
[ signature omitted ]
Message 2 in thread
On 29.04.07 07:48:27, Mark Thompson wrote:
> I am having trouble creating a form that is a QDockWidget that contains a
> QToolBox.
>
> Designer (as well as the Visual Studio integration) won't let me create a form
> that has QDockWidget as the base class and contains a QToolBox. Note, I have
> successfully done this using QDockWidget as base class containing a QTabWidget
> and it works fine. However, Designer simply won't let me "drop" a QToolBox
> onto a QDockWidget-based form.
How do you create a QDockWidget base form in the first place? I'd rather
create a QDockWidget and set the toolbox as widget via code. There's no
real reason to "design" a QDockWidget like that, IMHO. Just create a
qwidget form with the content and then in code create a QWidget, setupUi
and set the whole thing as widget in a new QDockWidget.
> If I make the form base class QWidget, then I can put a QDockWidget onto it and
> then place a QToolBox inside the QDockWidget. However, this form does not
> actually function as a dockable widget in the application.
Yes, thats a bug in designer, qdockwidget shouldn't be available in the
list of widgets.
Andreas
--
[ signature omitted ]
Message 3 in thread
Hi Andreas,
Creating a DockWidget base form is possible using by invoking the "Add
new Qt GUI Class..." option inside Visual Studio. In the first pane,
use QDockWidget as the base class instead of QWidget.
However, your suggestion is much more reasonable than the way I had
tried above.
Thank you for the help!
Mark
Andreas Pakulat wrote:
> On 29.04.07 07:48:27, Mark Thompson wrote:
>
>> I am having trouble creating a form that is a QDockWidget that contains a
>> QToolBox.
>>
>> Designer (as well as the Visual Studio integration) won't let me create a form
>> that has QDockWidget as the base class and contains a QToolBox. Note, I have
>> successfully done this using QDockWidget as base class containing a QTabWidget
>> and it works fine. However, Designer simply won't let me "drop" a QToolBox
>> onto a QDockWidget-based form.
>>
>
> How do you create a QDockWidget base form in the first place? I'd rather
> create a QDockWidget and set the toolbox as widget via code. There's no
> real reason to "design" a QDockWidget like that, IMHO. Just create a
> qwidget form with the content and then in code create a QWidget, setupUi
> and set the whole thing as widget in a new QDockWidget.
>
>
>> If I make the form base class QWidget, then I can put a QDockWidget onto it and
>> then place a QToolBox inside the QDockWidget. However, this form does not
>> actually function as a dockable widget in the application.
>>
>
> Yes, thats a bug in designer, qdockwidget shouldn't be available in the
> list of widgets.
>
> Andreas
>
>
--
[ signature omitted ]
Message 4 in thread
On 29.04.07 12:55:57, Mark Thompson wrote:
> Hi Andreas,
>
> Creating a DockWidget base form is possible using by invoking the "Add new Qt
> GUI Class..." option inside Visual Studio. In the first pane, use QDockWidget
> as the base class instead of QWidget.
Aha, its not possible with sole designer, so I guess this is the same
problem as having qdockwidget available for dragging onto a QWidget. Its
buggy.
Andreas
--
[ signature omitted ]
Message 5 in thread
On 4/29/07, Andreas Pakulat <apaku@xxxxxx> wrote:
> Aha, its not possible with sole designer, so I guess this is the same
> problem as having qdockwidget available for dragging onto a QWidget. Its
> buggy.
>
There seem to be lots of things you cant do with the Designer. I dont
think you can make a layout that works like the designer itself, with
dockable parts and resizing handles for the dock layouts. You can tell
this is so because when you look at the source for Designer, it
doesn't use Designer for this! Its all done in code...
Barry
--
[ signature omitted ]
Message 6 in thread
On 30.04.07 12:31:17, Barry Rowlingson wrote:
> On 4/29/07, Andreas Pakulat <apaku@xxxxxx> wrote:
>
> >Aha, its not possible with sole designer, so I guess this is the same
> >problem as having qdockwidget available for dragging onto a QWidget. Its
> >buggy.
> >
>
> There seem to be lots of things you cant do with the Designer. I dont
> think you can make a layout that works like the designer itself, with
> dockable parts and resizing handles for the dock layouts. You can tell
> this is so because when you look at the source for Designer, it
> doesn't use Designer for this! Its all done in code...
Uhm, I see various .ui files across designers source, so while certainly
not everything can be done in designer, many things can.
And the reason, why for example the Property Editor doesn't use a .ui
file is that its only 1 class that is directly embedded into a
QDockWidget, there's no reason to add a .ui file for something that
simple.
Also I don't think the .ui files are designed to have something like
dockwidgets stored in them and I guess the generated code would have to
look more like in Qt3. But I consider the Qt4-setupUi approach much more
supperior, it allows you to share forms much more easily, because you
can apply a given form to any QWidget subclass.
Andreas
--
[ signature omitted ]