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

Qt-interest Archive, March 2002
setWFlags(???)


Message 1 in thread

Hello All,
I have a splash widget derived from QtDialog that initialy cant have
WStyle_StaysOnTop flag. In a next point of program I want to change
it calling setWFlags(getWFlags() | WStyle_StaysOnTop) and it not seems
to run. So:
What method have I call to make setWFlags runs properly?

Thanks all!

-- 
 [ signature omitted ] 

Message 2 in thread

Hi!

Maybe you should try to add WStyle_Customize flag too...

Actually, we made splash in our app too. We derived from QWidget and here is
our combination of flags: Qt::WStyle_Customize | Qt::WStyle_StaysOnTop |
Qt::WStyle_NoBorder.

Best regards,
Dima Ivanets

-----Original Message-----
From: owner-qt-interest@trolltech.com
[mailto:owner-qt-interest@trolltech.com]On Behalf Of Shadow
Sent: Friday, March 15, 2002 4:06 PM
To: qt-interest@trolltech.com
Subject: setWFlags(???)


Hello All,
I have a splash widget derived from QtDialog that initialy cant have
WStyle_StaysOnTop flag. In a next point of program I want to change
it calling setWFlags(getWFlags() | WStyle_StaysOnTop) and it not seems
to run. So:
What method have I call to make setWFlags runs properly?

Thanks all!

--
 [ signature omitted ] 

Message 3 in thread

Hello Dmytro,

Monday, March 18, 2002, 3:28:18 PM, you wrote:

DI> Hi!

DI> Maybe you should try to add WStyle_Customize flag too...

DI> Actually, we made splash in our app too. We derived from QWidget and here is
DI> our combination of flags: Qt::WStyle_Customize | Qt::WStyle_StaysOnTop |
DI> Qt::WStyle_NoBorder.

Y also use this combination but my application can report errors as
messageboxes whet it starts and splash window is visible, so the
Messagebox is affocused by splash and I cant see it neither click its
buttons.

Be aware with this problem if your case have the same features in your
App.

-- 
 [ signature omitted ] 

Message 4 in thread

Hi!

Thanks for the warning, we already experienced such problem :) To avoid it
we use our splash as a parent of error Message box. (We throw exception of
our private class type, which contains info string and then catch it in
main() and show message box before exit). If error appears when splash is no
longer exists, then message box just has 0 as a parent and stays on the top
of the app.

Best regards,
Dima

-----Original Message-----
From: Shadow [mailto:jordifernandez@tavil.net]
Sent: Monday, March 18, 2002 2:28 PM
To: Dmytro Ivanets
Cc: qt-interest@trolltech.com
Subject: Re[2]: setWFlags(???)


Hello Dmytro,

Monday, March 18, 2002, 3:28:18 PM, you wrote:

DI> Hi!

DI> Maybe you should try to add WStyle_Customize flag too...

DI> Actually, we made splash in our app too. We derived from QWidget and
here is
DI> our combination of flags: Qt::WStyle_Customize | Qt::WStyle_StaysOnTop |
DI> Qt::WStyle_NoBorder.

Y also use this combination but my application can report errors as
messageboxes whet it starts and splash window is visible, so the
Messagebox is affocused by splash and I cant see it neither click its
buttons.

Be aware with this problem if your case have the same features in your
App.

--
 [ signature omitted ] 

Message 5 in thread

I am not sure I understand your question, but if the problem
is that the StaysOnTop flag seems to have no effect, here
is something that I think will help.

For the StaysOnTop flag to have any effect you also have to
set the WStyle_Customize flag. This is in the documentation,
but it isnt exactly easy to find...

Example from the docs for a splashscreen:

 QLabel *splashScreen = new QLabel( 0, "mySplashScreen",
                                  WStyle_Customize | WStyle_NoBorder |
                                  WStyle_Tool );

Hope this helps,
Erlend

