Layman_dockwidget.py 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # -*- coding: utf-8 -*-
  2. """
  3. /***************************************************************************
  4. LaymanDockWidget
  5. A QGIS plugin
  6. Layman
  7. Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
  8. -------------------
  9. begin : 2019-02-15
  10. git sha : $Format:%H$
  11. copyright : (C) 2019 by jan vrobel
  12. email : vrobel.jan@seznam.cz
  13. ***************************************************************************/
  14. /***************************************************************************
  15. * *
  16. * This program is free software; you can redistribute it and/or modify *
  17. * it under the terms of the GNU General Public License as published by *
  18. * the Free Software Foundation; either version 2 of the License, or *
  19. * (at your option) any later version. *
  20. * *
  21. ***************************************************************************/
  22. """
  23. import os
  24. from PyQt5 import QtGui, QtWidgets, uic
  25. from PyQt5.QtCore import pyqtSignal
  26. FORM_CLASS, _ = uic.loadUiType(os.path.join(
  27. os.path.dirname(__file__), 'Layman_dockwidget_base.ui'))
  28. class LaymanDockWidget(QtWidgets.QDockWidget, FORM_CLASS):
  29. closingPlugin = pyqtSignal()
  30. def __init__(self, parent=None):
  31. """Constructor."""
  32. super(LaymanDockWidget, self).__init__(parent)
  33. # Set up the user interface from Designer.
  34. # After setupUI you can access any designer object by doing
  35. # self.<objectname>, and you can use autoconnect slots - see
  36. # http://doc.qt.io/qt-5/designer-using-a-ui-file.html
  37. # #widgets-and-dialogs-with-auto-connect
  38. self.setupUi(self)
  39. def closeEvent(self, event):
  40. self.closingPlugin.emit()
  41. event.accept()