Results 1 to 5 of 5

Thread: KDE 3 style applied to Qt 4 programs

  1. #1
    Join Date
    Jul 2006
    Posts
    20
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default KDE 3 style applied to Qt 4 programs

    Is there an easy way to 'force' the KDE 3 style chosen for my desktop to Qt 4 programs? It doesn't bother me to write some (not too much) code in my program to make it look like the rest of the programs.

    (I have to some GTK+ stuff for school and the Gtk/Qt engine got me by surprize, my GTK+ 2 program had the KDE style buttons )

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: KDE 3 style applied to Qt 4 programs

    No, it's not possible. Qt3 and Qt4 style API differs very much. But you should be able to force a KDE4 style on a Qt4 app.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    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: KDE 3 style applied to Qt 4 programs

    There is no way around it - you can't style Qt4 apps with Qt3 styles without rewriting them for Qt4.

  4. #4
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: KDE 3 style applied to Qt 4 programs

    Ok, my question is the other way round: is there a way to not force KDE3 settings on Qt4 apps? Why I'm asking is: I'm (still) using KDE3 (with the Baghira style) and some Qt4 apps. Those apps seem to take up the color theme from the KDE3 style, which in the end doesn't look very good on Qt4 because, frankly, this theme is waaaay too configurable, and I (of course) use this to an excessive amount to make it look like my preferred GUI But with any other style the color choice looks very odd.

    I would expect other KDE3 styles to adopt these color settings, but I was really surprised that Qt4 also adopts them. Now, admittedly, this might be a positive thing for most people, but for my use case it results in some plain ugly GUIs... So I'm wondering, is there a way to keep Qt4 from using KDE3's style settings (be it colors or whatever...)?

  5. #5
    Join Date
    Nov 2008
    Posts
    142
    Thanks
    3
    Thanked 20 Times in 20 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile Re: KDE 3 style applied to Qt 4 programs

    I'm gonna answer myself here. I finally discovered QApplication::setDesktopSettingsAware, which probably gets as close to solve the above mentioned issue as possible. It prevents Qt from using any desktop specific settings, be it fonts, colors or the like.

    The one thing to take notice of is that you have to set this before creating a QApplication instance, changing this setting afterwards doesn't have any effect.

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.