Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.2
-
None
Description
I embedded a QFrame into a QGraphicsScene. When I zoom in really close to the QFrame, the frame's background is drawn outside of the frame's drawn shape. The attached image shows the bottom of the frame and you can see the grey background outside the frame by a couple of pixels. I am actually using qt from the qt 4.7 branch.
#include <QApplication> #include <QFrame> #include <QLabel> #include <QVBoxLayout> #include <QGraphicsView> #include <QGraphicsScene> #include <QKeyEvent> class MyGraphicsView : public QGraphicsView { public: MyGraphicsView(QGraphicsScene *scene) : QGraphicsView(scene) { } protected: void keyReleaseEvent(QKeyEvent *event); }; void MyGraphicsView::keyReleaseEvent(QKeyEvent *event) { if(event->key() == Qt::Key_S) { scale(1.10,1.10); } else if(event->key() == Qt::Key_A) { scale(1/1.10,1/1.10); } } int main(int argc, char ** argv) { QApplication app(argc,argv); QFrame * mainWindow = new QFrame(); QGraphicsScene *scene = new QGraphicsScene(); MyGraphicsView *view = new MyGraphicsView(scene); QFrame *subWindow = new QFrame(); subWindow->setGeometry(0,0,256,64); subWindow->setFrameShape(QFrame::Box); QLabel *label1 = new QLabel("Label number 1"); QVBoxLayout *subWindowLayout = new QVBoxLayout(); subWindowLayout->addWidget(label1); subWindow->setLayout(subWindowLayout); scene->addWidget(subWindow); QVBoxLayout *layout = new QVBoxLayout(); layout->addWidget(view); mainWindow->setLayout(layout); mainWindow->setGeometry(50,50,512,256); mainWindow->show(); int returnValue = app.exec(); delete mainWindow; return returnValue; }