Results 1 to 11 of 11

Thread: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

  1. #1
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    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!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    Just a thought: I would investigate if QDataWidgetMapper could be used for your need.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    I would probably just connect a bunch of signals betweeen the two widgets.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    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.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    What do you need the other table view for?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    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...

    ban7_exemple.jpg

    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.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    Ok, maybe I misunderstand --- what is "topLineEdit"?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    Sorry... I used names I use internally :-P
    In the image you can see what I mean!

    ban7_exemple2.jpg

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    So what do you need a second table view for?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Jun 2009
    Posts
    37
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    I'm just wondering if it's possible to avoid coding dozens of signals to achieve that objective...

    edit on table
    table-click.jpg

    edit on qLineEdit on top
    top_click.jpg

    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.

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTableView and QLineEdit OUTSIDE of QTableView, like Excel

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 16
    Last Post: 28th April 2020, 15:40
  2. Replies: 2
    Last Post: 6th September 2011, 12:27
  3. Replies: 3
    Last Post: 1st February 2011, 12:57
  4. Replies: 2
    Last Post: 26th November 2009, 05:45
  5. How to copy from Excel and paste to QTableView
    By sms in forum Qt Programming
    Replies: 5
    Last Post: 7th February 2009, 04:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.