Important: Please read the Qt Code of Conduct -

Find a issue when invoking QComboBox::setItemText on MacOS X

  • The invocation is quite simple, like below:
    QComboBox* combo = new QComboBox(parent);

    int index = combo->findData(Id);
    if(combo->itemText(index) == Id)
    QString name = getNameById(Id);
    combo->setItemText(index, name);

    At runtime, I'll get the error message saying:
    QObject::connect: Cannot queue arguments of type 'QVector<int>'
    (Make sure 'QVector<int>' is registered using qRegisterMetaType().)

    As long as making the line "combo->setItemText(index, name);" an annotation with "//", the message will go away. Anybody there has the same question?

  • Lifetime Qt Champion


    Pretty strange because the error seems to be completely unrelated to QComboBox.

    Do you use a QVector<int> anywhere in your program in a signal or slot signature ?

    Can you create a minimal compilable example from scratch that reproduces this ?

Log in to reply