from PySide.QtCore import Qt from qrmainwindow import QtReduceMainWindow app = QApplication(sys.argv) app.setOrganizationName("The Reduce Project") app.setOrganizationDomain("reduce-algebra.sourceforge.net") app.setApplicationName("QReduce") qtTranslator = QTranslator(app) qtTranslator.load("qt_" + QLocale.system().name(), QLibraryInfo.location(QLibraryInfo.TranslationsPath)) app.installTranslator(qtTranslator) qreduceTranslator = QTranslator(app) qreduceTranslator.load(sys.path[0] + "/" + "qreducetr." + str(locale.getdefaultlocale()[0])) #app.installTranslator(qreduceTranslator) # app.setStyleSheet("QStatusBar::item { border: 0px solid black }"); app.setWindowIcon(QIcon(sys.path[0] + "/" + "Bumblebee.png")) if os.uname()[0] == "Darwin": app.setAttribute(Qt.AA_DontShowIconsInMenus) mainwindow = QtReduceMainWindow() sys.exit(app.exec_())
set_attributes = ["AA_EnableHighDpiScaling"] try: from PySide.QtGui import QWidget, QApplication, QVBoxLayout, QHBoxLayout, QGroupBox from PySide.QtGui import QScrollArea, QTabWidget, QComboBox, QPushButton, QTextEdit from PySide.QtGui import QFileDialog, QCheckBox, QLabel, QMenuBar, QAction, QDialog from PySide.QtCore import Slot, QSize, QSettings except ImportError: try: from PySide2.QtWidgets import QWidget, QApplication, QVBoxLayout, QHBoxLayout, QGroupBox from PySide2.QtWidgets import QScrollArea, QTabWidget, QComboBox, QPushButton, QTextEdit from PySide2.QtWidgets import QFileDialog, QCheckBox, QLabel, QMenuBar, QAction, QDialog from PySide2.QtCore import Slot, Qt, QCoreApplication, QSize, QSettings for attribute in set_attributes: QApplication.setAttribute(getattr(Qt, attribute)) except ImportError: QWidget, Slot = object, (lambda: lambda *x: None) # Quit with C-c signal.signal(signal.SIGINT, signal.SIG_DFL) def text(key, contents): desc = (contents or {}).get(input_database._desc) return desc or key def get_settings(): return QSettings('cobaya', 'gui')