File: app.py

package info (click to toggle)
app-model 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 700 kB
  • sloc: python: 5,484; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 641 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from app_model import Application
from app_model.backends.qt import QModelMainWindow

from .actions import ACTIONS
from .constants import MenuId


class MyApp(Application):
    def __init__(self) -> None:
        super().__init__("my_application")

        # ACTIONS is a list of Action objects.
        for action in ACTIONS:
            self.register_action(action)

        self._main_window = QModelMainWindow(app=self)
        # This will build a menu bar based on these menus
        self._main_window.setModelMenuBar([MenuId.FILE, MenuId.EDIT])

    def show(self) -> None:
        """Show the app"""
        self._main_window.show()