Results 1 to 9 of 9

Thread: Qpushbutton not clickable but not greyed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Posts
    51
    Qt products
    Qt4
    Thanks
    2

    Default Re: Qpushbutton not clickable but not greyed

    Yes you are right !! But this button will work like a led GREEN/RED. And the only widget to make a like led is a QPushButton...!!!
    A QLineEdit is flat so i think a QPUSHButton is the best solution...

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 106 Times in 103 Posts

    Default Re: Qpushbutton not clickable but not greyed

    I still think you need to re-think your design.
    You need a button which is not a button, but looks like a button but it fact is a label...

    Read what you're saying - the idea of a button is that it can be interacted with. You're looking for something that will not be interacted with.

    What about QLabel? That's exacly what it is for.

    You can style the label as you want, even to look like a PushButton (I still fail to see a reason for that).

    Qt Code:
    1. QLabel* l = new QLabel("Test", this);
    2. l->setAlignment( Qt::AlignCenter );
    3. l->setStyleSheet(
    4. "QLabel {"
    5. "margin: 1px;"
    6. "border-color: #0c457e;"
    7. "border-style: outset;"
    8. "border-radius: 3px;"
    9. "border-width: 1px;"
    10. "color: black;"
    11. "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #EBEBEB, stop: 1 #CCCCCC );"
    12. "}"
    13. );
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Problem with styled QPushButton clickable area
    By koan in forum Qt Programming
    Replies: 4
    Last Post: 19th July 2011, 22:48
  2. QLabel clickable
    By bnilsson in forum Newbie
    Replies: 3
    Last Post: 29th July 2009, 08:50
  3. Clickable Regions
    By bbdaffy in forum Qt Programming
    Replies: 6
    Last Post: 22nd July 2009, 11:26
  4. Clickable weblink
    By bnilsson in forum Qt Programming
    Replies: 6
    Last Post: 23rd June 2009, 17:13
  5. Clickable text?
    By hkvm in forum Qt Programming
    Replies: 2
    Last Post: 27th September 2008, 21:49

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.