diff --git a/example/example.py b/example/example.py index a12889288..7329a96cb 100644 --- a/example/example.py +++ b/example/example.py @@ -41,6 +41,7 @@ problems. import logging import sys import argparse +import os # make the example runnable without the need to install from os.path import abspath, dirname @@ -70,6 +71,10 @@ def main(): # set log for debug logging.basicConfig(level=logging.DEBUG) + # to avoid problems when testing without screen + if args.test: + os.environ['QT_QPA_PLATFORM']='offscreen' + if args.qt_from == 'pyside': # using PySide wrapper from PySide.QtGui import QApplication, QMainWindow, QDockWidget @@ -210,6 +215,9 @@ def main(): window.resize(size) window.move(pos) + + + # create the application app = QApplication(sys.argv) app.setOrganizationName('QDarkStyle')