PDA

View Full Version : Porting Qt Application from Windows to Linux



rajeshs
12th July 2007, 10:31
Hi Friends,

I have created One Application in windows using Qt 4.2 , It worked in windows using Mingw compiler, Now i want to use same code in Linux,

I compiled same code in linux ,

In that application i am using splitter for splitter i am setting backgroud role, and i am using colors for labels, These colors are not comming while running in linux.

Do i need to change any code ?

please help me.

jpn
12th July 2007, 10:36
In that application i am using splitter for splitter i am setting backgroud role, and i am using colors for labels, These colors are not comming while running in linux.
Exactly how are you setting these roles colors? Which styles are you using on Windows and Linux?

rajeshs
12th July 2007, 10:39
for splitters i am using

splitter->setBackGroundRole(QPallete::WindowsText);

I tried with some other options like QPallete::Shadow, QPallete::Dark ..

Colors are not comming..

jpn
12th July 2007, 11:13
What about


splitter->setStyleSheet("background: red");

or


QPalette p = splitter->palette();
p.setColor(QPalette::Window, Qt::red);
splitter->setPalette(p);
splitter->setAutoFillBackground(true);

?

fullmetalcoder
12th July 2007, 11:16
for splitters i am using

splitter->setBackGroundRole(QPallete::WindowsText);

I tried with some other options like QPallete::Shadow, QPallete::Dark ..

Colors are not comming..
What colors do you expect??? The default palette change from an OS to another (under linux it can be adjusted using the qtconfig utility) and also from a GUI style to another so it is quite unlikely that colors schemes you had under Win will come up under Linux UNLESS you change your settings OR your code (to use static schemes) OR both...

rajeshs
12th July 2007, 11:43
Hello Sir,

I am using listwidgets and Labels with in Splitter, I need one black line between these widgets within Splitter.

rajeshs
12th July 2007, 13:12
While Porting to Linux

in Qsplitter in between some dots are coming


How to solve this?

fullmetalcoder
12th July 2007, 13:30
in Qsplitter in between some dots are coming
This is the native look of QSplitter. Getting rid of this is not necessarily the best thing to do but if you absolutely can't afford them you got several options :

Style sheets (I don't know which attributes are relevant to achieve what you want but I'm willing to bet you can do it... :))
Forcing the use of another style (e.g. Windows) but that's bad practice IMHO
Reimplementing the drawing of your splitter... (quite tedious I suppose)
I need one black line between these widgets within Splitter.
If what you want is merely drawing a visula separator between two widgets you should consider QFrame which can be shaped as an horizontal or vertical line (that's actually how Qt Designer draw such lines ;) )