[SOLVED]Scroll issue in Qlistview
-
wrote on 27 May 2013, 10:29 last edited by
Hi All,
I am the beginner of Qt and this site also.Now my question is how to redirect event from one control to another.
For ex. when ever i scrolling mouse in Qlabel want to scroll in QTextEdit control.Kindly help me.
-
Hi and welcome to devnet,
You have to explain a little bit more of your problem. You are not stating clearly what you want to achieve (for example your title mentions QListView and your text only talks about QLabel and QTextEdit)
Also this the wrong subforum. You seem to have a widget problem not a Qt Quick problem
-
Then what do you mean by scroll on the QLabel ? Moving the mouse ? Moving the wheel ?
-
wrote on 27 May 2013, 11:37 last edited by
Moving the wheel
-
Then you'll have to:
- subclass QLabel
- add a signal to "propagate" the scrolling value
- reimplement wheelEvent and emit the signal from there
Then it's either:
1.- subclass QTextEdit
- add a slot to receive the scrolling value and update
- have a slot in the "main" widget containing your QLabel and QTextEdit and update the QTextEdit scroll bar from there.
May I know why you want to do it that way ? QTextEdit should already support wheel events
-
wrote on 27 May 2013, 11:54 last edited by
Thanks for your information...
Actually i had an transparent image under that i had text browser .i made all the alignments such that it fits on the transparent area.the text is long than the transparent area ,it is not scrolling to see the rest of the textbrowser,.This is what actual problem
-
In that case, have a look at the doc for Qt::WA_TransparentForMouseEvents
-
wrote on 27 May 2013, 12:13 last edited by
Thanks,
I already tried this kind of solution but the textbrowser shape is like as rectangle but the image transparent area is like as curve. -
Then make the QTextEdit a "filter":http://qt-project.org/doc/qt-4.8/qobject.html#installEventFilter for the QLabel event
-
wrote on 27 May 2013, 13:25 last edited by
Thanks for your information.
I fixed the issue!!!!!!!!!!! .
-
You're welcome,
Don't forget to update the thread's title to solved (also change the subject since it has nothing to do with QListView) so other forum user may know a solution has been found.
-
wrote on 27 May 2013, 14:04 last edited by
Yes..Sure.Thanks a lot
1/13