2

I have written a Qt GUI application using Qt5 on Fedora 29. The application, which uses all kinds of Qt widgets, works as intended, but when I run it from the command line, I'm inundated with errors (like the one below) on the console:

qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 4225, resource id: 36071117, major code: 40 (TranslateCoords), minor code: 0

For example, if I have a simple QMessageBox, with a simple text message and one "OK" push button, clicking on that OK push button will close the message box (as expected) and ALWAYS print out the error above.

{
    QMessageBox::critical(this, "Title", "Fatal Error");
}

When I google these errors, I see people saying that these messages are harmless and that they can be safely ignored, but I find it hard to believe that Qt would make the effort of printing these messages if nothing is wrong.

Does anyone know what these messages mean and what I can do to get rid of them?

barcaroller
  • 121
  • 1
  • 8

1 Answers1

2

For the first part of your question, as Nikos C. has commented above, this is a bug in Qt.

You can always suppress diagnostic output of Qt. That has been answered some years ago: How to redirect qDebug, qWarning, qCritical etc output?

There are a few exceptional messages that can't be suppressed (e. g. qSetGlobalQHashSeed uses printf for warnings), but these are very rare.

Georgy Pashkov
  • 1,285
  • 7
  • 11