7 #include <QApplication>
66 :
QWidget(parent), mImage(
QImage(
":/icons/hal9000",
"PNG")), mAngle(0)
73 qApp->processEvents();
82 int rw =
rect().width();
83 int rh =
rect().height();
85 int w = rw > rh ? rh : rw;
88 QRect rimg((rw-w)/2,(rh-h)/2,w,h);
95 for (
int y = 0;
y<h;
y++)
96 for (
int x=0;
x<w;
x++)
101 double angle = atan2(
y-yc,
x-xc) / M_PI * 180.;
102 double da = angle >= mAngle ? angle - mAngle : angle + 360. - mAngle;
103 int opaque = floor(da / 360.*256);
105 col = (col & 0xFFFFFF) | opaque;
117 qApp->processEvents();
122 if (mLabel->
text() == txt)
return;
124 qApp->processEvents();
BusyAnimation(QWidget *parent=nullptr)
void paintEvent(QPaintEvent *event) override
BusyIndicator(QWidget *parent=nullptr)
void setText(const QString &txt) override
void setValue(int percent) override
Logical container for modules, gates, and nets.
ProgressBar(GraphContext *context, QWidget *parent=nullptr)
void setText(const QString &txt) override
void setValue(int percent) override
void setFrameStyle(int style)
QRgb pixel(int x, int y) const const
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const const
void setPixel(int x, int y, uint index_or_rgb)
void setText(const QString &)
virtual void addItem(QLayoutItem *item)=0
bool setAlignment(QWidget *w, Qt::Alignment alignment)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, Qt::ImageConversionFlags flags)
void setRenderHint(QPainter::RenderHint hint, bool on)