Important: Please read the Qt Code of Conduct -

Pointer of QVector pointer

  • This is my class constructor:

    UndoRedo::UndoRedo(QList<vector_t*> v,
    QUndoCommand *parent)
    : QUndoCommand(parent)
    in = &v[0][0];

    vector_t = typedef QVector<QStringList> vector_t ;
    in = QStringList *in; (declared in .h file)

    Whwn I try to set "in" this way, the IDE raises this error:

    no match for 'operator*' (operand type is 'QList<QVector<QStringList>*>')

    Where I'm doing wrong? Can you help me?

  • Lifetime Qt Champion


    All in all you have a QList<QVector<QStringList>> not a QList<QVector<QStringList>>

    Anyway, unless you have a very good reason, you don't need to use a pointer to a QStringList ? Also, why not directly you a QVector<QVector<QStringList>> ? It would be more efficient.

Log in to reply