Пример #1
0
Файл: jal.py Проект: flmnvd/jal
def main():
    sys.excepthook = exception_logger
    os.environ[
        'QT_MAC_WANTS_LAYER'] = '1'  # Workaround for https://bugreports.qt.io/browse/QTBUG-87014

    error = JalDB().init_db(get_app_path())

    app = QApplication([])
    language = JalDB().get_language_code(JalSettings().getValue('Language',
                                                                default=1))
    translator = QTranslator(app)
    language_file = get_app_path(
    ) + Setup.LANG_PATH + os.sep + language + '.qm'
    translator.load(language_file)
    app.installTranslator(translator)

    if error.code == JalDBError.OutdatedDbSchema:
        error = JalDB().update_db_schema(get_app_path())

    if error.code != JalDBError.NoError:
        window = QMessageBox()
        window.setAttribute(Qt.WA_DeleteOnClose)
        window.setWindowTitle("JAL: Start-up aborted")
        window.setIcon(QMessageBox.Critical)
        window.setText(error.message)
        window.setInformativeText(error.details)
    else:
        window = MainWindow(language)
    window.show()

    app.exec()
    app.removeTranslator(translator)
Пример #2
0
def main() -> None:
    """Mainline for interactive review of layout."""
    app = QApplication(sys.argv)
    win = MainWin()
    win.exit_action.triggered.connect(sys.exit)
    win.show()
    app.exec()
Пример #3
0
 def __init__(self):
     self.app = QApplication(sys.argv)
     self.loadSettings()
     self.login = None
     self.main = None
     self.key = ''
     self.data = {}
Пример #4
0
def run(optimiser):
    app = QApplication(sys.argv)

    # Thread for running slow parts of the optimiser without pausing GUI

    opt_worker = OptWorker(optimiser)
    opt_thread = QThread()

    opt_worker.moveToThread(opt_thread)

    app.aboutToQuit.connect(opt_thread.quit)

    opt_thread.start()

    # Queue and thread for updating text field
    queue = Queue()
    sys.stdout = WriteStream(queue)

    window = BayesOptWindow(optimiser, opt_worker)
    window.show()

    write_thread = QThread()
    receiver = Receiver(queue)
    receiver.signal.connect(window.write_to_textfield)
    receiver.moveToThread(write_thread)
    write_thread.started.connect(receiver.run)
    app.aboutToQuit.connect(write_thread.quit)

    write_thread.start()

    # app.exec_()

    sys.exit(app.exec_())
def main():
    app = QApplication(sys.argv)
    app.setOrganizationName("ecosongs")
    app.setOrganizationDomain("https://github.com/vin985/pysoundplayer")
    app.setApplicationName("pysoundplayer")
    example = SpectrogramViewerExample()
    example.load_file("example.wav")

    tag1 = {
        "start": 1.5,
        "end": 3,
        "text": "this is a test",
        "border_color": "#ff0000",
        "fill_color": "#00ff00",
        "text_fontsize": 24,
    }

    tag2 = {
        "start": 10,
        "end": 20,
        "min_freq": 1000,
        "max_freq": 5000,
        "text": "frequency test",
        # "text_color": "#000000",
        "color": "#ff00ff",
    }

    example.spectrogram_viewer.draw_annotation(tag1)
    example.spectrogram_viewer.draw_annotation(tag2)

    example.show()
    sys.exit(app.exec_())
Пример #6
0
def main():
    app = QApplication(sys.argv)

    main_window = MainWindow()
    main_window.show()

    sys.exit(app.exec_())
Пример #7
0
 def __init__(self):
     self.batch_dir = Path.cwd().joinpath('test', 'batchtestdata')
     self.dicom_structure = DICOMDirectorySearch.get_dicom_structure(
         self.batch_dir, self.DummyProgressWindow, self.DummyProgressWindow)
     self.iso_levels = self.get_iso_levels()
     self.timestamp = BatchProcessingController.create_timestamp()
     self.application = QApplication()
Пример #8
0
def main():
    import sys

    pg.setConfigOptions(antialias=True)
    app = QApplication(sys.argv)
    mainwindow = MainWindow()
    mainwindow.show()
    sys.exit(app.exec_())
