Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, April 2008
QWidget won't close!


Message 1 in thread

Hi All,

    I tried to close my widget by close() function but it didn't work!, 
the widget disappeared, but its process still exist!
So I'm asking you about a way for forcing the widget to be completely 
closed, could you?

By the way, I tried to use setAttribute(Qt::WA_DeleteOnClose, 1) but it 
didn't affect on closing process.

-- 
 [ signature omitted ] 

Message 2 in thread

Hi Muhammad, 
 
On Windows, a process does not close until all of its threads have been stopped. 
 
Do you have any threads in your app? 
 
Hope that helps, 
 
Tony Rietwyk. 
 

-----Original Message-----
From: M. Bashir Al-Noimi [mailto:mhdbnoimi@xxxxxxxxx] 
Sent: Tuesday, 29 April 2008 08:46
To: Qt Interest List
Subject: QWidget won't close!


Hi All,

    I tried to close my widget by close() function but it didn't work!, the widget disappeared, but its process still exist!
So I'm asking you about a way for forcing the widget to be completely closed, could you?

By the way, I tried to use setAttribute(Qt::WA_DeleteOnClose, 1) but it didn't affect on closing process.


-- 
 [ signature omitted ] 

Message 3 in thread

Tony Rietwyk wrote:
> Hi Muhammad,
>  
> On Windows, a process does not close until all of its threads have 
> been stopped.
>  
> Do you have any threads in your app?
No but I've a timer and I call timer->stop() before close the widget.
>  
> Hope that helps,
>  
> Tony Rietwyk.
>  
>
>     -----Original Message-----
>     *From:* M. Bashir Al-Noimi [mailto:mhdbnoimi@xxxxxxxxx]
>     *Sent:* Tuesday, 29 April 2008 08:46
>     *To:* Qt Interest List
>     *Subject:* QWidget won't close!
>
>     Hi All,
>
>         I tried to close my widget by close() function but it didn't
>     work!, the widget disappeared, but its process still exist!
>     So I'm asking you about a way for forcing the widget to be
>     completely closed, could you?
>
>     By the way, I tried to use setAttribute(Qt::WA_DeleteOnClose, 1)
>     but it didn't affect on closing process.
>

-- 
 [ signature omitted ] 

Message 4 in thread

"M. Bashir Al-Noimi" <mhdbnoimi@xxxxxxxxx> schreef in bericht
>    I tried to close my widget by close() function but it didn't work!, the 
> widget disappeared,
> but its process still exist!
> So I'm asking you about a way for forcing the widget to be completely 
> closed, could you?
Try just deleting your widget instead of closing it.

> By the way, I tried to use setAttribute(Qt::WA_DeleteOnClose, 1) but it 
> didn't affect on
> closing process.
Should work, but I guess it is not instantaneous. So, if you don't give Qt 
the opportunity to do it for you, it will not.

Andrà 

--
 [ signature omitted ] 

Message 5 in thread

Muhammad wrote:

> Hi All,
>
> I tried to close my widget by close() function but it didn't work!, the widget
> disappeared, but its process still exist!
> So I'm asking you about a way for forcing the widget to be completely closed, could you?
>
>By the way, I tried to use setAttribute(Qt::WA_DeleteOnClose, 1) but it didn't affect on >closing process.

Hi Muhammad, 

In the main routine, do you have something like (where a is the QApplication object): 

	a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));

or 

	a.setQuitOnLastWindowClosed( true );

Otherwise, there is nothing to stop the application event loop. 

Hope that helps, 

Tony Rietwyk

--
 [ signature omitted ]