PDA

View Full Version : QTableView and QLineEdit OUTSIDE of QTableView, like Excel



JoZCaVaLLo
13th May 2011, 09:11
Hi... For my application a QLineEdit above my QTableView would be very confortable, especially for long texts and also because people got used with Excel...

My question is: do you know about any thread about this argument? Googled around for a while but no real solution found...

Or better: do you know if it's possible to mirror the QLineEdit created by the delegate with the one on the top? The main difficulty is that if I start editing the topLineEdit, then I wish I could connect to it the QCompleter that is currently created by the delegate and showed in the table.

Thank you for your hints!!!

Lykurg
13th May 2011, 09:17
Just a thought: I would investigate if QDataWidgetMapper could be used for your need.

wysota
13th May 2011, 09:25
I would probably just connect a bunch of signals betweeen the two widgets.

JoZCaVaLLo
13th May 2011, 09:37
Do you think could be possible?

Using another QTableView of 1 col and 1 row, instead of a QLineEdit... and connecting to it the delegate and model of the main table.

wysota
13th May 2011, 09:51
What do you need the other table view for?

JoZCaVaLLo
13th May 2011, 10:01
The app should behave almost like excel... the difficulty is that instead of have simple lineEdit when modifying values in the table I have to display a QCompleter...

6412

If I start editing in the topLineEdit instead of in the table... i whish that this QCompleter is shown right under the topLineEdit depending on what is selected in the table.

wysota
13th May 2011, 11:09
Ok, maybe I misunderstand --- what is "topLineEdit"?

JoZCaVaLLo
13th May 2011, 11:17
Sorry... I used names I use internally :-P
In the image you can see what I mean!

6413

wysota
13th May 2011, 11:37
So what do you need a second table view for?

JoZCaVaLLo
13th May 2011, 13:16
I'm just wondering if it's possible to avoid coding dozens of signals to achieve that objective...

edit on table
6414

edit on qLineEdit on top
6415

The ideal solution would be use the same QLineEdit created by the delegate of the main table. That's why I was thinking about using a table instead of a QLineEdit.

wysota
13th May 2011, 13:20
The same widget cannot be in two places at the same time. I honestly don't see your problem. If you want a complete on both line edits, then set it on both line edits.