Results 1 to 2 of 2

Thread: QToolButton & setStyleSheet

  1. #1
    Join Date
    Aug 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Symbian S60

    Unhappy QToolButton & setStyleSheet

    HI,


    In My Application i need A QToolButton basically the edges of the QToolButton is Sharp.but i need Rounded Edge.For that i used following code
    Qt Code:
    1. class Dialog : public QDialog {
    2. public:
    3. Dialog() : QDialog(){
    4. tb=new QToolButton(this);
    5. tb->setGeometry(10,10,100,100);
    6. tb->setStyleSheet("border: 2px solid #8f8f91; border-radius: 20px");
    7. }
    8. };
    9. int main(int argc, char **argv){
    10. QApplication app(argc, argv);
    11. Dialog dlg;
    12. return dlg.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

    After this the edges of toolbutton gets changed to round edges but i can't able to click the toolbutton.The tool button looks like disabled state.But if i check like isEnabled() it returns true.Please Help me to achieve this one.

    Regards
    Kavin

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QToolButton & setStyleSheet

    Set more styles, one for enabled, one for disabled, one for ...

Similar Threads

  1. QTableWidget and setStyleSheet()
    By kazek3018 in forum Newbie
    Replies: 3
    Last Post: 30th December 2008, 09:52
  2. Problem to setstylesheet
    By phillip_Qt in forum Qt Programming
    Replies: 3
    Last Post: 14th April 2008, 07:57
  3. using setStyleSheet
    By Weilor in forum Qt Programming
    Replies: 11
    Last Post: 18th January 2008, 14:41
  4. QApplication::setStyleSheet()
    By Ryhel in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2007, 14:09
  5. QSpinBox and setStylesheet problem
    By Ace-X in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2007, 12:21

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.