Qt-interest Archive, August 2006
Launching a totally independent dialog
Message 1 in thread
Hello:
I am trying to launch indepent dialogs from a form. I have read the
qtcentre FAQ and I have tried modal-less dialogs, but when I call
that method the emerging dialog shows up and dissapears (If a use a
global variable I can't access the main window). I have tried
providing a "null" to the dialog constructor so the dialog is not
refered to the main window.
More Ideas?
Thanks in advance.
Tomás Aguado Gómez
Grupo de Sistemas y Comunicaciones
Universidad Rey Juan Carlos
Móstoles Madrid
http://gsyc.escet.urjc.es
Message 2 in thread
On 06.08.06 13:47:32, Tomás Aguado Gómez wrote:
> I am trying to launch indepent dialogs from a form. I have read the qtcentre
> FAQ and I have tried modal-less dialogs, but when I call that method the
> emerging dialog shows up and dissapears
That sounds like you create the dialog on the stack, which means it's
deleted at the end of the function. You need to create it on the heap
using new. Have a look at the qt examples, IIRC there was something
showing how to use modeless dialogs.
Andreas
--
[ signature omitted ]
Message 3 in thread
It could be the problem but I allocated memory in a protected
property of my class using the new operator, so it can't be the heap
problem; the problem is now that the dialog apperars but it is not
modeless, as I can't access the main window:
The member:
private:
....
uitoh* uitoh_ed; /*This is my custom QDIalog*/
.....
Memory Allocation(the place where I call the dialog):
....
uitoh_ed = new uitoh(this);
uitoh_ed.setModal(TRUE);
uitoh_ed->show();
uitoh_ed->raise();
....
Thanks!
El 06/08/2006, a las 14:10, Andreas Pakulat escribió:
> On 06.08.06 13:47:32, Tomás Aguado Gómez wrote:
>> I am trying to launch indepent dialogs from a form. I have read
>> the qtcentre
>> FAQ and I have tried modal-less dialogs, but when I call that
>> method the
>> emerging dialog shows up and dissapears
>
> That sounds like you create the dialog on the stack, which means it's
> deleted at the end of the function. You need to create it on the heap
> using new. Have a look at the qt examples, IIRC there was something
> showing how to use modeless dialogs.
>
> Andreas
>
> --
> You will receive a legacy which will place you above want.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
Message 4 in thread
On 06.08.06 23:16:46, Tomás Aguado Gómez wrote:
> Memory Allocation(the place where I call the dialog):
> ....
> uitoh_ed = new uitoh(this);
> uitoh_ed.setModal(TRUE);
Well, did you read the documentation of that function? I guess not,
because that's exactly the line where your dialog becomes a modal one,
instead of modeless. ;-)
Andreas
--
[ signature omitted ]