Show apps with/without QApplication in standardpaths_tester
This commit is contained in:
parent
1a7612e559
commit
db874d8bba
@ -2,8 +2,10 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from PyQt5.QtCore import (QT_VERSION_STR, PYQT_VERSION_STR, qVersion,
|
from PyQt5.QtCore import (QT_VERSION_STR, PYQT_VERSION_STR, qVersion,
|
||||||
QStandardPaths)
|
QStandardPaths, QCoreApplication)
|
||||||
|
|
||||||
|
|
||||||
|
def print_header():
|
||||||
print("Python {}".format(sys.version))
|
print("Python {}".format(sys.version))
|
||||||
print("os.name: {}".format(os.name))
|
print("os.name: {}".format(os.name))
|
||||||
print("sys.platform: {}".format(sys.platform))
|
print("sys.platform: {}".format(sys.platform))
|
||||||
@ -13,6 +15,30 @@ print("Qt {}, compiled {}".format(qVersion(), QT_VERSION_STR))
|
|||||||
print("PyQt {}".format(PYQT_VERSION_STR))
|
print("PyQt {}".format(PYQT_VERSION_STR))
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
def print_paths():
|
||||||
for name, obj in vars(QStandardPaths).items():
|
for name, obj in vars(QStandardPaths).items():
|
||||||
if isinstance(obj, QStandardPaths.StandardLocation):
|
if isinstance(obj, QStandardPaths.StandardLocation):
|
||||||
print("{:25} {}".format(name, QStandardPaths.writableLocation(obj)))
|
print("{:25} {}".format(name, QStandardPaths.writableLocation(obj)))
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
print_header()
|
||||||
|
|
||||||
|
print("No QApplication")
|
||||||
|
print("===============")
|
||||||
|
print()
|
||||||
|
print_paths()
|
||||||
|
|
||||||
|
app = QCoreApplication(sys.argv)
|
||||||
|
app.setApplicationName("qapp_name")
|
||||||
|
|
||||||
|
print()
|
||||||
|
print("With QApplication")
|
||||||
|
print("=================")
|
||||||
|
print()
|
||||||
|
print_paths()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user