# Path: gsdview/mdi.py
# class MdiMainWindow(QtWidgets.QMainWindow):
#     """Base class for MDI applications.
# 
#     :SIGNALS:
# 
#         * :attr:`subWindowClosed`
# 
#     """
# 
#     # @TODO: should the subWindowClosed signal be emitted by mdiarea?
#     #: SIGNAL: it is emitted when an MDI subwindow is closed
#     #:
#     #: :C++ signature: `void subWindowClosed()`
#     subWindowClosed = QtCore.Signal()
# 
#     def __init__(self, parent=None, flags=QtCore.Qt.WindowFlags(0), **kwargs):
#         super().__init__(parent, flags, **kwargs)
# 
#         #: MDI area instance (QMdiArea)
#         self.mdiarea = QtWidgets.QMdiArea()
#         self.setCentralWidget(self.mdiarea)
#         self.mdiarea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
#         self.mdiarea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
# 
#         #: sub-windows menu
#         self.windowmenu = QtWindowListMenu(self.menuBar())
#         self.windowmenu.attachToMdiArea(self.mdiarea)
# 
# Path: gsdview/qtsupport.py
# def geticon(name, package=None):
#     """Build and return requested icon.
# 
#     It is assumed that icon files are located in the "images" subfolder
#     of the package.
# 
#     .. seealso:: :func:`gsdview.utils.getresource`
# 
#     """
# 
#     iconfile = utils.getresource(os.path.join('images', name), package)
# 
#     return QtGui.QIcon(iconfile)


import os
import sys
    import sys
from qtpy import QtCore, QtWidgets
from gsdview.mdi import MdiMainWindow
from gsdview.qtsupport import geticon
            shortcut=self.tr('Ctrl+O'),
            statusTip=self.tr('Open an existing file'),
            triggered=self.open)

        icon = style.standardIcon(style.SP_DialogSaveButton)
        self.saveAct = QtWidgets.QAction(
            icon, self.tr('&Save'), self,
            shortcut=self.tr('Ctrl+S'),
            statusTip=self.tr('Save the document to disk'),
            triggered=self.save)

        self.saveAsAct = QtWidgets.QAction(
            self.tr('Save &As...'), self,
            statusTip=self.tr('Save the document under a new name'),
            triggered=self.saveAs)

        self.exitAct = QtWidgets.QAction(
            self.tr('E&xit'), self,
            shortcut=self.tr('Ctrl+Q'),
            statusTip=self.tr('Exit the application'),
            triggered=self.close)

        icon = geticon('cut.svg', 'gsdview')
        self.cutAct = QtWidgets.QAction(
            icon, self.tr('Cu&t'), self,
            shortcut=self.tr('Ctrl+X'),
            statusTip=self.tr("Cut the current  selection's contents  to the "
                              "clipboard"),
            triggered=self.cut)


# Path: gsdview/mdi.py
# class MdiMainWindow(QtWidgets.QMainWindow):
#     """Base class for MDI applications.
# 
#     :SIGNALS:
# 
#         * :attr:`subWindowClosed`
# 
#     """
# 
#     # @TODO: should the subWindowClosed signal be emitted by mdiarea?
#     #: SIGNAL: it is emitted when an MDI subwindow is closed
#     #:
#     #: :C++ signature: `void subWindowClosed()`
#     subWindowClosed = QtCore.Signal()
# 
#     def __init__(self, parent=None, flags=QtCore.Qt.WindowFlags(0), **kwargs):
#         super().__init__(parent, flags, **kwargs)
# 
#         #: MDI area instance (QMdiArea)
#         self.mdiarea = QtWidgets.QMdiArea()
#         self.setCentralWidget(self.mdiarea)
#         self.mdiarea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
#         self.mdiarea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
# 
#         #: sub-windows menu
#         self.windowmenu = QtWindowListMenu(self.menuBar())
#         self.windowmenu.attachToMdiArea(self.mdiarea)
# 
# Path: gsdview/qtsupport.py
# def geticon(name, package=None):
#     """Build and return requested icon.
# 
#     It is assumed that icon files are located in the "images" subfolder
#     of the package.
# 
#     .. seealso:: :func:`gsdview.utils.getresource`
# 
#     """
# 
#     iconfile = utils.getresource(os.path.join('images', name), package)
# 
#     return QtGui.QIcon(iconfile)


# Path: tests/test_mdi.py
import os
import sys
    import sys
from qtpy import QtCore, QtWidgets
from gsdview.mdi import MdiMainWindow
from gsdview.qtsupport import geticon

            shortcut=self.tr('Ctrl+O'),
            statusTip=self.tr('Open an existing file'),
            triggered=self.open)

        icon = style.standardIcon(style.SP_DialogSaveButton)
        self.saveAct = QtWidgets.QAction(
            icon, self.tr('&Save'), self,
            shortcut=self.tr('Ctrl+S'),
            statusTip=self.tr('Save the document to disk'),
            triggered=self.save)

        self.saveAsAct = QtWidgets.QAction(
            self.tr('Save &As...'), self,
            statusTip=self.tr('Save the document under a new name'),
            triggered=self.saveAs)

        self.exitAct = QtWidgets.QAction(
            self.tr('E&xit'), self,
            shortcut=self.tr('Ctrl+Q'),
            statusTip=self.tr('Exit the application'),
            triggered=self.close)

        icon = geticon('cut.svg', 'gsdview')
        self.cutAct = QtWidgets.QAction(
            icon, self.tr('Cu&t'), self,
            shortcut=self.tr('Ctrl+X'),
            statusTip=self.tr("Cut the current  selection's contents  to the "
                              "clipboard"),
            triggered=self.cut)


        icon = geticon('copy.svg', 'gsdview.gdalbackend')