mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-23 09:59:31 -04: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 logging
|
||||||
import sys
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
|
|
||||||
# make the example runnable without the need to install
|
# make the example runnable without the need to install
|
||||||
from os.path import abspath, dirname
|
from os.path import abspath, dirname
|
||||||
@ -70,6 +71,10 @@ def main():
|
|||||||
# set log for debug
|
# set log for debug
|
||||||
logging.basicConfig(level=logging.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':
|
if args.qt_from == 'pyside':
|
||||||
# using PySide wrapper
|
# using PySide wrapper
|
||||||
from PySide.QtGui import QApplication, QMainWindow, QDockWidget
|
from PySide.QtGui import QApplication, QMainWindow, QDockWidget
|
||||||
@ -210,6 +215,9 @@ def main():
|
|||||||
window.resize(size)
|
window.resize(size)
|
||||||
window.move(pos)
|
window.move(pos)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# create the application
|
# create the application
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
app.setOrganizationName('QDarkStyle')
|
app.setOrganizationName('QDarkStyle')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user