PDA

View Full Version : Qt Application looks ugly with static linking but fine with shared linking?



gurmeetsingh
6th February 2012, 13:52
Hi Experts,

I am developing a Qt dialog based application,
When i compile it with shared linking then everything works fine as i need to devlope same application with static linking but with static linking it looks too ugly and also ui is classic ui.

I am using Qt creator 2.2.1 based on Qt 4.7.4 (32 bit)
source version of Qt is Qt-4.8.0.
uname -a returning
Linux ubuntu 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 17:23:00 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

How i can solve this problem:confused:?

Thanks in advance.

wysota
6th February 2012, 15:04
Basically you probably can't. By using static linking you resign from using plugins which are used by Qt (and KDE) to handle widget styling. What you can do is that you can compile a static version of an appropriate widget style plugin and force that style on your application. However in this situation your application will not inherit the style from the rest of your system if it uses a style that itself is implemented as a plugin.

gurmeetsingh
7th February 2012, 06:07
Thanks Wysota for your response.

I have another machine having
Qt creator 2.2.1 based on Qt 4.7.4 (32 bit)
source version of Qt is Qt-4.8.0.
uname -a returning
Linux ravi-desktop 3.0.0-15-generic #26-Ubuntu SMP Fri Jan 20 15:59:53 UTC 2012 i686 i686 i386 GNU/Linux

The static as well as shared linking works fine on above mentioned system. There is no difference of UI at all between statically linking and shared linking. Only one issue is that application is littlebit slow.

what may be the problem on my system?

Can i compile static application on another machine both for 32 bit and 64 bit Ubuntu system and how?

Thanks in advance.

wysota
7th February 2012, 10:40
The other system probably has different settings or uses different software.


Can i compile static application on another machine both for 32 bit and 64 bit Ubuntu system and how?
If you have 32 and 64b compilers and libraries, then yes, just use appropriate qmake. However usually 64bit systems support 32bit binaries, so building a trully static 32bit version should be enough.