Hi,
im playing alot with GraphicsView these days and I came accross a 
following problem. I have a reimplemented QGraphicsView class where i 
interecept the keyboardkeys:

        protected  void keyPressEvent(QKeyEvent event){
            event.accept();
            if(event.key()==Qt.Key.Key_Control.value())
                this.setDragMode(DragMode.ScrollHandDrag);
           
            super.keyPressEvent(event);
        }
       
        protected void keyReleaseEvent(QKeyEvent event){
            event.accept();
            if(event.key()==Qt.Key.Key_Control.value())
                this.setDragMode(DragMode.NoDrag);
           
            super.keyReleaseEvent(event);
        }

I do this to achieve the following behaviour. When i press the ctrl key 
i want the DragMode to change to ScrollHandDrag. Then, when I press the 
left mouse key i can drag the viewport(scroll), when I'm done scrolling 
i release the left mouse button afterwhich i release the ctrl key. All 
works ok. But if I hit the following sequence of keys, the behavior will 
break. I press the ctrl key and then press the left mouse key, drag the 
view port and when I'm done I first release the ctrl key and then 
release the left mouse key. When I then want to repeat such scroll 
action the view port is drag as soon as I hit ctrl key, and not even 
tougch the mouse keys... What is wrong? Some ideas?

Dawid
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to