QXcbConnection Error with QSplitter
-
Hi fellow Qt users,
I have a class that is derived from QDialog in my application to create a settings dialog. I'm using a QSplitter to show stuff that can be manipulated with settings in a QTreeWidget on the left and - depending on what element in the tree is activated, the actual options in widgets on the right side of the splitter. I've noticed, that every time I move my splitter, I get tons of this error code on my console:
QXcbConnection: XCB error: 8 (BadMatch), sequence: 7725, resource id: 35651703, major code: 130 (Unknown), minor code: 3
Has anybody seen this before and knows how to get rid of it? It doesn't seem to have any impact on the application's functionality, everything runs smoothly. But I'd like to get rid of the problem regardless so the log files won't be flooded with those messages.
Thanks,
Tobias -
Hi,
Which version of Qt ? With which distribution ? Can you reproduce that with a minimal sample application ?
-
Hi @SGaist,
I'm using Qt 5.5.1 which came with my OpenSuse Leap 42.1 so it's not the newest Qt5 version that's available. Unfortunately, I cannot reproduce the problem with a minimal sample. However, I was able to identify what seems to be a connection between the error message and stylesheets.
I'm using a QSS file to style my application which I can set at runtime. If this isn't set, the error message doesn't occur. But as soon as I set the stylesheet.qss, it starts popping up. Here's how I set the stylesheet:
QFile file(_path); if(!file.open(QFile::ReadOnly)) { qDebug() << "Unable to open file" << qPrintable(file.fileName()) << ":" << qPrintable(file.errorString()); return; } QString styleSheet = QLatin1String(file.readAll()); qApp->setStyleSheet(styleSheet);
And here's the stylesheet file
/* MAIN APPLICATION WINDOWS */ ApplicationWindow { font-family: "\:fonts/arial"; background-color: white; background-image: url(":/background/launcher1"); background-repeat: no; background-position: top right; background-attachment: fixed; } /* MAIN PROJECT MANAGER WINDOW */ ProjectManagerWindow { background-color: white; } /* MENU BAR AND DROPDOWN MENUS */ QMenuBar { background-color: transparent; } QMenuBar::item { spacing: 5px; padding: 5px 10px; background: transparent; } QMenuBar::item:selected { color: white; background-color: rgb(0, 83, 140); } QMenuBar::item:pressed { color: white; background-color: rgb(0, 83, 140); } QMenu { border: 1px solid rgb(0, 83, 140); padding: 5px; background-color: white; } QMenu::item { padding: 5px 10px 5px 25px; background-color: transparent; } QMenu::item:selected { color: white; background-color: rgb(0, 83, 140); } QMenu::separator { height: 1px; background-color: rgb(0, 83, 140); margin: 5px; } QMenu::indicator { width: 12px; height: 12px; border: 1px solid rgb(0, 83, 140); border-radius: 3px; margin: 0px 5px; } QMenu::indicator:checked:selected { background-color: rgb(0, 83, 140); border-color: white; } QMenu::indicator:checked { background-color: rgb(0, 83, 140); } QMenu::indicator:unchecked:selected { background-color: white; } QMenu::indicator:unchecked { background-color: white; } /* TOOL BAR IN MAIN WINDOW */ QToolBar { background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #dadbde, stop: 0.5 transparent); } QLabel#userInfo { border: 0px; border-radius: 10px; min-height: 60px; padding: 0px 10px; } QLabel#userImage { border: 0px; border-radius: 10px; /*background-image: url(:/user/generic);*/ background-position: center center; min-width: 60px; max-width: 60px; min-height: 60px; max-height: 60px; padding: 0px; margin: 5px; } /* APPLICATION LAUNCHER DESIGNS */ QPushButton#launcherButton { border-radius: 10px; border-style: outset; background-color: rgb(1, 80, 137); color: white; font-size: 24px; font-weight: bold; min-width: 200px; min-height: 200px; max-width: 200px; max-height: 200px; } QPushButton#launcherButton:disabled { color: rgb(168, 169, 173); background-color: rgb(226, 243, 243); border-color: rgb(168, 189, 173); } QPushButton#launcherButton:hover { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(1, 80, 137), stop: 1 rgb( 1, 122, 209)); } QPushButton#launcherButton:pressed { border: 2px solid white; } /* SETTINGS DIALOG */ QDialog { background-color: white; } QHeaderView { background-color: transparent; border: none; border-top-left-radius: 10px; border-top-right-radius: 10px; } QHeaderView:section { background: transparent; color: rgb( 67, 67, 67); text-align: center; font-weight: bold; font-size: 14px; border-bottom: 1px solid rgb( 1, 170, 171); padding: 10px; } QTreeWidget, QTreeView { background-color: white; border: 1px solid rgb( 0, 170, 171); border-radius: 10px; } QTreeWidget:item, QTreeView:item { color: rgb(67, 67, 67); } QTreeWidget:item:hover, QTreeView:item:hover { color: rgb(67, 67, 67); background-color: rgb(226,243,243); } QTreeWidget:item:selected, QTreeView:item:selected { background-color: rgb(0, 170, 171); background-color: rgba(0, 170, 171, 0.5); } QTreeView:item:selected:hover, QTreeWidget:item:selected:hover { color: white; background-color: rgb(0, 170, 171); } QWidget#SettingsContent { border: 1px solid rgb( 0, 170, 171); border-radius: 10px; } QWidget QPushButton { border: 1px solid rgb(128,130,133); border-radius: 5px; padding: 7px 14px; } QWidget QPushButton:hover { border: 1px solid rgb(128,130,133); border-radius: 5px; padding: 7px 14px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(226, 243, 243), stop: 1 white); } QWidget QPushButton:focus { border: 1px solid rgb(128,130,133); border-radius: 5px; padding: 7px 14px; color: rgb(1, 80, 137); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 white, stop: 1 rgb(226, 243, 243)); } QWidget QPushButton:pressed { border: 1px solid white; color: white; border-radius: 5px; padding: 7px 14px; background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb( 69, 176, 253), stop: 1 rgb(1, 80, 137)); } QCommandLinkButton#start3D { border: 1px solid rgb(128, 130, 133); border-radius: 5px; padding: 7px 14px; } QListWidget { border-radius: 10px; border: 1px solid rgb(0, 170, 171); padding: 5px; alternate-background-color: rgb(226, 243, 243); } QListWidgetItem { background: transparent; } QLabel#Headline { font-weight: bold; font-size: 14px; border-bottom: 1px solid rgb( 1, 170, 171); padding: 5px; } QLineEdit { border: 1px solid rgb(226, 243, 243); border-radius: 5px; padding: 5px; selection-background-color: rgb( 1, 170, 171); selection-color: white; color: rgb( 67, 67, 67); } QLineEdit:hover { background-color: rgb(226, 243, 243); border-color: rgb( 1, 170, 171); } QLineEdit:focus { border-color: rgb( 1, 170, 171); } QLineEdit:read-only, QLineEdit:read-only:hover { background-color: white; color: rgb(168, 169, 173); border-color: rgb(226,243,243); } QComboBox { border: 1px solid rgb(226, 243, 243); border-radius: 5px; padding: 5px; selection-background-color: rgb( 1, 170, 171); selection-color: white; color: rgb( 67, 67, 67); }
I can't see anything problematic in the stylesheet file and it's getting parsed and applied just as I'd expect it to be.
-
Are you sure your ApplicationWindow font-family property is correct ?
-
@SGaist you're right, that was indeed a character swap in there. But correcting it did not remove the error/warning message. It still comes up, every time I open the QDialog with the QSplitter.
PS: Sorry for the delayed response, I was out of office for a couple days
-
One thing to clear, does that happen on your development station ?
-
Yes, it does happen on my workstation where I'm doing the development (ThinkPad Laptop). I have also just executed it on a different machine at work and there the error does not come up. I've also noticed that none of my debug outputs are coming out there, so it might be connected to that. However, I can't change anything on those machines since our IT is very restrictive with what we can do on these machines.
-
Are you also styling the QSplitter content ?
-
@SGaist the QSplitter has a QTreeWidget and a QWidget for the content which consists itself of a QLabel and a QStackedWidget (Headline and content). I do style the QTreeWidget and the items as well as the content widgets. But I don't have any styling on the QSplitter itself.