Skip to content
Snippets Groups Projects
widgets.py 37.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • class PropertyDialogUI(QDialog, loadUIFormClass(PATH_SETTINGSDIALOG_UI)):
    
        def __init__(self, parent=None):
            super(PropertyDialogUI, self).__init__(parent)
            self.setupUi(self)
    
    
    
    if __name__ == '__main__':
        import site, sys
        #add site-packages to sys.path as done by enmapboxplugin.py
    
        from timeseriesviewer import DIR_SITE_PACKAGES
        site.addsitedir(DIR_SITE_PACKAGES)
    
        #prepare QGIS environment
        if sys.platform == 'darwin':
            PATH_QGS = r'/Applications/QGIS.app/Contents/MacOS'
            os.environ['GDAL_DATA'] = r'/usr/local/Cellar/gdal/1.11.3_1/share'
        else:
            # assume OSGeo4W startup
            PATH_QGS = os.environ['QGIS_PREFIX_PATH']
        assert os.path.exists(PATH_QGS)
    
        qgsApp = QgsApplication([], True)
        QApplication.addLibraryPath(r'/Applications/QGIS.app/Contents/PlugIns')
        QApplication.addLibraryPath(r'/Applications/QGIS.app/Contents/PlugIns/qgis')
        qgsApp.setPrefixPath(PATH_QGS, True)
        qgsApp.initQgis()
    
        #run tests
        #d = AboutDialogUI()
        #d.show()
    
        d = PropertyDialogUI()
        d.exec_()
        #close QGIS
        qgsApp.exec_()
        qgsApp.exitQgis()