Results 1 to 3 of 3

Thread: QFontDialog - How to change the list of the available sizes of the fonts

  1. #1
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    8
    Qt products
    Qt3 Qt4

    Default QFontDialog - How to change the list of the available sizes of the fonts

    Hi,

    My application writes texts and draws lines on a QMainDialog and it must respect an area, so the size of the font could be wrong if the user selected an incorrect dimension.

    This is why I'd like to change the list of the available sizes of the font the user can select opening the QFontDialog in order to prevent the user to select a size bigger than the cell where the text is written.

    I think it's impossible to reimplement this class. Isn't it ? So, I thought that QFontDialog and QFontDatabase can be linked one to the other. My I can't see a link between these two classes.

    Have you tried something like this ?

    Thank you.

    Placido.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFontDialog - How to change the list of the available sizes of the fonts

    Not really. I don't see any way in which you could remove some size options for a specific font from the QFontDatabase.

    Why don't you implement your own font dialog and populate it with the fonts you need. In this case it will also be possible to restrict the size options the user has.

    Regards

  3. The following user says thank you to marcel for this useful post:

    Placido Currò (20th April 2007)

  4. #3
    Join Date
    Sep 2006
    Posts
    23
    Thanks
    8
    Qt products
    Qt3 Qt4

    Default Re: QFontDialog - How to change the list of the available sizes of the fonts

    Yes, it is easier way to get what I want. I wished a tricky solution.

    Thank you.

    Placido.

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.