[Interest] can't dump QStringList with qDebug()

Kai Köhne Kai.Koehne at qt.io
Tue Mar 7 10:11:41 CET 2023


Hi,

This looks like a compiler issue to me.
>     const auto connections = QSqlDatabase::connectionNames();
>     qDebug() << "Closing open connections:" << connections;
>
> claiming that
> ../../../src/server/server_database.cpp:691:45: error: invalid operands to binary expression ('QDebug' and>
> 'const QList<QString>')

I think this is the place where it goes wrong: 

> ../../../../Qt6.4.2/6.4.2/gcc_64/include/QtCore/qdebug.h:217:53: note: candidate template ignored: requirement 'std::conjunction_v<std::disjunction<std::is_base_of<QList<QString>, QString>, QTypeTraits::has_ostream_operator<QDebug, QString, void>>>' was not satisfied [with T = QString]
> inline QDebugIfHasDebugStreamContainer<QList<T>, T> operator<<(QDebug debug, const QList<T> &vec)
>                                                     ^

Anyhow, I couldn't reproduce this in a minimal example (and apparently you didn't manage either?). At minimum we need the exact compiler + compiler options passed on command line.

I also suggest to move this to bugreports.qt.io.

Regards

Kai



More information about the Interest mailing list