PDA

View Full Version : Copy value to QLineEdit after clicking on QListView's line



ro12man3
22nd March 2016, 20:43
Hello!

I have QListView where are many data. I want to make double click on some line(with value) and this value must to be inserted in QLineEdit.
Can you help me?

anda_skoa
22nd March 2016, 22:06
Connect a slot to the QListView::doubleClicked() signal, get the value from the model index and set it on the line edit.

Cheers,
_

ro12man3
23rd March 2016, 18:24
I don't know how to do that. Can you help me? please

anda_skoa
23rd March 2016, 19:04
What have you got so far?

Cheers,
_

ro12man3
23rd March 2016, 19:31
Well, I am novice in QT, so I have no idea how to do that, so I didn't make nothing in my code for solving that problem

anda_skoa
23rd March 2016, 22:22
Well, your question is quite specific, you must have an application already that contains a listview and a line edit and some way of providing data to the list view.

So the next step would be to read up on Qt's signal/slot mechanism and then trying to create a slot that you connect to the mentioned listview signal.
This will then either work or you will have code of the slot and connect to show.

Cheers,
_