Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get input from tableview inside the itemDelegate file?

How to get input from tableview inside the itemDelegate file?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 548 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lcg2025882
    wrote on last edited by
    #1

    Hello, I am working on a QT project. I faced up with an problem recently.

    What I am going to do is to implement a table view (historysheet.cpp). In order to change some table cell into combobox, I used  item delegate (comboboxitemdelegate.cpp). This works perfectly. Then what I am going to do is to add a fucntion that when the user presses TAB it copies the content of the previous row same column into current row same column. When I add eventFilter(QObject *object, QEvent *event) into comboboxitemdelegate.cpp, it can not get the input from table view (historysheep.cpp) and current index of row and column.
    However if I add a function eventFilter into historysheet.cpp, it seems that it conflicts with the itemdelegate. Because when it comes to a combobox cell the TAB function won't work any more.
    
    ui->tableView->installEventFilter(this);
    ui->tableView->setItemDelegate(cbid);
    

    The final goal for me is that two functions are needed. 1. Some table cells are combobox 2 When TAB is pressed it copies the content from last row to current row ( same column )

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved