From 271d172b7ef312f3eca196a0a6fd3911c5819cac Mon Sep 17 00:00:00 2001 From: zsiki Date: Tue, 6 Jan 2015 14:46:00 +0100 Subject: [PATCH] import only neccessary Qt elements --- realcentroid.py | 7 +++---- realcentroiddialog.py | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/realcentroid.py b/realcentroid.py index 6296f89..97dc1fd 100644 --- a/realcentroid.py +++ b/realcentroid.py @@ -20,8 +20,8 @@ ***************************************************************************/ """ # Import the PyQt and QGIS libraries -from PyQt4.QtCore import * -from PyQt4.QtGui import * +from PyQt4.QtCore import QSettings, QCoreApplication, QTranslator, Qt +from PyQt4.QtGui import QAction, QIcon, QApplication, QMessageBox from qgis.core import * from qgis.utils import * # Initialize Qt resources from file resources.py @@ -31,7 +31,6 @@ import os.path import util from math import sqrt -#import pdb class RealCentroid: @@ -130,7 +129,7 @@ def centroids(self): QMessageBox.warning(self, "RealCentroid", \ QApplication.translate("RealCentroid", \ "Error loading shapefile:\n", None, \ - QtGui.QApplication.UnicodeUTF8) + self.dlg.shapefileName) + QApplication.UnicodeUTF8) + self.dlg.shapefileName) # run method that performs all the real work def run(self): diff --git a/realcentroiddialog.py b/realcentroiddialog.py index bf250d3..547cacf 100644 --- a/realcentroiddialog.py +++ b/realcentroiddialog.py @@ -21,7 +21,6 @@ """ from PyQt4 import QtCore, QtGui -from PyQt4.QtCore import Qt from ui_realcentroid import Ui_RealCentroid from qgis.core import * from qgis.utils import * @@ -63,13 +62,13 @@ def sel(self): """ enable/disable selected features only checkbox """ self.ui.selectedBox.setEnabled(False) - self.ui.selectedBox.setCheckState(Qt.Unchecked) + self.ui.selectedBox.setCheckState(QtCore.Qt.Unchecked) l = util.getMapLayerByName(self.ui.layerBox.currentText()) if l is not None: sf = l.selectedFeatures() if sf is not None and len(sf): self.ui.selectedBox.setEnabled(True) - self.ui.selectedBox.setCheckState(Qt.Checked) + self.ui.selectedBox.setCheckState(QtCore.Qt.Checked) def browse(self): self.ui.pointEdit.clear() # clear output file field