Results 1 to 8 of 8

Thread: Porting Qt Application from Windows to Linux

  1. #1
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Porting Qt Application from Windows to Linux

    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.
    Thanks,
    Rajesh.S

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Porting Qt Application from Windows to Linux

    Quote Originally Posted by rajeshs View Post
    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?
    J-P Nurmi

  3. #3
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Porting Qt Application from Windows to Linux

    for splitters i am using

    splitter->setBackGroundRole(QPallete::WindowsText);

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

    Colors are not comming..
    Thanks,
    Rajesh.S

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Porting Qt Application from Windows to Linux

    What about
    Qt Code:
    1. splitter->setStyleSheet("background: red");
    To copy to clipboard, switch view to plain text mode 
    or
    Qt Code:
    1. QPalette p = splitter->palette();
    2. p.setColor(QPalette::Window, Qt::red);
    3. splitter->setPalette(p);
    4. splitter->setAutoFillBackground(true);
    To copy to clipboard, switch view to plain text mode 
    ?
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting Qt Application from Windows to Linux

    Quote Originally Posted by rajeshs View Post
    for splitters i am using

    splitter->setBackGroundRole(QPallete::WindowsText);

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

    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...
    Current Qt projects : QCodeEdit, RotiDeCode

  6. The following user says thank you to fullmetalcoder for this useful post:

    rajeshs (12th July 2007)

  7. #6
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting Qt Application from Windows to Linux

    Hello Sir,

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

  8. #7
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting Qt Application from Windows to Linux

    While Porting to Linux

    in Qsplitter in between some dots are coming


    How to solve this?
    Thanks,
    Rajesh.S

  9. #8
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Porting Qt Application from Windows to Linux

    Quote Originally Posted by rajeshs View Post
    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 )
    Current Qt projects : QCodeEdit, RotiDeCode

  10. The following user says thank you to fullmetalcoder for this useful post:

    rajeshs (13th July 2007)

Similar Threads

  1. Replies: 2
    Last Post: 9th June 2007, 19:19
  2. Porting my program to another windows machine !
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 14th March 2007, 06:46
  3. transporting qt application fron linux to windows
    By deekayt in forum Qt Programming
    Replies: 4
    Last Post: 20th October 2006, 22:56
  4. Porting Qt application on windows from linux
    By safknw in forum Qt Programming
    Replies: 13
    Last Post: 22nd May 2006, 13:11
  5. Application plugin on windows
    By Eyee in forum Qt Programming
    Replies: 2
    Last Post: 22nd March 2006, 17:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.