Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15.2
-
None
Description
To solve the problem of QTBUG-86580, the currentText was changed but the target of the placeHolderText was also affected as it is no longer visible. One possible solution is to change to:
void QComboBox::initStyleOption(QStyleOptionComboBox *option) const { if (!option) return; Q_D(const QComboBox); option->initFrom(this); option->editable = isEditable(); option->frame = d->frame; if (hasFocus() && !option->editable) option->state |= QStyle::State_Selected; option->subControls = QStyle::SC_All; if (d->arrowState == QStyle::State_Sunken) { option->activeSubControls = QStyle::SC_ComboBoxArrow; option->state |= d->arrowState; } else { option->activeSubControls = d->hoverControl; } if (d->currentIndex.isValid()){ option->currentText = currentText(); option->currentIcon = d->itemIcon(d->currentIndex); } else{ if(!d->placeholderText.isEmpty()){ option->currentText = d->placeholderText; } } option->iconSize = iconSize(); if (d->container && d->container->isVisible()) option->state |= QStyle::State_On; }
Attachments
Issue Links
- duplicates
-
QTBUG-90595 QCombobox placeholderText not visible
- Closed