Gui: Add BitmapFactory::empty method
This adds empty(QSize) method to bitmap factory that creates empty pixmap. This may seem useless, but after creating bitmap one needs to remember to clear it and to properly set DPR - BitmapFactory will take care of it.
This commit is contained in:
committed by
Chris Hennes
parent
2a7498c930
commit
83b2027395
@@ -521,6 +521,17 @@ QPixmap BitmapFactoryInst::disabled(const QPixmap& p) const
|
||||
return QApplication::style()->generatedIconPixmap(QIcon::Disabled, p, &opt);
|
||||
}
|
||||
|
||||
QPixmap BitmapFactoryInst::empty(QSize size) const
|
||||
{
|
||||
qreal dpr = getMaximumDPR();
|
||||
|
||||
QPixmap res(size * dpr);
|
||||
res.fill(Qt::transparent);
|
||||
res.setDevicePixelRatio(dpr);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void BitmapFactoryInst::convert(const QImage& p, SoSFImage& img) const
|
||||
{
|
||||
SbVec2s size;
|
||||
|
||||
Reference in New Issue
Block a user