[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Replacing widgets in dynamically created widgets
From:       "Nicholas Hagen" <tommy () zidnet ! net>
Date:       2003-04-10 16:33:50
[Download RAW message or body]

>From your screenshots, I'm assuming the problem is that the widget overlaps
the frame?
I don't know if this would work or not, but I know that when I need to
update the view after creating a window or dialog I sometimes have to call
hide on the main window and then show on the main window which often times
updates the UI correctly.  Also, maybe look at calling QLayout::invalidate
or some of those other related functions that will re-do the layout for you
and lay items out again.  That is suppose to be called automatically, but
maybe in your case it needs to be manually called as well.

Just some ideas,
Nick

----- Original Message -----
From: "Christian Nitschkowski" <segfault-kde-devel@gmx.net>
To: <kde-devel@kde.org>
Sent: Wednesday, April 09, 2003 1:13 PM
Subject: Replacing widgets in dynamically created widgets


> Hi there!
> I have a question about replacing widgets and adding them to the
appropiate
> QLayout.
>
> In my app, I'm using libqui to create widgets dynamically from
> QT-designer-files, so even the user is able to easily redesign the
dialogs.
> But now, I've run into problems.
> I'm using my own custom widgets in these dialogs. They aren't available in
> QT-designer, so I have to use one of three possible approaches:
>
> 1. Write a plugin for QT-designer and install it together with the
> application.
> 2. Add a custom widget in QT-designer.
> 3. Add a placeholder-widget in the dialog and replace it later with my
custom
> one (for example, the user could insert a QLabel, and I'll replace it with
my
> own version of a KListView or something)
>
> At first, I've tried the first approach. But this wasn't so easy to
achieve,
> because my custom widgets depend on some stuff that really shouldn't go to
> the lib, so the plugin wouldn't be able to be loaded later because of
> unresolved symbols.
>
> So I thought about trying the second version - to simply add custom
widgets in
> QT-designer.
> But this would (AFAIK) require that the user get's my
designer-configuration
> installed.
>
> As a last possible(?) solution I tried to simply add a placeholder-widget
in
> the dialog.
> Later, when the app creates the actual dialog-instance, it will seek the
> placeholder-widget, delete it and insert a new custom widget.
> This works just fine - except when it comes to adding the new widget to
> existing layouts.
>
> Take a look at
> http://segfaultskde.berlios.de/other/kinitiator-problems/testcase.html
> to see the problem.
>
> Is there a way to correctly add the new widget to a layout without knowing
the
> structure of the dialog at compiletime?
> As you can see in
> http://segfaultskde.berlios.de/other/kinitiator-problems/kinitiator3.png
> I found a solution that nearly worked as it should - but it's quite not
that
> perfect.
>
> I know, this is not that trivial (at least I think so), but you would be
my
> super-C++-coding-hero if you could help me in some way :-)
>
> Regards
> Christian Nitschkowski
>
> --
> If builders built buildings the way programmers wrote programs, then the
first
> woodpecker that came along would destroy civilization.
>
> Murphy's Law
>
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
unsubscribe <<

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic