PDA

View Full Version : Qt Library on Ubuntu, strange style problem



grayfox
26th September 2011, 16:34
I compiled Qt 4.7.4 and Qt 4.8 on Ubuntu 11.04, the results are the same.
When I launch qtconfig/designer/assistant, the theme and font don't match the theme of Ubuntu, app linked with the frameworks also have strange style
6889
While using the QtCreator, QtCreator itself has style that matches the Ubuntu 11.04 style, but apps created from it don't, I tried using qtconfig to change among styles but nothing helps.
Also, if I launch qtconfig with sudo, the visual style becomes the Windows style...
Are there anyway to use the Ubuntu style in Qt-based app?

wysota
26th September 2011, 22:46
Did you build Qt with fontconfig support?

grayfox
27th September 2011, 09:08
here is how I run configure:


sh ./configure -opensource -debug-and-release -nomake examples -nomake demos -shared -fast -exceptions -no-accessibility -stl -no-qt3support -no-phonon -no-webkit -no-script -no-declarative -no-scripttools -no-declarative-debug -no-3dnow -no-openssl -qt-zlib -qt-libpng -qt-libtiff -qt-libjpeg -qt-sql-sqlite -qt-sql-mysql -I /usr/include/mysql -L /usr/lib/mysql

wysota
27th September 2011, 09:23
It's less relevant how you call configure, it is more relevant what it reports. At some point it should spit out the configuration it is going to use in a form of a list with yes/no info about each entry. Make sure fontconfig is there and the style your default Qt uses is there.

grayfox
27th September 2011, 09:38
I just rerun configure, and the result is:
Debug .................. no
Qt 3 compatibility ..... no
QtDBus module .......... no
QtConcurrent code ...... yes
QtGui module ........... yes
QtScript module ........ no
QtScriptTools module ... no
QtXmlPatterns module ... yes
Phonon module .......... no
Multimedia module ...... auto
SVG module ............. yes
WebKit module .......... no
Declarative module ..... no
Support for S60 ........ no
Symbian DEF files ...... no
STL support ............ yes
PCH support ............ yes
MMX/3DNOW/SSE/SSE2/SSE3. yes/no/yes/yes/yes
SSSE3/SSE4.1/SSE4.2..... yes/yes/yes
AVX..................... yes
Graphics System ........ default
IPv6 support ........... yes
IPv6 ifname support .... yes
getaddrinfo support .... yes
getifaddrs support ..... yes
Accessibility .......... no
NIS support ............ yes
CUPS support ........... no
Iconv support .......... yes
Glib support ........... no
GStreamer support ...... no
PulseAudio support ..... no
Large File support ..... yes
GIF support ............ plugin
TIFF support ........... plugin (qt)
JPEG support ........... plugin (qt)
PNG support ............ yes (qt)
MNG support ............ plugin (qt)
zlib support ........... yes
Session management ..... yes
OpenGL support ......... no
OpenVG support ......... no
NAS sound support ...... no
XShape support ......... yes
XVideo support ......... no
XSync support .......... yes
Xinerama support ....... no
Xcursor support ........ no
Xfixes support ......... no
Xrandr support ......... no
Xrender support ........ yes
Xi support ............. no
MIT-SHM support ........ yes
FontConfig support ..... no
XKB Support ............ yes
immodule support ....... yes
GTK theme support ...... no
MySQL support .......... qt
SQLite support ......... qt (qt)
OpenSSL support ........ no
Alsa support ........... no
ICD support ............ no
libICU support ......... no

So, I don't have FontConfig support, and I also don't have GTK theme support.
How can I get it work? Thanks

In addition, I specified "-debug-and-release", but why would configure just ignore the debug build?
Configure output this as the configuration:

Configuration .......... release shared dll largefile stl precompile_header mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 avx minimal-config small-config medium-config large-config full-config reduce_exports ipv6 clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify png freetype zlib nis iconv x11sm xshape xsync xrender mitshm xkb xmlpatterns multimedia audio-backend svg release

Debug .................. no

wysota
27th September 2011, 10:27
Start with: sudo apt-get install libfontconfig1-dev libglib2.0-dev libgtk-3-dev
Then rerun configure. It's likely you'll need to install more packages if you want additional features enabled (such as OpenGL, CUPS, OpenSSL, etc.).