Search code examples
linuxqtopenglqmlxcb

Why I cannot run a Qt Qml application on monitor with resolution 800x600?


When I set the resolution to 800x600, my application crashes with the following errors:

QXcbConnection: XCB error: 2 (BadValue), sequence: 460, resource id: 0, major code: 1 (CreateWindow), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 461, resource id: 37748745, major code: 2 (ChangeWindowAttributes), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 462, resource id: 37748745, major code: 18 (ChangeProperty), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 463, resource id: 37748745, major code: 18 (ChangeProperty), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 464, resource id: 37748745, major code: 18 (ChangeProperty), minor code: 0
etc.

But when I run a Qml application on a monitor with a resolution of 1920x1080 (or any other larger or equal to 1024x768) resolution, the application works fine.

  • System: Archlinux 4.7.4-1-ARCH x86_64 GNU/Linux
  • Qt: QMake version 3.0 Using Qt version 5.7.0
  • libxcb: libxcb 1.12-1

It's seems like it is a Qt bug or an xcb library bug.

UPD: I created a bug report in bugreports.qt.io.

This effect reproduced only for Qt Quick Controls 2 Application


Solution

  • This effect not reproduced if delete next line of code( in main.cpp ):

    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);