开发者

not getting windows 7 native look and feel

开发者 https://www.devze.com 2023-04-04 08:02 出处:网络
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. H

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:

not getting windows 7 native look and feel

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


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).


It seems that the windowsxp and windowsvista styles are not right configured to be compiled, you can add -style-windowsxp and -style-windowsvista to your configure command line and rebuild your qt source.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号