VirtualBox

Changeset 87898 in vbox


Ignore:
Timestamp:
Mar 1, 2021 11:23:42 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: QIComboBox: A fix for r142789, no line-edit for non-editable combo-box.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIComboBox.cpp

    r87737 r87898  
    307307{
    308308    AssertPtrReturnVoid(m_pComboBox);
    309     QILineEdit *pLineEdit = qobject_cast<QILineEdit*>(m_pComboBox->lineEdit());
    310     AssertPtrReturnVoid(pLineEdit);
    311     pLineEdit->mark(fError, strErrorMessage);
     309    QILineEdit *pLineEdit = isEditable() ? qobject_cast<QILineEdit*>(m_pComboBox->lineEdit()) : 0;
     310    if (pLineEdit)
     311        pLineEdit->mark(fError, strErrorMessage);
    312312}
    313313
     
    338338    AssertPtrReturnVoid(m_pComboBox);
    339339    m_pComboBox->setEditable(fEditable);
     340
     341    /* Replace the line-edit so that we can mark errors: */
     342    if (isEditable())
     343        m_pComboBox->setLineEdit(new QILineEdit);
    340344}
    341345
     
    385389        AssertPtrReturnVoid(m_pComboBox);
    386390        {
    387             /* Replace the line edit of the combox box so that we can mark it for errors: */
    388             QILineEdit *pLineEdit = new QILineEdit;
    389             m_pComboBox->setLineEdit(pLineEdit);
    390391            /* Configure combo-box: */
    391392            setFocusProxy(m_pComboBox);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette