MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / fillRect

Method fillRect

src/Gui/BitmapFactory.cpp:442–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442QPixmap BitmapFactoryInst::fillRect(int x, int y, int w, int h, const QPixmap& p, Qt::BGMode bgmode) const
443{
444 QBitmap b = p.mask();
445 if (b.isNull()) {
446 return p; // sorry, but cannot do anything
447 }
448
449 QPixmap pix = p;
450
451 // modify the mask
452 QPainter pt;
453 pt.begin(&b);
454 if (bgmode == Qt::OpaqueMode) {
455 pt.fillRect(x, y, w, h, Qt::color1); // make opaque
456 }
457 else { // Qt::TransparentMode
458 pt.fillRect(x, y, w, h, Qt::color0); // make transparent
459 }
460 pt.end();
461
462 pix.setMask(b);
463
464 return pix;
465}
466
467QPixmap BitmapFactoryInst::merge(const QPixmap& p1, const QPixmap& p2, bool vertical) const
468{

Callers 15

paintEventMethod · 0.80
drawMethod · 0.80
paintMethod · 0.80
savePictureMethod · 0.80
grabFramebufferMethod · 0.80
imageFromFramebufferMethod · 0.80
paintEventMethod · 0.80
paintEventMethod · 0.80
paintMethod · 0.80
paintMethod · 0.80
drawBranchesMethod · 0.80

Calls 3

isNullMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

paintEventMethod · 0.64