qml{plugindump|importscanner}: Don't mix std::cerr and std::wcerr

Apparently that causes output to be suppressed.

Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-99400
Change-Id: I4ac6a66a10c7d2c27dfc1efa6d52afa60bdc58d6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Ulf Hermann 2022-01-06 09:54:37 +01:00
parent 308f3cbc1a
commit 5fa9093191
2 changed files with 4 additions and 14 deletions

View File

@ -79,14 +79,14 @@ inline QString preferLiteral() { return QStringLiteral("prefer"); }
void printUsage(const QString &appNameIn)
{
const std::wstring appName = appNameIn.toStdWString();
const std::string appName = appNameIn.toStdString();
const QString qmlPath = QLibraryInfo::path(QLibraryInfo::QmlImportsPath);
std::wcerr
std::cerr
<< "Usage: " << appName << " -rootPath path/to/app/qml/directory -importPath path/to/qt/qml/directory\n"
" " << appName << " -qmlFiles file1 file2 -importPath path/to/qt/qml/directory\n"
" " << appName << " -qrcFiles file1.qrc file2.qrc -importPath path/to/qt/qml/directory\n\n"
"Example: " << appName << " -rootPath . -importPath "
<< QDir::toNativeSeparators(qmlPath).toStdWString()
<< QDir::toNativeSeparators(qmlPath).toStdString()
<< '\n';
}

View File

@ -991,19 +991,9 @@ void compactDependencies(QStringList *dependencies)
}
}
inline std::wostream &operator<<(std::wostream &str, const QString &s)
{
#ifdef Q_OS_WIN
str << reinterpret_cast<const wchar_t *>(s.utf16());
#else
str << s.toStdWString();
#endif
return str;
}
void printDebugMessage(QtMsgType, const QMessageLogContext &, const QString &msg)
{
std::wcerr << msg << std::endl;
std::cerr << msg.toStdString() << std::endl;
// In case of QtFatalMsg the calling code will abort() when appropriate.
}