Qt 6.11 is out! See what's new in the release
blog
Appcrash after sql statement with QString
General and Desktop
5
Posts
2
Posters
1.1k
Views
1
Watching
-
Hello,
If i execute this sql-statement my app crashes if I change a ComboBox item
@
void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
{if(!db.isOpen()) { qDebug() << "DB is not open!"; } QSqlQuery q; q.exec("SELECT * FROM autos WHERE snr = '"+ arg1 +"'"); }@
If i use this it works...
@
void MainWindow::on_comboBox_currentIndexChanged(const QString &arg1)
{if(!db.isOpen()) { qDebug() << "DB is not open!"; } QSqlQuery q; q.exec("SELECT * FROM autos WHERE snr = '0588/835'"); }@
why....???? :/
-
@
"0588/835"
@ -
I don´t know why, but now both solutions are working...
thanks anyway