Results 1 to 12 of 12

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

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    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?

  2. #2
    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

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    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?

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
  •  
Qt is a trademark of The Qt Company.