Ok
Light_frame
::Light_frame(QWidget *parent
) : {
this->setStyleSheet("background-color:rgb(245, 245, 245)");
button_on->setText("ON");
button_on->setGeometry(screenWidth/12 - screenWidth/20, screenHeight/4 + (screenHeight/2), screenWidth/11 ,screenHeight/11);
button_on->setStyleSheet("QPushButton { color: rgb(131, 64, 0, 255); font-family: verdana, ms sans serif;font-size: 14pt; background-color: rgb(224, 224, 224,255); border-style: outset; border-width: 2px;border-radius: 10px; border-color: gray; } QPushButton:pressed { color:rgb(58, 129, 25); } ");
]
Light_frame::Light_frame(QWidget *parent) :
QFrame(parent)
{
this->setStyleSheet("background-color:rgb(245, 245, 245)");
button_on = new QPushButton(this);
button_on->setText("ON");
button_on->setGeometry(screenWidth/12 - screenWidth/20, screenHeight/4 + (screenHeight/2), screenWidth/11 ,screenHeight/11);
button_on->setStyleSheet("QPushButton { color: rgb(131, 64, 0, 255); font-family: verdana, ms sans serif;font-size: 14pt; background-color: rgb(224, 224, 224,255); border-style: outset; border-width: 2px;border-radius: 10px; border-color: gray; } QPushButton:pressed { color:rgb(58, 129, 25); } ");
]
To copy to clipboard, switch view to plain text mode
On this button's middle i am trying to do arrow as
painter_arrow.setPen(Qt::black);
painter_arrow.
setBrush(QColor(119,
65,
1));
QPointF(screenWidth
/3 + screenWidth
/8, screenHeight
/3 + screenHeight
/15),
QPointF(screenWidth
/3 + screenWidth
/8 + 15, screenHeight
/3 + screenHeight
/15 + 25),
QPointF(screenWidth
/3 + screenWidth
/8 + 30, screenHeight
/3 + screenHeight
/15),
QPointF(screenWidth
/3 + screenWidth
/8 + 15, screenHeight
/3 + screenHeight
/15 + 5) };
painter_arrow.drawPolygon(point, 4);
}
void Light_frame::paintEvent(QPaintEvent *event ){
QPainter painter_arrow(this);
painter_arrow.setPen(Qt::black);
painter_arrow.setBrush(QColor(119, 65, 1));
QPointF point[4] = {
QPointF(screenWidth/3 + screenWidth/8, screenHeight/3 + screenHeight/15),
QPointF(screenWidth/3 + screenWidth/8 + 15, screenHeight/3 + screenHeight/15 + 25),
QPointF(screenWidth/3 + screenWidth/8 + 30, screenHeight/3 + screenHeight/15),
QPointF(screenWidth/3 + screenWidth/8 + 15, screenHeight/3 + screenHeight/15 + 5)
};
painter_arrow.drawPolygon(point, 4);
}
To copy to clipboard, switch view to plain text mode
but the drawn arrow overlapped by button.
Bookmarks