[Qt-interest] How to set 24 bit colors for Qt 4.5.1 in Sun Sparc Solaris 10

Trond Kjernaasen trond at trolltech.com
Tue Aug 4 12:29:48 CEST 2009


Steven Chang wrote:
> Dear all,
> 
>  
> 
> After I ran Qt examples in Sun Sparc Solaris 10, I found all examples 
> were running in 256 colors, so Qt used halftone to simulate true color. 
> Is it the configure problem when I built the Qt 4.5.1 in SPARC Solaris 
> 10, so it’s the setting problem of Qt or X server? I checked my display 
> card with command “fbconfig –dev pfb0 –prconf”, and I could see the 
> depth is 24. Has anyone know how to running Qt application with true 
> color UI?
> 
> Thanks a lot!

Qt will, by default, use the default visual for the display you are 
running the application (see xdpyinfo). If you can't/don't want to 
change the display's default visual, you can use the '-visual' 
commandline parameter. E.g. '-visual truecolor' will start your 
application with a TrueColor visual if one is available. You can also 
pass in visual ids directly, e.g. '-visual 0x22'. Have a look at the 
static QApplication::setColorSpec() function if you want to do this from 
within your application.

Regards,
--
Trond K.



More information about the Qt-interest-old mailing list