Results 1 to 2 of 2

Thread: QLedIndicator - not changing state

  1. #1
    Join Date
    Apr 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QLedIndicator - not changing state

    I got the plug-in installed into Designer, and added several LED widgets to my UI. I have followed all the steps shown in the mini demo app that came with the download. At form load time, I set the colors like this:
    ui.led1->setOnColor1(QColor(0,250,0,255));
    ui.led1->setOnColor2(QColor(0,200,0,255));
    ui.led1->setOffColor1(QColor(0,25,0,255));
    ui.led1->setOffColor2(QColor(0,100,0,255));

    Then when I want to turn on the LED I have tried these (together and separately)
    ui.led1->setChecked(true);
    ui.led1->toggle();

    However the led on the GUI never changes color from the default given to it in the designer. The widget is definitely enabled. I don't know why I can't get it to change states.

    Any help is greatly appreciated,
    Doyal

  2. #2
    Join Date
    Apr 2013
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QLedIndicator - not changing state

    Solved - base class QAbstractButton has the isCheckable property false by default. Either set isCheckable to true in Qt Designer, or do it programmatically at form load time.

Similar Threads

  1. State Machine returning to previous state
    By akiross in forum Qt Programming
    Replies: 2
    Last Post: 10th May 2011, 00:39
  2. changing state of previously selected list item
    By tyrnikeisari in forum Qt Quick
    Replies: 2
    Last Post: 26th March 2011, 06:47
  3. Replies: 0
    Last Post: 19th December 2010, 16:03
  4. QGraphicsPathItem changing state when hovered
    By Vit Stepanek in forum Qt Programming
    Replies: 4
    Last Post: 8th December 2010, 16:44
  5. QLedIndicator
    By Lycus HackerEmo in forum Qt Tools
    Replies: 10
    Last Post: 25th February 2010, 22:23

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.