Results 1 to 3 of 3

Thread: how to apply stylesheet to qtopia application using qss file

  1. #1
    Join Date
    Mar 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to apply stylesheet to qtopia application using qss file

    Hi,

    I want to know how can I apply stylesheet to atopia application using qss file.
    I want to run this application on green phone emulator. Where should I save .qss file?
    I tried to run one of my developed qt stylesheet application on emulator, but the images are missing.

    Pls help me.

    Thanks in advance,
    Namita

  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: how to apply stylesheet to atopia application using qss file

    Please, do not double post. Do not post the same question again and again but ask for help in the thread where you did not get a solution in the first place.

    You might want to embed the stylesheet and images as resources. Read: The Qt Resource System
    J-P Nurmi

  3. #3
    Join Date
    Mar 2008
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to apply stylesheet to atopia application using qss file

    Hi,

    Sorry for posting same question again. Actually I did it because there was a spelling mistake in the subject line of earlier post.

    I want to apply external stylesheet to qtopia application using .qss file. I tried doing it using setStyleSheet function. Following is my code. If I use Qapplication instead of QtopiaApplication, it works. It seems external style sheet can't be set to qtopia application using setStyleSheet function. Is it true?



    Qt Code:
    1. #include <QFile>
    2. #include <QtopiaApplication>
    3. #include "dialogimpl.h"
    4. //
    5. QSXE_APP_KEY
    6. int main(int argc, char ** argv)
    7. {
    8. QSXE_SET_APP_KEY(argv[0]);
    9. QtopiaApplication app( argc, argv );
    10.  
    11. QFile qss("/home/stylesheet.qss");
    12. qss.open(QFile::ReadOnly);
    13. app.setStyleSheet(qss.readAll());
    14. qss.close();
    15.  
    16. DialogImpl win;
    17. win.show();
    18. app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 31st March 2008 at 07:46. Reason: missing [code] tags

Similar Threads

  1. Replies: 4
    Last Post: 28th March 2008, 04:55
  2. Replies: 8
    Last Post: 17th March 2008, 14:04
  3. how to apply qt css to qtopia application
    By namita in forum Qt Programming
    Replies: 1
    Last Post: 3rd March 2008, 12:19
  4. Replies: 3
    Last Post: 6th March 2007, 18:24

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.