×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    May 2009
    Posts
    146

    Problem with background in stylesheet

    In my project I have a frame called frameTest that I need to set some stylesheets to. I try setting all my styling in the centralWidget's stylesheet properties. The border setup fine for the frameTest. However the background property doesn't seem to work, as it doesn't set the background to white. The only way I can get the white background is if I in frameTest's stylesheet properties sets the background directly with only "background: #ffffff;". But then this white background will be set to all children of frameTest also and that isn't something I want. Am I doing something wrong here?

    In centralWidget stylesheet property:
    Code:
    #frameTest {
    border: 1px;
    border-right: 1px solid #A7A6A6;
    border-left: 1px solid #A7A6A6;
    border-top: 1px solid #A7A6A6;
    border-top-right-radius: 10px;
    border-top-left-radius: 10px;
    background: #ffffff;
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Problem with background in stylesheet

    Code:
    #include <QApplication>
    #include <QMainWindow>
    #include <QWidget>
    
    int
    main (int argc,
          char **argv)
    {
        QApplication app(argc, argv);
        app.setStyleSheet("#centralWidget {border: 1px; border-right: 1px solid #A7A6A6;" \
                          "border-left: 1px solid #A7A6A6; border-top: 1px solid #A7A6A6;" \
                          "border-top-right-radius: 10px; border-top-left-radius: 10px;" \
                          "background: #ffffff;}");
    
        QMainWindow win;
        QWidget widget;
        widget.setObjectName("centralWidget");
    
        win.setCentralWidget(&widget);
        win.show();
    
        return app.exec();
    }

Similar Threads

  1. XML onLoad with background http server problem
    By simonjuric in forum [Archived] Flash Lite on Nokia Devices
    Replies: 5
    Last Post: 2009-06-08, 16:47
  2. Replies: 5
    Last Post: 2008-10-14, 07:45
  3. Problem with background while switching view.
    By Dattanand in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-04-13, 15:55
  4. S40 background problem
    By poom2522 in forum Themes/Carbide.ui
    Replies: 2
    Last Post: 2006-12-05, 10:54
  5. Problem with background for CAknSingleGraphicStyleListBox
    By hforsstr in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-06-17, 13:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •