Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt 4.8.3 GUI application on Linux looks old and doesn't match the designer preview

I installed Qt 4.8.3 and Qt Creator 2.5.2 on Fedora 17 and Ubuntu 12.04. When I create a GUI application, the visual elements look good in the Qt Designer preview window. However when I run the application, the resulting application has an older style which is inconsistent with the OS and does not match the preview in Qt Designer.

In both of the images below, the top part is the preview from Qt Designer and the bottom part is the compiled application.

  • Qt was installed by compiling the source located at http://qt-project.org/downloads
  • During ./configure phase of the installation, the "open source" version was chosen.
  • This issue occurs whether the application is run from the OS or launched from the IDE

Is there a way to make the compiled GUI application appear properly?

Fedora:

  • Top Half = Qt Designer preview (desired)
  • Bottom Half = resulting application

enter image description here

Ubuntu:

  • Top Half = Qt Designer preview (desired)
  • Bottom Half = resulting application

enter image description here

Addendum: Here is an image showing a 4.8.1 compiled application (how it's supposed to look like) enter image description here

Additionally, If I install both 4.8.1 and 4.8.3 on the same computer, even 4.8.1 compiled applications will not appear properly: enter image description here

like image 859
Daniel Avatar asked Nov 02 '12 02:11

Daniel


1 Answers

Problem is solved.

When installing the Qt source, the instructions forgot to mention that a list of developer libraries must be installed prior to the ./configure step. This list can be found here: http://qt-project.org/wiki/Build_Qt_For_Linux

Additionally, I had trouble compiling QtWebkit because of the error:

g++: error: unrecognized command line option ‘-fuse-ld=gold’

To solve this new problem, one of the two following solutions are possible:

  • At the configure step, run configure with the -no-webkit option: ./configure -no-webkit

OR

  • Remove the line QMAKE_LFLAGS+=-fuse-ls-gold from the file qt-everywhere.../src/3rdparty/webkit/Source/common.pri
like image 165
Daniel Avatar answered Oct 17 '22 18:10

Daniel