Qt-interest Archive, December 2006
widget flags-(help!)
Message 1 in thread
I would like to know what the following parameter values mean when declaring a dialog (userinfo is a qdialog form) in qt3 in the following manner userInfo( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ) I know that modal has been obsolete in these declarations since QT3.2, and how to set that, and i know that name is optional, but what does it mean to set Qt::WFlags fl to 0? Could i set it to somthing else in this very declaration? example Qt::WFlags fl = WStyle_Customize to leave out a "what's this button in the dialog"? The thing is i am porting an old qt3 project to qt4 and since i want "userinfo" (above), to inherit QDialog, it cannot take that much arguments, so i need to know what i can leave out or omit. I just need to know exactly, in detail how these declarations work. I am asuming that modal set to false can be left out since the default for every dialog is modeless. I am also asuming that since the flag is zero then that can be left out of the parameter list. You may still not be sure what i'm looking for after all i've said, but just please, tell me how these things work. I am not new to programming, i'm just not too certain exactly how the qt API works, and i'm reading everything. Thanks in advance.
_________________________________________________________________
Fixing up the home? Live Search can help.
http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=wlmemailtaglinenov06
Message 2 in thread
Hi,
> I would like to know what the following parameter values mean when
> declaring a dialog (userinfo is a qdialog form) in qt3 in the following
> manner
>
> userInfo( QWidget* parent = 0, const char* name = 0, bool modal = FALSE,
> Qt::WFlags fl = 0 )
We don't know that since userInfo is not a Qt class and we don't have
the sources. It really depends on the constructors of userInfo and how
they use these parameters.
Now since userInfo inherits QDialog, I would expect its constructor to
use its arguments as most other classes do, that is, merely passing them
to QDialog. The QDialog constructor and its arguments are documented here:
http://doc.trolltech.com/3.3/qdialog.html#QDialog
> I know that modal has been obsolete in these declarations since QT3.2,
> and how to set that, and i know that name is optional, but what does it
> mean to set Qt::WFlags fl to 0? Could i set it to somthing else in this
> very declaration? example
>
> Qt::WFlags fl = WStyle_Customize
>
> to leave out a "what's this button in the dialog"?
You could indeed do something like that, but why would you want to do
that in Qt 4 if you don't in Qt 3? Keep things as they are. The QDialog
constructor in Qt 4 is really like the QDialog constructor in Qt 3:
http://doc.trolltech.com/4.2/qdialog.html#QDialog
except the 'name' and 'modal' arguments are gone. Just remove these
arguments.
> The thing is i am porting an old qt3 project to qt4 and since i want
> "userinfo" (above), to inherit QDialog, it cannot take that much
> arguments, so i need to know what i can leave out or omit. I just need
> to know exactly, in detail how these declarations work.
>
> I am asuming that modal set to false can be left out since the default
> for every dialog is modeless. I am also asuming that since the flag is
> zero then that can be left out of the parameter list. You may still not
> be sure what i'm looking for after all i've said, but just please, tell
> me how these things work. I am not new to programming, i'm just not too
> certain exactly how the qt API works, and i'm reading everything. Thanks
> in advance.
Just change to:
userInfo( QWidget* parent = 0, Qt::WFlags f = 0 )
--
[ signature omitted ]