Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

not getting windows 7 native look and feel

I've recently downloaded and build qt 4.7.4 locally, but there's one problem I've been having since using it. I'm not getting the Windows 7 look and feel. I didn't have this problem with 4.6.3. Here is what my designer.exe looks like:

enter image description here

I keep getting this look even though I've tried opening the application with the following commands:

designer.exe -style windowsxp
designer.exe -style windowsvista

I've tried opening the app with the CDE and Plastique styles and those DO get applied to the application.

This look and feel also persists with my own Qt GUI projects. Any help or ideas are welcomed.

Edit:

My Qt configuration is as follow:

-opensource -platform win32-g++ -qt-sql-sqlite -no-qt3support -no-3dnow 
-no-phonon -no-multimedia -no-audio-backend -no-webkit -no-native-gestures 
-no-qmake
like image 351
creatio Avatar asked Sep 09 '11 16:09

creatio


1 Answers

I also have the same problem with Qt 4.8.0.

Before trying to reconfigure with -qt-style-windowsvista you have to install Windows SDK for Windows 7 from Microsoft web site. Otherwise native style detection will fail.

See http://www.slideshare.net/qtbynokia/how-to-make-your-qt-app-look-native (slide 8) and http://lists.qt.nokia.com/pipermail/qt-interest/2010-November/028971.html

Also if you have GCC 4.6 or more recent, use -platform win32-g++-4.6

This is how I solved the same problem yesterday with Qt 4.8.0 using MinGW64 (TDM GCC 4.6.1):

  1. install Windows SDK in default directory (%WINSDK% in my instruction list)
  2. add %WINSDK%\bin to PATH (or %WINSDK%\bin\x64 for 64-bit Windows)
  3. call configure with the following options (among others): -native-gestures -qt-style-windowsxp -qt-style-windowsvista
  4. check the first output lines of configure to see if windowsvista style is enabled
  5. build Qt: mingw32-make or nmake (VS)

Now both Qt designer and my applications have Windows 7 look & feel (Qt style) enabled (and are 64-bits executables in my case).

like image 119
LD. Avatar answered Nov 15 '22 08:11

LD.