mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 13:48:42 -05:00
Prepare example to run with no screen
This commit is contained in:
parent
3271c5974d
commit
85b8333faa
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user