Пример #9
0
def draw(game):
    app = QApplication()

    widget = MyWidget(game)
    widget.resize(800, 600)
    widget.show()

    sys.exit(app.exec_())
Пример #10
0
def main():
    app = QApplication(sys.argv)
    window = MainWindow()

    window.show()

    # exit code == PySide returned val
    sys.exit(app.exec_())
Пример #11
0
def main():
    app = QApplication([])
    QtWebEngine.initialize()
    engine = QQmlApplicationEngine()
    qml_file_path = os.path.join(os.path.dirname(__file__), 'browser.qml')
    qml_url = QUrl.fromLocalFile(os.path.abspath(qml_file_path))
    engine.load(qml_url)
    app.exec_()
Пример #12
0
def main():

    app = QApplication(sys.argv)
    app.setStyle('Fusion')
    ex = MainWindow()
    ex.show()
    print("here goes")
    sys.exit(app.exec_())
def main():
    """main function
    """
    app = QApplication(sys.argv)
    ui = main_ui.Ui_MainWindow()
    window = MainWindow(app, ui)
    atexit.register(window._exit)
    window.show()
    sys.exit(app.exec_())
Пример #14
0
def test():
    import sys

    from PySide6.QtWidgets import QApplication

    app = QApplication(sys.argv)
    mainWindow = MainWindow()
    mainWindow.show()
    sys.exit(app.exec_())
Пример #15
0
 def start_gui(image_sensor: 'Image') -> None:
     """
     Starts the GUI from the provided image sensor.
     :param image_sensor: Image sensor
     """
     app: QApplication = QApplication(sys.argv)
     window: MainWindow = MainWindow(image_sensor)
     window.showMaximized()
     app.exec_()
Пример #16
0
 def __init__(self):
     """Show the main application window"""
     app = QApplication(sys.argv)
     # Open the main window
     self._main_window = SimilaritiesWindow()
     self._main_window.show()
     self._main_window.do_show_loaded_songs_gui_action()
     # Quit when the user exits the program
     sys.exit(app.exec_())
Пример #17
0
def test():
    import sys

    from PySide6.QtWidgets import QApplication

    app = QApplication(sys.argv)
    win = QMainWindow()
    MainWindowUI().setup_ui(win)
    win.show()
    sys.exit(app.exec_())
Пример #18
0
    def __init__(self):
        self.app = QApplication(sys.argv)
        self.stages = stages
        self.current_stage = 0
        self.history = []
        self.image_file = None

        self.window = MainWindow(self.stages)
        self.window.show()
        self.set_handlers()
Пример #19
0
def main() -> None:
    logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=logging.DEBUG)
    # get config
    parser = ArgumentParser()
    parser.add_argument('--config', help='configuration file', default='config.ini')
    args = parser.parse_args()
    # run application
    app = QApplication([])
    widget = EvelynDesktop(args.config)
    widget.show()
    sys.exit(app.exec_())
Пример #20
0
def main():
    """Main."""
    voice = composition.Voice("test", music21.scale.MajorScale("D"),
                              12, "tenor")
    voice.compose()
    print(str(voice))
    # Run interface
    app = QApplication(sys.argv)
    window = MainWindow()
    window.show()
    sys.exit(app.exec_())
Пример #21
0
    def __init__(self):
        self.midcom = MIDCOM()
        self.app = QApplication([])
        self.window = MainWindow()

        self.tax_model = TaxModel(self.midcom.taxes)
        self.setup_tax_table()

        self.product_model = ProductModel(self.midcom.products)
        self.setup_product_table()

        self.setup_file_menu()
Пример #22
0
def main():
    # Create the Qt Application
    app = QApplication(sys.argv)
    # load sytle
    with open("style.qss", "r") as f:
        _style = f.read()
        app.setStyleSheet(_style)
    # Create and show
    taplist = TapList()
    taplist.show()
    # Run the main Qt loop
    sys.exit(app.exec())
Пример #23
0
def run_gui(args):
    bridge = get_bridge()
    if not bridge:
        return
    if args.skip_req:
        bridge.disable_req()
    app = QApplication([])
    widget = HueControlWindow(bridge)
    widget.resize(600, 600)
    widget.show()

    sys.exit(app.exec())
