Class: QgsQueryBuilder

class qgis.gui.QgsQueryBuilder(layer: QgsVectorLayer, parent: QWidget = None, fl: Union[Qt.WindowFlags, Qt.WindowType] = QgsGuiUtils.ModalDialogFlags)

Bases: PyQt5.QtWidgets.QDialog

This constructor is used when the query builder is called from the vector layer properties dialog

Parameters:
  • layer – existing vector layer
  • parent – Parent widget
  • fl – dialog flags

Query Builder for layers.

The query builder allows interactive creation of a SQL for limiting the features displayed in a vector layer. The fields in the table are displayed and sample values (or all values) can be viewed to aid in constructing the query. A test function returns the number of features that will be returned.

accept(self)
actionEvent()
changeEvent()
childEvent()
clear(self)
closeEvent()
connectNotify()
contextMenuEvent()
create()
customEvent()
destroy()
disconnectNotify()
dragEnterEvent()
dragLeaveEvent()
dragMoveEvent()
dropEvent()
enterEvent()
event()
eventFilter()
focusInEvent()
focusNextChild()
focusNextPrevChild()
focusOutEvent()
focusPreviousChild()
hideEvent()
initPainter()
inputMethodEvent()
isSignalConnected()
keyPressEvent()
keyReleaseEvent()
leaveEvent()
metric()
mouseDoubleClickEvent()
mouseMoveEvent()
mousePressEvent()
mouseReleaseEvent()
moveEvent()
nativeEvent()
paintEvent()
receivers()
reject(self)
resizeEvent()
sender()
senderSignalIndex()
setDatasourceDescription(self, uri: str)
setSql(self, sqlStatement: str)
sharedPainter()
showEvent(self, event: QShowEvent)
sql(self) → str
tabletEvent()
test(self)

Test the constructed sql statement to see if the vector layer data provider likes it. The number of rows that would be returned is displayed in a message box. The test uses a “select count(*) from …” query to test the SQL statement.

timerEvent()
updateMicroFocus()
wheelEvent()