QtTest Module



Contains all the functions and declarations that are related to the QTestLib tool



Enables introspection of signal emission


List of GUI events


Used to simulate a sequence of touch events

Detailed Description

The QtTest module provides classes for unit testing Qt applications and libraries.

Applications that use Qt's unit testing classes need to be configured to be built against the QtTest module. To include the definitions of the module's classes, use the following directive:

  1. #include <QtTest>

To link against the module, add this line to your qmake .pro file:

  1. CONFIG += qtestlib

See the QTestLib Manual for a detailed introduction on how to use Qt's unit testing features with your applications.

The QtTest module is part of all Qt editions.

Notes provided by the Qt Community
  • 4

Votes: 2

Coverage: Qt library 4.8, 4.7

Picture of 1+1=10 1+1=10

Ant Farmer
2 notes

Two ways to link against the module

There are two ways to link against the module:

  1. CONFIG += qtestlib


  1. QT += testlib

The former is no longer recommended.