Skip to content
QtWS25 Last Chance
  • QGraphicsDropShadowEffect bug

    Moved Solved Qt for Python qgraphicsdropsh bug pyside6 shadow
    3
    0 Votes
    3 Posts
    569 Views
    EmrecpE
    @SGaist Thanks problem solved! (PySide6 updated to 6.3.1)
  • 0 Votes
    6 Posts
    893 Views
    H
    Fixed. Use QQuickView instead of QQuickWidget
  • 0 Votes
    3 Posts
    2k Views
    J.HilkJ
    Ok, I'll mark this as solved. I wasn't able to do it with QGraphicsDropShadowEffect, and creating all images twice and including them in the rcs-file is simply a no go. Therefore I create a function, that draws a shadow - all 4 sides - around the the QImages, either at startup or during runtime. Here it is, in case anyone else needs something like it. QImage drawShadow(QImage img) { //Condition img allready has a transparent border 4 Pixel in this case //Create new Img with same Size QImage imgBGround(img.size(), img.format()); //Fill it with transparency QPainter p(&imgBGround); QPen pen; pen.setStyle(Qt::NoPen); p.setPen(pen); p.setRenderHint(QPainter::Antialiasing); p.fillRect(QRect(0,0,img.width(), img.height()), QColor(255,255,255,0)); //Draw Rounded Rectangle as Shadow QPainterPath path; path.addRoundedRect(QRect(0,0,img.width(), img.height()),15,15); p.fillPath(path,QColor(110,152,226)); p.drawPath(path); //Draw Original Img over background p.drawImage(0,0,img); return imgBGround; }