コード例 #1
0
 def __init__(self, iface: QgisInterface = None, canvas: QgsMapCanvas = None,
              position: int = Qt.RightDockWidgetArea):
     '''
     Parameters
     ----------
     iface : QgisInterface, optional
         instance of QGIS interface, defaults to the interface of the QGIS
         instance in use
     canvas : QgsMapCanvas, optional
         the map canvas, defaults to the canvas of the interface
     position : int, optional
         dock widget area to add the dock widget to, defaults to attach the
         widget in the right section of QGIS (Qt.RightDockWidgetArea)
     '''
     super().__init__()
     self.iface = iface or utils.iface
     self.canvas = canvas or self.iface.mapCanvas()
     self.initial_position = position
     self.ui = QtWidgets.QDockWidget()
     # look for file ui folder if not found
     ui_file = self.ui_file if os.path.exists(self.ui_file) \
         else os.path.join(settings.UI_PATH, self.ui_file)
     uic.loadUi(ui_file, self.ui)
     #self.ui.setAllowedAreas(
         #Qt.RightDockWidgetArea | Qt.LeftDockWidgetArea |
         #Qt.TopDockWidgetArea | Qt.BottomDockWidgetArea
     #)
     self.ui.closeEvent = self.closeEvent
     self.is_active = False
     self.setupUi()
コード例 #2
0
                "p, li { white-space: pre-wrap; }\n"
                "</style></head><body style=\" font-family:\'Ubuntu\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
                "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"https://qgiscloud.com/account/sign_up\"><span style=\" text-decoration: underline; color:#0057ae;\">Signup</span></a></p></body></html>"
            ))
        self.lblLoginStatus.setText(
            _translate("QgisCloudPlugin", "Logged in as ..."))
        self.btnLogout.setText(_translate("QgisCloudPlugin", "Logout"))
        self.label_29.setText(_translate("QgisCloudPlugin", "Databases"))
        self.btnDbCreate.setText(_translate("QgisCloudPlugin", "Create"))
        self.btnDbDelete.setText(_translate("QgisCloudPlugin", "Delete"))
        self.btnDbRefresh.setText(_translate("QgisCloudPlugin", "Refresh"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.accountTab),
                                  _translate("QgisCloudPlugin", "Account"))
        self.label_6.setText(
            _translate("QgisCloudPlugin", "<b>Plugin version:</b>"))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.aboutTab),
                                  _translate("QgisCloudPlugin", "About"))


from .spinner import Spinner
from .resources_rc import *

if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    QgisCloudPlugin = QtWidgets.QDockWidget()
    ui = Ui_QgisCloudPlugin()
    ui.setupUi(QgisCloudPlugin)
    QgisCloudPlugin.show()
    sys.exit(app.exec_())