Пример #24
0
def main():
    """Main Entry Point."""

    LOG = logging.getLogger("{{ cookiecutter.project_slug }}")
    LOG.setLevel(logging.DEBUG)

    Q_APP = QApplication([])
    APP = Application()

    LOG.info("Application Version: v{}".format(__version__))
    APP.show()

    sys.exit(Q_APP.exec_())
Пример #25
0
def main():
    """Main Loop."""
    print(__doc__ + __version__ + __url__)
    application = QApplication(sys.argv)
    application.setApplicationName("pyvoicechanger")
    application.setOrganizationName("pyvoicechanger")
    application.setOrganizationDomain("pyvoicechanger")
    application.setWindowIcon(QIcon.fromTheme("audio-input-microphone"))
    application.aboutToQuit.connect(
        lambda: call('killall rec ; killall play', shell=True))
    mainwindow = MainWindow()
    mainwindow.show()
    sys.exit(application.exec_())
Пример #26
0
def explore_signature_library(sig_trie):
    """
	Display an in-memory signature trie in the signature explorer GUI.
	:param sig_trie: instance of `TrieNode`
	"""
    if not QApplication.instance():
        app = QApplication(sys.argv)
    else:
        app = None
    widget = App()
    widget.show()
    widget.open_trie(sig_trie, '(memory)')
    if app:
        app.exec_()
Пример #27
0
def create_gui(icon):
    """Create and show the GUI Application"""
    app = QApplication()
    app.setApplicationName('Importador BGG -> Ludopedia')
    app.setApplicationVersion('v0.4')
    app.setWindowIcon(QIcon(icon))

    importer = Importador()
    importer.show()
    importer.raise_()
    importer.setVisible(True)
    importer.resize(500, 400)

    sys.exit(app.exec_())
def main():
    app = QApplication(sys.argv)
    app.setOrganizationName('kth')
    app.setOrganizationDomain('kth.se')
    app.setApplicationName('covid19-detector')

    window = Client(n_classes=3,
                    class_labels={
                        'covid-19': 0,
                        'normal': 1,
                        'pneumonia': 2
                    })
    window.showMaximized()
    sys.exit(app.exec())
Пример #29
0
def QVTKRenderWidgetConeExample():
    """A simple example that uses the QVTKRenderWindowInteractor class."""

    from vtkmodules.vtkFiltersSources import vtkConeSource
    from vtkmodules.vtkRenderingCore import vtkActor, vtkPolyDataMapper, vtkRenderer
    # load implementations for rendering and interaction factory classes
    import vtkmodules.vtkRenderingOpenGL2
    import vtkmodules.vtkInteractionStyle

    # every QT app needs an app
    app = QApplication(['QVTKRenderWindowInteractor'])

    window = QMainWindow()

    # create the widget
    widget = QVTKRenderWindowInteractor(window)
    window.setCentralWidget(widget)
    # if you don't want the 'q' key to exit comment this.
    widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit())

    ren = vtkRenderer()
    widget.GetRenderWindow().AddRenderer(ren)

    cone = vtkConeSource()
    cone.SetResolution(8)

    coneMapper = vtkPolyDataMapper()
    coneMapper.SetInputConnection(cone.GetOutputPort())

    coneActor = vtkActor()
    coneActor.SetMapper(coneMapper)

    ren.AddActor(coneActor)

    # show the widget
    window.show()

    widget.Initialize()
    widget.Start()

    # start event processing
    # Source: https://doc.qt.io/qtforpython/porting_from2.html
    # 'exec_' is deprecated and will be removed in the future.
    # Use 'exec' instead.
    try:
        app.exec()
    except AttributeError:
        app.exec_()
Пример #30
0
def main():
    parser = argparse.ArgumentParser(prog=videotrackr_name)
    parser.add_argument('video_file',
                        metavar='video_file',
                        type=str,
                        nargs='?',
                        help='Video file to use')
    parser.add_argument('--debug',
                        help='Enable debug mode',
                        action='store_true')
    args = parser.parse_args()

    app = QApplication([])
    form = main_controller(args.debug)
    form.show()
    sys.exit(app.exec_())