Results 1 to 12 of 12

Thread: qtconfig - can it be downloaded or should it be packaged with app?

  1. #1
    Join Date
    Mar 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default qtconfig - can it be downloaded or should it be packaged with app?

    Topic says it all. I have users complaining that the default font size is so large on MacOSX that on smaller displays the app window is beyond the display screen. Since the qtconfig.app utility is available, can it be downloaded by end users for configuring or should I include the one that was included with Qt with the application package?

    Thank you very much,

    Robert

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    How about just letting your users change the default font from within your application settings dialog?

  3. #3
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Qt uses the system font by default. If your users are complaining about too large of fonts, check to make sure you aren't overriding their font choices. This includes in Designer ui files.

  4. #4
    Join Date
    Mar 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Quote Originally Posted by wysota View Post
    How about just letting your users change the default font from within your application settings dialog?
    1. This is not my application - I am porting it to Mac from Windows for someone who cannot.

    2. It doesn't have nearly that sophistication.

    3. I'm very green on Qt. Currently taking a break from plugin dev of my commercial plugin to do this.

    I've tried setting the QApplication font, but this does not appear to have any effect on QWidgets, only QLabels.

    I've found that qtconfig doesn't affect the QWidget font either (only QLabels once again). (Yes, I saved the config.)

    Thanks,

    Robert

  5. #5
    Join Date
    Mar 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Quote Originally Posted by Brandybuck View Post
    Qt uses the system font by default. If your users are complaining about too large of fonts, check to make sure you aren't overriding their font choices. This includes in Designer ui files.
    I understand this. There is no QtDesigner UI being used. The simple interface is 'hand coded'. There are no font settings (though I added some to see what happened - these have been removed since).

    On the Mac, it seems that the default font settings for Qt (qtconfig) are large (Lucida Grande 13 point). There is nowhere of which I am aware to set the 'system' font for all applications - only Finder.

    Since the control widgets are in one long column mainly, I had considered using the current GroupBox layout as a template for doing a set of QTabs instead - but this means also rearranging the functionality methods and class variables (etc.). Not really predisposed to the effort required.

    Thanks,
    Robert

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Quote Originally Posted by kuroyume0161 View Post
    1. This is not my application - I am porting it to Mac from Windows for someone who cannot.
    Does it mean you can't extend it with a simple dialog?

    2. It doesn't have nearly that sophistication.
    It doesn't have to be sophisticated, just a plain dialog with a font combobox.

    3. I'm very green on Qt.
    It's really simple, just use QApplication::setFont().

    I've tried setting the QApplication font, but this does not appear to have any effect on QWidgets, only QLabels.
    How did you do it?

  7. #7
    Join Date
    Mar 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Quote Originally Posted by wysota View Post
    Does it mean you can't extend it with a simple dialog?

    It doesn't have to be sophisticated, just a plain dialog with a font combobox.

    It's really simple, just use QApplication::setFont().
    When I say green, I mean that I just managed to get Qt built as a static lib and do qmake to set up an Xcode project which, with some fiddling, resulted in the working app.

    I've never coded with Qt previously (I'm a Java/Python/Cinema 4D C++ SDK developer).

    How did you do it?
    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication application(argc, argv);
    4.  
    5. IvyGenerator ivyGenerator;
    6.  
    7. ivyGenerator.show();
    8.  
    9. application.connect(&application, SIGNAL(lastWindowClosed()), &application, SLOT(quit()));
    10.  
    11. // *** Added here ***
    12. QFont f("Helvetica", 8);
    13. application.setFont(f);
    14. // *** ---- ****
    15.  
    16. return application.exec();
    17. }
    To copy to clipboard, switch view to plain text mode 

    This is the only place where QApplication is mentioned - though I suspect that it can be had from one of the widgets (?).

    Thanks,
    Robert

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    If the application uses custom widgets which are not well written, you won't be able to change the default font. Each widget should be familiar with the default font (just like QLabel is). Does the application use badly written widgets?

  9. #9
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Quote Originally Posted by kuroyume0161 View Post
    On the Mac, it seems that the default font settings for Qt (qtconfig) are large (Lucida Grande 13 point). There is nowhere of which I am aware to set the 'system' font for all applications - only Finder.
    Don't use qtconfig, it just causes more problems than it's worth. It doesn't give you any way to unset the default font. So once you set a font with it, you stuck with it. My advice is to find the Trolltech preferences file in your home directory and delete it. Yes, delete it. The only things important in there will be recreated the next time you run a Qt app. (I don't have my Mac with my today, so I can't look up where this file is).

    As for setting the system font, since I don't have my Mac with me, I can't look up where you set this. But I do know that you can. It may be listed under accessibility.

  10. #10
    Join Date
    Mar 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Quote Originally Posted by Brandybuck View Post
    Don't use qtconfig, it just causes more problems than it's worth. It doesn't give you any way to unset the default font. So once you set a font with it, you stuck with it. My advice is to find the Trolltech preferences file in your home directory and delete it. Yes, delete it. The only things important in there will be recreated the next time you run a Qt app. (I don't have my Mac with my today, so I can't look up where this file is).

    As for setting the system font, since I don't have my Mac with me, I can't look up where you set this. But I do know that you can. It may be listed under accessibility.
    Thanks for the advice Brandybuck!

    I've found that using setFont() for each widget (QLabel, QPushButton, QGroupBox) has reduced all of the text except for the QPushButtons (?). Nonetheless, this still doesn't allow the vertical sizing to go more than a few pixels less than the geometry of the window.

    For the Cinema 4D SDK, I'm very use to using scrollareas and tabs to condense space used by large interfaces and small screens. But I have no experience with Qt in these regards. Different GUI paradigms as well. Grouping GUI elements in the SDK is just a matter of grouping them (GroupBegin() and GroupEnd() - that includes tabs and scrollareas) but no real extensibility - though there are ways with customgui elements. Grouping in Qt seems to involve 'parenting' of widgets which means that although all elements are added to a particular window/dialog, they may be actually specified deep down in some widget attached to a widget etc.

    This is where I'm having a little conceptual problem with how to break out the three vertical groups of widgets into tabs as this seems to require each tab be its own class (from the example at Trolltech). This means carrying along the actions associated with the widgets that now reside all in one widget class. Probably not difficult, but I don't want to end up with a mess - code is backed up. I was also hoping for a quick solution as my *real* work is tugging at my shirt. I have rotation conversion tables to examine and analyze for starters.

    Thanks,
    Robert

  11. #11
    Join Date
    Mar 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    Well, the first try at tabs was confusing - but I was forcing the situation in the wrong direction. The second try was a complete success - and it didn't take long at all. The QTimer was, as suspected, a little sticky as I figured the SLOT() would not work pointing to another class from the original. A simple method in the original class calling the other class method did the trick*.

    * The timer is called from two of the new tab classes, so it was decided to keep the original in the original class and pass it to each for the start() and stop() calls involved.

    So now fonts are not a concern since the tabs reduce the real estate occupied by the application window.

    Oh no! Could I become a Qt junky!

    Thanks all for you help and patience!

    Robert

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qtconfig - can it be downloaded or should it be packaged with app?

    QPushButton won't make itself smaller than 80x25 (of course unless you force it to by setting a maximum width for it).

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.