> -----Original Message-----
> From: owner-qt-interest@trolltech.com
> [mailto:owner-qt-interest@trolltech.com]On Behalf Of Shadow
> Sent: Friday, March 15, 2002 15:06
> To: qt-interest@trolltech.com
> Subject: setWFlags(???)
> 
> 
> Hello All,
> I have a splash widget derived from QtDialog that initialy cant have
> WStyle_StaysOnTop flag. In a next point of program I want to change
> it calling setWFlags(getWFlags() | WStyle_StaysOnTop) and it not seems
> to run. So:
> What method have I call to make setWFlags runs properly?
> 
> Thanks all!
> 
> -- 
> Best regards,
>  Shadow                          mailto:jordifernandez@tavil.net
> 
> --
> List archive and information: http://qt-interest.trolltech.com
> 
> 


Message 6 in thread

Hello Erlend,

Friday, March 15, 2002, 3:49:40 PM, you wrote:

EH> I am not sure I understand your question, but if the problem
EH> is that the StaysOnTop flag seems to have no effect, here
EH> is something that I think will help.

EH> For the StaysOnTop flag to have any effect you also have to
EH> set the WStyle_Customize flag. This is in the documentation,
EH> but it isnt exactly easy to find...

EH> Example from the docs for a splashscreen:

EH>  QLabel *splashScreen = new QLabel( 0, "mySplashScreen",
EH>                                   WStyle_Customize | WStyle_NoBorder |
EH>                                   WStyle_Tool );

EH> Hope this helps,
EH> Erlend

Sorry I know I'm not bery clear in my questions.

I try it with WStyle_Customize flag an it runs from constructor QWidget
initializator, but not from setWFlags (WStyle_Customize | ...)
method.
The problem is that I don't know if have I to close widget and show
again or something else after call it.

-- 
 [ signature omitted ] 

Message 7 in thread

I dont know, but since this is a splashscreen, maybe you have to
explicitly call qApp->processEvents() right after you have called
the setWFlags function? I dont know, but in my experience this is
useful to force events to be processed right away.

There is a function called recreate(....) that is now obsolete
that take the usual constructor parameters including flags. I guess
that since it is obsolete there must be a way to force widgets
to take flag changes after creation. Anyone knows how this is??

Erlend

> -----Original Message-----
> From: Shadow [mailto:jordifernandez@tavil.net]
> Sent: Friday, March 15, 2002 15:51
> To: Erlend Helmersen
> Cc: qt-interest@trolltech.com
> Subject: Re[2]: setWFlags(???)
>
>
> Hello Erlend,
>
> Friday, March 15, 2002, 3:49:40 PM, you wrote:
>
> EH> I am not sure I understand your question, but if the problem
> EH> is that the StaysOnTop flag seems to have no effect, here
> EH> is something that I think will help.
>
> EH> For the StaysOnTop flag to have any effect you also have to
> EH> set the WStyle_Customize flag. This is in the documentation,
> EH> but it isnt exactly easy to find...
>
> EH> Example from the docs for a splashscreen:
>
> EH>  QLabel *splashScreen = new QLabel( 0, "mySplashScreen",
> EH>                                   WStyle_Customize | WStyle_NoBorder |
> EH>                                   WStyle_Tool );
>
> EH> Hope this helps,
> EH> Erlend
>
> Sorry I know I'm not bery clear in my questions.
>
> I try it with WStyle_Customize flag an it runs from constructor QWidget
> initializator, but not from setWFlags (WStyle_Customize | ...)
> method.
> The problem is that I don't know if have I to close widget and show
> again or something else after call it.
>
> --
> Best regards,
>  Shadow                            mailto:jordifernandez@tavil.net
>
>
>
>


Message 8 in thread

On Friday 15 March 2002 06:51, you wrote:
> Sorry I know I'm not bery clear in my questions.
>
> I try it with WStyle_Customize flag an it runs from constructor QWidget
> initializator, but not from setWFlags (WStyle_Customize | ...)
> method.
> The problem is that I don't know if have I to close widget and show
> again or something else after call it.

You have to use QWidget::reparent() if you want to change "stays on top" of 
an existing widget.  It is a good idea to search the qt-interest archives 
(http://qt-interest.trolltech.com/) before posting, as this question has been 
answered more than once I believe (now twice by me).

-Justin