c++ - Qt 5.2 cannot get qWait function to work -


i've got header file following include:

#include <qttest/qttest> 

i trying use following line generate non-blocking wait in main window:

qtest::qwait(1000 - ui->speeddial->value()); 

i receive following error:

mainwindow.obj:-1: error: lnk2019: unresolved external symbol "__declspec(dllimport) void __cdecl qtest::qsleep(int)" (__imp_?qsleep@qtest@@yaxh@z) referenced in function "void __cdecl qtest::qwait(int)" (?qwait@qtest@@yaxh@z)

can me understand doing wrong, or provide alternative method? these lines independent of other code.

it works fine me. check example modified version of qt test official documentation example:

tutorial1.pro:

sources = testqstring.cpp config  += qtestlib  # install target.path = $$[qt_install_examples]/qtestlib/tutorial1 sources.files = $$sources *.pro sources.path = $$[qt_install_examples]/qtestlib/tutorial1 installs += target sources  symbian {     target.uid3 = 0xa000c60b     include($$qt_source_tree/examples/symbianpkgrules.pri) } maemo5: include($$qt_source_tree/examples/maemo5pkgrules.pri)  symbian: warning(this example might not work on symbian platform) maemo5: warning(this example might not work on maemo platform) simulator: warning(this example might not work on simulator platform) 

testqstring.cpp:

#include <qttest/qttest> #include <qdebug>  class testqstring: public qobject {     q_object private slots:     void toupper(); };  void testqstring::toupper() {     qstring str = "hello";      qtest::qwait(2000);      qcompare(str.toupper(), qstring("hello")); }  qtest_main(testqstring) #include "testqstring.moc" 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -