When I run my Qt application on Linux Mint Cinnamon 18 it doesn't use the GTK theme colours or system font. Qt Creator has the same issue, but other Qt applications I've tried (XnView MP and qBittorrent) do correctly use my GTK theme. It therefore appears there is a way to get it to work, but I'm unsure how.
I tried this (even though it should be true by default):
QApplication::setDesktopSettingsAware(true);
To copy to clipboard, switch view to plain text mode
That didn't work, so I tried forcing the style to Fusion with:
QApplication::setStyle(QStyleFactory::create("Fusion"));
To copy to clipboard, switch view to plain text mode
This too had no effect. I asked on Stack Overflow and somebody said he solved the issue using:
qApp->setStyle(new QProxyStyle());
qApp->setStyle(new QProxyStyle());
To copy to clipboard, switch view to plain text mode
Unfortunately that didn't work for me. I've looked at the qBittorrent code to try and work how why that follows the GTK theme while my application doesn't, but I couldn't see anything relevant to the issue. I also tried making a very simple Qt application, but that too doesn't use the theme. I'm therefore at a loss as to why other Qt application follow the GTK theme, but Qt Creator and any application I make doesn't
Can anyone suggest what I should do to make the application use the GTK theme?
Bookmarks