8
votes

Environment

  • Built under OS X 10.6.8 (works fine there, too.)
  • Application running under OS X 10.12
  • Qt 4.7 (have to use this, 10.6.8 legacy support issues)
  • Qt Creator 2.1.0

Issue

From OS X 10.6.8 through OS X 10.11, tooltips and QComboBox pop-up menu behaviors are fine.

Under 10.12, tooltips and the pop-up feature of QComboBox pop up menus are blank.

The tooltips are blank yellow sheets, the backdrop looks right, but no text. I'm setting the tooltip content in Qt Designer 2; nothing fancy going on there. And it's just vanilla text in every case.

The QComboBox pop up menus are missing both the text and the checkmark. When the popup is closed, so the widget just shows the one line, the selected item does show. You can also point at it, roll the mouse roller, and the items change as expected. It's just the popup list of items that's blank.

For the QComboBox pop-up menu, here's an example of use that has the problem:

int index;
ui->fftSizecomboBox->addItem("2048 pts",  2048);
ui->fftSizecomboBox->addItem("4096 pts",  2048 * 2);
ui->fftSizecomboBox->addItem("8192 pts",  2048 * 4);
ui->fftSizecomboBox->addItem("16384 pts", 2048 * 8);
ui->fftSizecomboBox->addItem("32768 pts", 2048 * 16);
ui->fftSizecomboBox->addItem("64K pts",   2048 * 32);
ui->fftSizecomboBox->addItem("128K pts",  2048 * 64);
ui->fftSizecomboBox->addItem("256K pts",  2048 * 128);
ui->fftSizecomboBox->addItem("512K pts",  2048 * 256);
ui->fftSizecomboBox->addItem("1M pts",    2048 * 512);
ui->fftSizecomboBox->addItem("2M pts",    2048 * 1024);
ui->fftSizecomboBox->addItem("4M pts",    2048 * 2048);
index = ui->fftSizecomboBox->findData(m_FftSize);
if ((index < 0) || (index > 11))
{
    index = 1;
    m_FftSize = 4096;
}
ui->fftSizecomboBox->setCurrentIndex(index);

It all seems pretty vanilla to me. I'm at a loss as to why it works under all the other OS X versions and balks under 10.12

Furthermore, in another app I wrote, I also use QComboBox popup menus, and they work under 10.12 in that app, so that also implies it's something I'm doing.

Other than just clicking on the popup menu to make it show the list of items, nothing happens to it. I don't even catch any messages from it; when I exit the dialog, then I look at it to see what the selection is (or I don't even do that, if the dialog has been cancelled.)

I submitted a bug report to Apple, which they have ignored for months, so either they don't care, or don't think it's their problem (and I'm guessing it probably isn't, even though it's only showing up in OS X 10.12) Of course, Apple often leaves bugs in the OS, so there's that.

[EDIT 1]

Something else I tried, to see if it was a palette color issue, was to load one of the tooltips with rich text, changing the font color, so that the painting wouldn't be done just using the palette colors. Worked under 10.6, but under 10.12, made no difference; tooltip was just as blank. Also, I see that the tooltip background color isn't the pale yellow it's supposed to be either -- it's white.

It's like the system has completely lost track of what it's supposed to be doing once the tooltip / popupmenu comes up.

[EDIT 2]

Here's the stylesheet code I am using for the QComboBox:

QComboBox::dropdown {
background: rgb(0,0,127);
color: rgb(0,255,0); /* color of dropped text*/
background-color: rgb(0,0,127); /* color of dropped backdrop*/
selection-color: rgb(0,255,0); /* color of sel text */
selection-background-color: rgb(0,0,0); /* color of sel backdrop */
}

QComboBox {
color: rgb(0,255,0); /* color of dropped text*/
background-color: rgb(0,0,0); /* color of dropped backdrop*/
selection-color: rgb(0,255,0); /* color of sel text */
selection-background-color: rgb(0,0,0); /* color of sel backdrop */
alternate-background-color: rgb(0,0,127);
alternate-selection=background-color: rgb(255,255,255);
}

This stylesheet does exactly the right thing under 10.6.8. Under 10.12, the main combo box renders correctly, green text on a black background, but the popup/dropdown is pure white, no text; it should be green on a mid-blue (127.) There's no selection color or visible reaction either, graphically, other than the correct (invisible) item being chosen and the popup menu going away.

1
"I submitted a bug report to Apple" you might be "barking up the wrong tree". Qt doesn't use apple's nativ gui elements, it just mimics them with its own stuff. You are using an old version of Qt on a new OS, so my money is on Qt having to catch up with platform support.dtech
right; I don't think it's apple, particularly. AND tooltips works in a test application, same build sequence: built under 10.6, works under 10.12. So my guess is I am stepping on something or otherwise doing bad things. But I can't imagine what, or why. And tooltips are very opaque things in qt. They use background roles of palettes.... nothing so vanilla as actually being able to set a color.fyngyrz
For now I'd focus on trying to reproduce it in a test application, as simple as possible. Focus on what's different between the non-working production code and the working test code. It will be GUI stuff most likely, for example modal windows, multi windows, dialogs and such. As soon as you are able to reproduce it you will either know what goes wrong, or at the very least you will have the basis for a solid bug report. Not that there is guarantee it will be fixed any time soon or every but still, unless you can find a workaround, that's pretty much it.dtech
It may be you, it may be just how things stack together in actual production code. Bugs often need specific conditions to manifest and sometimes defy all logic. Like just the other day I found a bug where you simply move a line in a source that shouldn't have any effect on the application, just for the sake of formatting the code better, resulting in total destruction of the GUI.dtech
I don't have an answer to this question, but if you really want to figure out it, don't forget that you can build Qt from source and then debug the Qt source (either via a debugger or by inserting printf's/etc into the Qt source code). If I was debugging this I would start by looking at QTipLabel::paintEvent() method inside qtbase/src/widgets/kernel/qtooltip.cpp, and then look at the Style::PE_PanelTipLabel code that it calls down to.Jeremy Friesner

1 Answers

0
votes

Due to the fact that your Qt version is outdated it may be that the "native" rendering engine is broken. You can avoid this issue by using the "raster" rendering engine instead

http://doc.qt.io/qt-4.8/qapplication.html#setGraphicsSystem