Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to initialize QTest framework for a osgQt GUI app

How to initialize QTest framework for a osgQt GUI app

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 315 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cyrus P.
    wrote on last edited by
    #1

    Hello,

    I am trying to initialize the QTest library for an application using osgQt in the following recommended way:

    QTEST_MAIN(InterfaceTests)
    

    However, this macro seems to create a QCoreApplication, which does not support GUI library use, as seen below:

    #define QTEST_MAIN(TestObject) \
    int main(int argc, char *argv[]) \
    { \
        QCoreApplication app(argc, argv); \
        app.setAttribute(Qt::AA_Use96Dpi, true); \
        TestObject tc; \
        QTEST_SET_MAIN_SOURCE_PATH \
        return QTest::qExec(&tc, argc, argv); \
    }
    

    What would be the correct way of initializing tests for a GUI application with osg?

    Thank you in advance.

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Cyrus-P. said in How to initialize QTest framework for a osgQt GUI app:

      QTEST_MAIN

      You're looking at the wrong place: https://code.woboq.org/qt5/qtbase/src/testlib/qtest.h.html#427
      The macro is using QApplication when you link against QtWidgets (and therefore QT_WIDGETS_LIB is defined) or QGuiApplication when you only link against QtGui (and therefore QT_GUI_LIB is defined)

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved