Qt-interest Archive, March 2002
How to: use Qdir as a Widget ?
Message 1 in thread
Hi,
I'm using the help of the designer (Qt3.0 free version) to create my
application.
I would like to have a Qdir included in a window (and not in an
independant
platform)... does anybody know how to do this (in a simple way) ?
Thanks
Fred
--- Begin Message ---
Hi,
I'm using the help of the designer (Qt3.0 free version) to create my
application.
I would like to have a Qdir included in a window (and not in an independant
platform)... does anybody know how to do this (in a simple way) ?
Thanks
Fred
--- End Message ---
Message 2 in thread
Hello trolls,
I've got two relatively simple questions... maybe someone can help the beginner I am.
1 - a QDir widget would be very helpful for my application, but I would like to include it
directly in a TabWidget... so, I was wondering how to include QDir in the designer as a
"custom" widget ?
2 - I've got a quite simple widget (let say A) which relays some informations contained
in an other widget (B). In fact, there can be a lot of B's but only one would be "active"
at a time, so I just need one A. I manage to have only this 1 A by using a boolean that
is set to false after the first B is called... then, any other B created afterward would
not
create a A. Things work okay except when one closes A by the X in the window
manager... I was hoping that this would call the destructor of my widget in which I
set my boolean to true again (to allow an other A to be created). Unfortunatly, the
destructor is not called...
I read a few messages on the mailing list talking about this problem but I cannot make
sense of them... how do I link the X of the window manager to my destructor ?
Thanks for any help,
Fred
Message 3 in thread
I'm not familiar the designer, but I hope I could answer
your second question.
Closing a window (a top-level widget) is not equal to
destroying a window, because handling a window depends on
OS deeply. Actually after you close a window, it becomes
hide but still exists for a while.
In your case, it may be better to move the work from the
destructor to overrided QWidget::close (bool) method.
Naoyuki
Message 4 in thread
Greetings, Frederic,
3/22/2002 3:10:35 PM, Frederic Sarazin <sarazin@triumf.ca> wrote:
> ... <snip>... Unfortunatly, the destructor is not called...
>I read a few messages on the mailing list talking about this problem but I cannot make
>sense of them... how do I link the X of the window manager to my destructor ?
I haven't done exactly what you want, but something (probably) similar enough.
Supposing your Awidget class is displayed in a window called AWINDOW
(i.e. "AWidget" is the "this" in the line below) . Make a method "your_preExitRoutine()"
on AWidget which handles the non-gui tasks you need to do before leaving,
(like resetting your boolean), and connect it up with a line like this in the AWidget's init().
AWINDOW->connect( AWINDOW, SIGNAL(aboutToQuit()), this, SLOT(your_preExitRoutine() );
Good luck.
Regards,
Jerry Barenholtz