
Originally Posted by
Lykurg
Alter your LED class that is paints the "image" centered.
It's not an image, it's a QPushButton. I'm not getting anything that gives me options to align/space/set margin.
Is there any widget or something (which is not an image) which I can use as an LED indicator inside a QTableWidget cell?
#ifndef DEVICESTATE_INDICATOR_H
#define DEVICESTATE_INDICATOR_H
#include <QPushButton>
#include <QString>
#define INDICATOR_GREEN "background-color: green; border-radius: 7px; "
#define INDICATOR_RED "background-color: red; border-radius: 7px; "
#define INDICATOR_YELLOW "background-color: yellow; border-radius: 7px; "
#define INDICATOR_GRAY "background-color: lightGray; border-radius: 7px; "
{
Q_OBJECT
public:
explicit DeviceState_Indicator
(QWidget *parent,
QString Indicator_Color
);
signals:
public slots:
};
#endif // DEVICESTATE_INDICATOR_H
#ifndef DEVICESTATE_INDICATOR_H
#define DEVICESTATE_INDICATOR_H
#include <QPushButton>
#include <QString>
#define INDICATOR_GREEN "background-color: green; border-radius: 7px; "
#define INDICATOR_RED "background-color: red; border-radius: 7px; "
#define INDICATOR_YELLOW "background-color: yellow; border-radius: 7px; "
#define INDICATOR_GRAY "background-color: lightGray; border-radius: 7px; "
class DeviceState_Indicator : public QPushButton
{
Q_OBJECT
public:
explicit DeviceState_Indicator(QWidget *parent, QString Indicator_Color);
signals:
public slots:
};
#endif // DEVICESTATE_INDICATOR_H
To copy to clipboard, switch view to plain text mode
Thank you.
Bookmarks