PDA

View Full Version : QGraphicsView DragMode error



Radagast
5th November 2008, 11:26
Qt 4.4.1
quote from the Assistant:

dragMode : DragMode
This property holds the behavior for dragging the mouse over the scene while the left mouse button is pressed.
and here is my code

#include <QtGui>
#include "scenetest.h"

sceneTest::sceneTest(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
Scene = new QGraphicsScene(0,0,500,500,this);
ui.View->setScene(Scene);
Scene->addItem(new QGraphicsLineItem(200,200,300,300));
Scene->addItem(new QGraphicsLineItem(300,300,400,200));
foreach(QGraphicsItem* item,Scene->items())
item->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsIte m::ItemIsSelectable);
ui.View->setDragMode(QGraphicsView::RubberBandDrag);
}
So why do I get that RubberBand even if I drag the mouse with Mid or right button pressed?
btw with ScrollHandDrag mode I get the expected behavior - only with left button pressed the view scrolls.