MCPcopy Create free account
hub / github.com/Apress/modern-pyqt / runQuery

Method runQuery

ch04_database_handling/sql_manager.py:115–127  ·  view source on GitHub ↗

Run the query/queries entered in the QTextEdit widget.

(self)

Source from the content-addressed store, hash-verified

113 toolbar.addAction(run_query_act)
114
115 def runQuery(self):
116 """Run the query/queries entered in the QTextEdit widget."""
117 query_text = self.query_entry_field.toPlainText()
118 queries = query_text.split('\n')
119
120 if query_text != "":
121 for qry in queries:
122 if qry == "":
123 # Pass over empty lines
124 pass
125 else:
126 query = QSqlQuery(qry)
127 self.sql_model.setQuery(query)
128
129 def clearText(self):
130 """Clear the QTextEdit widget's text."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected