30
30
from qgis .PyQt import uic
31
31
from qgis .PyQt .QtCore import Qt
32
32
from qgis .PyQt .QtGui import QStandardItemModel , QStandardItem
33
- from qgis .PyQt .QtWidgets import QInputDialog
33
+ from qgis .PyQt .QtWidgets import QInputDialog , QMessageBox
34
34
35
35
from qgis .core import QgsApplication
36
36
@@ -49,7 +49,7 @@ def __init__(self, parent=None):
49
49
self .btnRemoveColumn .setIcon (QgsApplication .getThemeIcon ('/mActionDeleteAttribute.svg' ))
50
50
self .btnAddRow .setIcon (QgsApplication .getThemeIcon ('/symbologyAdd.svg' ))
51
51
self .btnRemoveRow .setIcon (QgsApplication .getThemeIcon ('/symbologyRemove.svg' ))
52
- self .btnClear .setIcon (QgsApplication .getThemeIcon ('/mIconClearText .svg' ))
52
+ self .btnClear .setIcon (QgsApplication .getThemeIcon ('console/iconClearConsole .svg' ))
53
53
54
54
self .btnAddColumn .clicked .connect (self .addColumn )
55
55
self .btnRemoveColumn .clicked .connect (self .removeColumns )
@@ -86,7 +86,9 @@ def removeRows(self):
86
86
self .tblView .setUpdatesEnabled (True )
87
87
88
88
def clearTable (self , removeAll = False ):
89
- self .tblView .model ().clear ()
89
+ res = QMessageBox .question (self , self .tr ('Clear?' ), self .tr ('Are you sure you want to clear table?' ))
90
+ if res == QMessageBox .Yes :
91
+ self .tblView .model ().clear ()
90
92
91
93
def changeHeader (self , index ):
92
94
txt , ok = QInputDialog .getText (self , self .tr ("Enter column name" ), self .tr ("Column name" ))
0 commit comments