I've been trying for some time now to squash a bug that I can't seem to figure out. I'm using a QGraphicsView as a parent window for my child dialogs. This way I can have a animated background behind my half transparent dialogs.
The issue is that these dialogs keep appearing in random locations in the QGraphicsView. They start more or less in the center of the view, but as I create and destroy them, they seem to be created in random locations in the view. Here's the code I use to create the dialogs, this is in my subclassed QGraphicsScene:
ab = getCurrentPanel(poffset); // Get the next dialog QWidget based on the current id
ab->load(); // perform some initial data population
cproxy = addWidget(ab, Qt::Widget );
QTransform transform;
transform.translate(0, 0);
cproxy->setTransform(transform);
parentView->centerOn(cproxy);
ab = getCurrentPanel(poffset); // Get the next dialog QWidget based on the current id
ab->load(); // perform some initial data population
cproxy = addWidget(ab, Qt::Widget );
QTransform transform;
transform.translate(0, 0);
cproxy->setTransform(transform);
parentView->centerOn(cproxy);
To copy to clipboard, switch view to plain text mode
All the getCurrentPanel() does is return a QWidget pointer to my dialog based on the dialog Id being sent. The constructor for this dialog just passes NULL to the QWidget constructor, so that's not the issue.
Any ideas?
Thanks
Bookmarks