Results 1 to 5 of 5

Thread: QPushButton frame style

  1. #1
    Join Date
    Apr 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question QPushButton frame style

    Is it possible to make the frame of a push button "sunken" (inset in stylesheet)?
    I tried around with setting stylesheet but without any success.

    If there is no solution I have to take a lable which I event filter but I don't like this.

    Nippler

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPushButton frame style

    Yes thers a way,,,,
    QPushButton
    {
    border-style: inset;
    }


    but for this to work, u need to set the following code -
    myButton->setFrameStyle(Qt::StyledPanel);

    hope this helps

  3. #3
    Join Date
    Apr 2008
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QPushButton frame style

    Thanks for the answer but I can't find a methode "setFrameStyle" from QPushButton?!

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPushButton frame style

    sorry, framestyle is used with QLabel

    just try using border-style: inset;
    in the stylesheet

  5. #5
    Join Date
    Oct 2010
    Posts
    5
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QPushButton frame style

    ui->male_button->setFlat(TRUE);

    ui->male_button->setStyleSheet("* { background-color: rgba(0,125,0,0) }");

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 12:35
  2. BG image on QPushButton using style sheets??
    By JimDaniel in forum Newbie
    Replies: 2
    Last Post: 13th September 2007, 03:31
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. Multi frame management ... is it possible ?
    By yellowmat in forum Newbie
    Replies: 8
    Last Post: 25th January 2006, 10:41

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.