Gathering model data in a QAbstractItemDelegate

  • Is any trivial way to gather all the editor models used in more QAbstractItemDelegate? I have several delegates and I want to make one data structure of each editor item. For example:
    QWidget *ComboboxBoxDelegate::createEditor(QWidget parent,
    const QStyleOptionViewItem &/
    option /,
    const QModelIndex &/
    index */) const
    QComboBox *editor = new QComboBox(parent);
    return editor;

    I have several editors like this; how can I gather all items added to all editors? Pay attention that *editor maybe is not global...

  • I don't understand the question. Please try to rephrase. What kind of data structure did you have in mind?

  • The answer is simple: As you see, we have item A, B in a combobox and in some other combobox delegate items C, D and so one. I want to make a new model, containing all of this items or descriptions or maybe a pointer to this items to copy them, or.. anything. I want to have one model with all A, B, C, D, ..., items (or data from items). Was I clear enough? Sorry for my englisch. These items are created dinamically during runtime. It will be an option to put them in a data structure during creation but I do not want to do in that way but rather found them later lasily (Delegates are recreated several times for each cells so that is not a friendly method...).

  • Noone makes a guess?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.