Hi Frank, 

What does the standard delegate do for your model/view at the moment?  I
can't recall the specifics, but it certainly uses combo boxes at the moment
- eg, for boolean fields (which I think is painful, but anyway).  

I think you need to give more information about what you are expecting.  For
example, you include 'insert' as an action.  But what does this mean?  If a
user types an entry not already in the list, what do you expect to happen?
Which table would the new entry be inserted into?  

Where should the combo box get its values from?  

Yes I agree that the model view classes take a while to grok.  

Tony.

> Sent: Tuesday, 26 June 2012 2:36 PM
> 
> Hello List!
> 
> I have a QTableView and I would like to use a QComboBox to insert and
> modify its entries.  I'm looking for the simplest way to do this that uses
as
> much unmodified Qt functionality as possible.
> 
> At the moment I am thinking that I can use the class template
> QStandardItemEditorCreator specialized on QComboBox as the most direct
> way to do this.  Two questions:
> 
> Am I on the right track here?
> 
> What specifically do I need to do to make this work?  I don't really see
the full
> end-to-end logic (i.e., starting with a specific instance of a
> QTableView) of how to hook all of the plumbing together.
> 
> (The model backing the QTableView happens to be a QSqlTableModel,
> although -- and please correct me if I'm wrong -- this should be
irrelevant.)
> 
> I've looked at a number of examples in the Qt documentation but the ones
> I've found seemed to be concerned with writing custom delegates and
> editors, rather than using existing delegate and editor classes already
> provided by Qt.  Although I do believe I could achieve my end goal with a
> custom delegate, I think using one would be more complicated than
> necessary.  For example, as I understand it, QTableView uses QItemDelegate
> as its default delegate, and that I can achieve my goal without changing
this.
> 
> Assuming that I am on the right track, concrete details would be greatly
> appreciated.  I'm lost in the multiple layers of the documentation at the
> moment.
> 
> Thanks for any suggestions.
> 
> K. Frank


_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to