Mouse event over text box
-
Hi
I am working on a opengl based model viewer and I want to have the transform properties of the model controlled from the UI using textboxes which I can have type and mouse events similar to what is shown in the picture.
How do I achieve it? Right now I have a text edit where I manually enter the values for transforms but I want to control it with the mouse. So I can decrease and increase the values of the transform as I drag and move the mouse left and right. Please point me in the right direction. Also any tutorial links would be greatly appreciated which does what I want.
Thanks in advance!
-
Hi
Sort of like a
http://doc.qt.io/qt-5/qspinbox.html#details ?
But without the buttons and you click in value area and drag to increase/decrease the value ? -
Hi
If you still want to be able to input , you can subclass lineEdit and override mousePress and mRelease to implement the logic.
You could maybe do it via event filter on a std edit/spinbox but
http://doc.qt.io/qt-5/qobject.html#eventFilter
its nothing i have tried.You could also subclass SpinBox to get most features of it (increase value etc) and maybe get the most complete solution. But might be a bit overkill ?