Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

如何添加部件以获得方法支持



  • 在使用testlib时报错:error: no member named 'simulate' in 'QTestEventList'
    代码如下:
    QFETCH(QTestEventList, e);
    QFETCH(QString, result);

    QLineEdit oLineEdit;
    e.simulate(&oLineEdit);
    QVERIFY(oLineEdit.text() == result);
    

    我在pro里添加了
    QT += testlib
    QT += gui



  • @dilipa said in 如何添加部件以获得方法支持:

    在使用testlib时报错:error: no member named 'simulate' in 'QTestEventList'
    代码如下:
    QFETCH(QTestEventList, e);
    QFETCH(QString, result);
    QLineEdit oLineEdit;
    e.simulate(&oLineEdit);
    QVERIFY(oLineEdit.text() == result);

    我在pro里添加了

    Hi and welcome to devnet forum

    please post in English in all non-language dependent fora.

    For Chinese use Chinese forum

    Translation by Google
    嗨,欢迎来到devnet论坛

    请在所有非语言相关论坛中以英文发布。

    中国人使用中文论坛
    Hāi, huānyíng lái dào devnet lùntán

    qǐng zài suǒyǒu fēi yǔyán xiāngguān lùntán zhōng yǐ yīngwén fābù.



  • @koahnig 关于这个问题,有什么有效的解决办法吗



  • @dilipa

    I have never worked with QTestEventList. I see no obvious error in your handling.
    You may have to check the Qt version you are using and possibly start out with the test provided in the documentation.


Log in to reply