Results 1 to 11 of 11

Thread: How to create dependency between 2 columns using combobox delegates in MVC

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    uzairsaeed702 Guest

    Default How to create dependency between 2 columns using combobox delegates in MVC

    Hello,

    I have a 5 column Model inherited by "QAbstractTableModel" because of QTableView as View. The last two columns contains combo boxes which are populated through their delegates inherited by "QStyledItemDelegate". Everything is working fine independently.

    Next Task:
    Column 4 contains some mode which is related to column 5 in terms of respective functions,(refer the below figure) e.g. if I select some item in the (col-4) combo box, it will change/create the col-5 combo box according to the provided functions from Model. Which means every time when I receive the signal of datachange in column 4, it has to call the createWidget function from the delegate class in order to create a new combo box and its items. I tried some ways to call createWidget manually when I have received the datachange but as the Model is running with specific index.col I can not change the data of column 5 while changing settings in column 4.

    ComboBox.jpg

    above figure shows the example what i want to do , Like if I select the Decrement mode it will fetch the data(done) and create a new combo box or update the data of the combo box in column 5. I have tried many logic and algo to change things from setEditorData & setModelData though the only problem is that index is at column 4 so couldn't even do the qobject_cast.

    Please share your experience in this regard or maybe I am doing something wrong.
    Last edited by uzairsaeed702; 2nd March 2015 at 13:03.

Similar Threads

  1. Replies: 2
    Last Post: 28th June 2014, 08:21
  2. How to create a color bar in combobox ?
    By likaci in forum Newbie
    Replies: 4
    Last Post: 22nd January 2014, 17:16
  3. Replies: 0
    Last Post: 25th July 2011, 15:11
  4. ComboBox with multiple columns
    By haldrik in forum Qt Programming
    Replies: 7
    Last Post: 11th July 2009, 11:15
  5. Different delegates to different Columns of QTableView.
    By kaushal_gaurav in forum Qt Programming
    Replies: 4
    Last Post: 6th August 2008, 10:17

Tags for this Thread

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.