PDA

View Full Version : my own FontDialog



dilidpan
30th June 2009, 11:18
Hello everybody,
could anyone tell me how to make my own FontDialog? I need to add more UI elements to the dialog and prompt for a couple of more options as well as the standard font selection.
Thanks in advance.

lyuts
30th June 2009, 11:46
You need to make a list of requirements for this dialog. Then make a design for it. When you are done, take a look at any dialog example that comes with Qt (let say examples/dialogs/configdialog) and try to create your desired dialog.

dilidpan
30th June 2009, 13:47
I know how to make dialogs, using QT designer. But my question is how to do my Font Dialog, which is based on standard QFontDialog. There is input widget Font combo box in QT Designer, but I need also font style, font size and so on. I must use standard Font dialog and on the same dialog I must have some more widgets. How to upgrade Font Dialog?

lyuts
30th June 2009, 13:53
Create a layout for your new dialog and place QFontDialog as one of its widgets, then add additional UI elements to this layout.

dilidpan
1st July 2009, 11:16
How exactly to do it?

lyuts
1st July 2009, 12:06
Since QDialog derives from QWidget you can do



yourLayout->addWidget(regularFontDialog);
yourLayout->addWidget(additionalUiElement1);
...
yourLayout->addWidget(additionalUiElement2);


Note: you have to arrange them as you like.