I want to modify/edit the QFileDialog dialog...
Hi folks!
I'm new in Qt and I need to build a dialog which contains the SaveFileAs-alike feature, but, furthermore, in the same dialog, some ~10 informations widgets(most of them are strings and one of them is date).
in another word, I want to have the standard QFileDialog class dialog so I'll be able to further modify or edit it through the designer application.
Do you know what I mean?
I'm afraid that building such a dialog from scratch means huge amount of work-time, which I don't have.
I was trying to look in the internet and in the book called "C++ GUI Programming With Qt3", but couldn't find anything like that.
Regards.
BTW I've posted it in another forums system, so if I get an answer here or there, I'll quote it in the other forum.
Re: I want to modify/edit the QFileDialog dialog...
You can subclass the QFileDialog. Then pull out the layout( ) and place your widget(s) appropriatly:
Code:
mpPropertiesGrp = [COLOR=#0000ff]new[/COLOR] QGroupBox( tr( [COLOR=#a31515]"Properties"[/COLOR] ) );
mpPropertiesLayout = [COLOR=#0000ff]new[/COLOR] QGridLayout( );
mpPropertyLbl = [COLOR=#0000ff]new[/COLOR] QLabel( [COLOR=#a31515]" "[/COLOR] );
mpPropertyLbl->setAlignment( Qt::AlignTop | Qt::AlignLeft );
mpPropertiesLayout->addWidget( mpPropertyLbl, 0, 0, 3, 2 );
mpPropertiesGrp->setLayout( mpPropertiesLayout );
mainLayout->addWidget( mpPropertiesGrp, 0, 3, 4, 3 );
This snippit puts a Properties panel on the right hand side of the QFileDialog. This is using Qt4. The code would have to be modified a bit for Qt3. Hope this helps.
Re: I want to modify/edit the QFileDialog dialog...
Huge thanks!!
Although your code doesn't work(The setLayout() method said ti be a private one), maybe due to the differences between Qt3 and Qt4, it's very useful for as an example to start with and now I know where to focus and look in the documents without reading it from A to Z.
I'm trying to create my dialog now.
Thanks again!
Re: I want to modify/edit the QFileDialog dialog...
Whoops, I missed you were in Qt3.
The code example should still work. Basically you need to get the QFileDialog's layout
QGridLayout *layout = (QGridLayout *)fileDialog->layout( );
and then you can put in any widget into it. The setLayout( ) was for the QGroupBox.
Re: I want to modify/edit the QFileDialog dialog...
Thanks a lot!!
God bless you :)
I can see QT is not really inferior to MFC, if at all, it just doesn't have immediate on-line documentation.
Re: I want to modify/edit the QFileDialog dialog...
Quote:
Originally Posted by
InterFan
it just doesn't have immediate on-line documentation.
Do you use Qt Assistant?
Re: I want to modify/edit the QFileDialog dialog...
Quote:
Originally Posted by
InterFan
Thanks a lot!!
God bless you :)
I can see QT is not really inferior to MFC, if at all, it just doesn't have immediate on-line documentation.
Actually, I think the online/included API documentation and examples are wonderful compared to other toolkits I have used. http://doc.trolltech.com/ has all the API and examples for using Qt. All this documentation is included with the Qt bundles as well. Not to mention QtCentre for specific questions. I have NEVER had a more responsive forum, including MFC. Best of luck in your Qt endeavours!
Re: I want to modify/edit the QFileDialog dialog...
Maybe it's my mistake, but while the Qt(including assistant which I do use) is great as a reference, it was much more difficult for me to 'get start quickly with zero knowledge" than with MFC which was immediate.