if(!cl->isDown())
clstate = 1;
else
clstate = 2;
else
clstate = 0;
QPushButton *cl = findChild<QPushButton *>(QString("cl"));
if(QRegion(cl->geometry()).contains(mapFromGlobal(QCursor::pos())))
if(!cl->isDown())
clstate = 1;
else
clstate = 2;
else
clstate = 0;
To copy to clipboard, switch view to plain text mode
if (!widget)
else if(widget->objectName() == "cl")
{
p.
setRenderHint(QPainter::Antialiasing);
switch(clstate)
{
case 0:
p.
drawPixmap(widget
->geometry
(),
QPixmap(":/images/cl.png").
copy(0,
0,
128,
128));
break;
case 1:
p.
drawPixmap(widget
->geometry
(),
QPixmap(":/images/cl.png").
copy(0,
128,
128,
128));
break;
case 2:
p.
drawPixmap(widget
->geometry
(),
QPixmap(":/images/cl.png").
copy(0,
256,
128,
128));
break;
default:
p.
drawPixmap(widget
->geometry
(),
QPixmap(":/images/cl.png").
copy(0,
0,
128,
128));
break;
}
p.end();
}
else
widget
->render
(&widgetMask, widget
->geometry
().
topLeft(), r,
QWidget::DrawWindowBackground |
QWidget::DrawChildren |
QWidget::IgnoreMask);
if (!widget)
return QPixmap();
else if(widget->objectName() == "cl")
{
QPainter p(&widgetMask);
p.setRenderHint(QPainter::Antialiasing);
switch(clstate)
{
case 0:
p.drawPixmap(widget->geometry(), QPixmap(":/images/cl.png").copy(0,0,128,128));
break;
case 1:
p.drawPixmap(widget->geometry(), QPixmap(":/images/cl.png").copy(0,128,128,128));
break;
case 2:
p.drawPixmap(widget->geometry(), QPixmap(":/images/cl.png").copy(0,256,128,128));
break;
default:
p.drawPixmap(widget->geometry(), QPixmap(":/images/cl.png").copy(0,0,128,128));
break;
}
p.end();
}
else
widget->render(&widgetMask, widget->geometry().topLeft(), r, QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask);
To copy to clipboard, switch view to plain text mode
Bookmarks