Problems on Mousemove event on Graphicsview and QTabWidget

  • Hi,

    I trying to make a CAD program on QT 4.8 (linux version) and i got few bugs.

    First problem:

    On forms i add an graphicsview and two LCDNUmbers, the program should got mouse position and display it on both LCDNUmbers.

    So i reimplement my void mouseMoveEvent(QMouseEvent *event) on my Widget and use LCD fuction Display to change Lcdnumber value. I also have to setmousetracking(true) to my widget and my Graphicsview. But if i do this the mousemove dont work, idk why.

    If i reimplement Graphicsview, making void mouseMoveEvent(QMouseEvent *event) for him and set event->ignore(); the program work! but i know it should ignore() if i dont reimplemente the function for graphicsview!

    Another strange thing, if i reimplemente void mouseMoveEvent(QMouseEvent *event) for graphicsview and put QWidget::mouseMoveEvent(event) instend event->ignore(), the program work! ( its normal because by default QWidget::mouseMoveEvent(event) ignore() mouse events). But if i put QGraphicsview::mouseMoveEvent(event) the problem persist!

    QGraphicsview::mouseMoveEvent(event) should be = QWidget::mouseMoveEvent(event) ????

    Second problem:

    Ok the first problem can be solved if i reinplement void mouseMoveEvent(QMouseEvent *event) and set event->ignore().

    On form i make a Qtabwidget and put my Graphicsview inside of QTabWidget. The moveevent Stop working again!, but this time if i press mouse buton it work, so i think its an mousetracking(true) problem. I set mousetracking(true) for tabWidget, tab, tabwidget->widget(0)->setmousetracking(true) and nothing happen! idk why mousetracking(true) dont working!

    Sry for my bad english, i hope you guys undestand my both problem

  • I solved my problem by making an signal on graphicsview, so i can emit signal on mousemove() of graphicview and update display on Lcdnumber

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.