> How can I tell QT Designers to create my QWidget with other arguments?
I think, that you can't, because QDesigner doesn't know about value of argument, that it should set while calling your constructor.
You can:
1. Make a default value for your parameters, as this
MyClass
( QWidget * parent, MyParamClass myParam
= (),
QString initString
= "initialize" )
MyClass( QWidget * parent, MyParamClass myParam = (), QString initString = "initialize" )
To copy to clipboard, switch view to plain text mode
2. Make two constructors: with standard Qt's parameter QWidget * parent, and with your own parameters, and call the second if you're creating you class from code
3. Add function(s) to your class, that will set parameters (as Qt likes to do, for example: QFile( QString filename ) and QFile::setFileName( QString filename )
Bookmarks