PDA

View Full Version : QGraphicsView, unmanaged artifact with scrollbars



philw
26th December 2008, 01:15
Creating a minimal QGraphicsScene and QGraphicsView results in a tiny artifact widget obscuring the TOP-LEFT AREA of a QMainWindow (covering part of the menubar). See:

http://www.thirdtablet.com/cadswes/2008/QGraphicsViewArtifact.png

This is with Qt 4.3.3. I've tried all sorts of ways of rearranging the creation of the QGraphicsScene and QGraphicsView to get rid of this thing. No luck. ANY IDEAS?

Some relevant code excerpts:



_workspaceStack = new QStackedWidget;
setCentralWidget (_workspaceStack);
... ... ...

_simGraphicsScene = new SimWsGraphicsScene (this);
_simGraphicsView = new SimWsGraphicsView (_simGraphicsScene, this);
_workspaceStack->addWidget (_simGraphicsView);
... ... ...

SimWsGraphicsScene::SimWsGraphicsScene (QObject* parent)
: QGraphicsScene (parent)
{
setSceneRect (-40, -40, 1200, 1200);
QGraphicsTextItem* testItem = addText ("SimWsGraphicsScene Test");
}

SimWsGraphicsView::SimWsGraphicsView (SimWsGraphicsScene* scene,
QWidget* parent)
: QGraphicsView (scene, parent)
{
}

Thanks in advance,
Phil Weinstein
CADSWES, U of Colorado at Boulder, USA
http://cadswes.colorado.edu/

philw
26th December 2008, 02:58
Solved. Sorry about this. The artifact was a Q3CanvasView which was tentatively replaced by the new QGraphicsView. Hiding that unmanaged Q3CanvasView did the trick.