Results 1 to 6 of 6

Thread: my own FontDialog

  1. #1
    Join Date
    Apr 2009
    Posts
    20
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default my own FontDialog

    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.

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: my own FontDialog

    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.
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Apr 2009
    Posts
    20
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: my own FontDialog

    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?

  4. #4
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: my own FontDialog

    Create a layout for your new dialog and place QFontDialog as one of its widgets, then add additional UI elements to this layout.
    I'm a rebel in the S.D.G.

  5. #5
    Join Date
    Apr 2009
    Posts
    20
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: my own FontDialog

    How exactly to do it?

  6. #6
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: my own FontDialog

    Since QDialog derives from QWidget you can do

    Qt Code:
    1. yourLayout->addWidget(regularFontDialog);
    2. yourLayout->addWidget(additionalUiElement1);
    3. ...
    4. yourLayout->addWidget(additionalUiElement2);
    To copy to clipboard, switch view to plain text mode 

    Note: you have to arrange them as you like.
    I'm a rebel in the S.D.G.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.