VirtualBox

Ignore:
Timestamp:
Sep 10, 2024 11:35:42 AM (5 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164748
Message:

FE/Qt: bugref:10681: Get rid of QIComboBox dependencies for UIFilePathSelector widget; It's no more required for QComboBox accessibility support.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINameAndSystemEditor.cpp

    r105525 r106002  
    457457            if (m_pSelectorPath)
    458458            {
    459                 m_pLabelPath->setBuddy(m_pSelectorPath->focusProxy());
     459                m_pLabelPath->setBuddy(m_pSelectorPath);
    460460                QString strDefaultMachineFolder = gpGlobalSession->virtualBox().GetSystemProperties().GetDefaultMachineFolder();
    461461                m_pSelectorPath->setPath(strDefaultMachineFolder);
     
    480480            if (m_pSelectorImage)
    481481            {
    482                 m_pLabelImage->setBuddy(m_pSelectorImage->focusProxy());
     482                m_pLabelImage->setBuddy(m_pSelectorImage);
    483483                m_pSelectorImage->setResetEnabled(false);
    484484                m_pSelectorImage->setMode(UIFilePathSelector::Mode_File_Open);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIRecordingSettingsEditor.cpp

    r105120 r106002  
    512512                {
    513513                    if (m_pLabelFilePath)
    514                         m_pLabelFilePath->setBuddy(m_pEditorFilePath->focusProxy());
     514                        m_pLabelFilePath->setBuddy(m_pEditorFilePath);
    515515                    m_pEditorFilePath->setEditable(false);
    516516                    m_pEditorFilePath->setMode(UIFilePathSelector::Mode_File_Save);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.cpp

    r104899 r106002  
    6969
    7070UIFilePathSelector::UIFilePathSelector(QWidget *pParent /* = 0 */)
    71     : QIComboBox(pParent)
     71    : QComboBox(pParent)
    7272    , m_enmMode(Mode_Folder)
    7373    , m_strInitialPath(QDir::current().absolutePath())
     
    139139    if (m_fEditable)
    140140    {
    141         QIComboBox::setEditable(true);
     141        /* Call to base-class: */
     142        QComboBox::setEditable(true);
    142143
    143144        /* Install combo-box event-filter: */
    144         Assert(comboBox());
    145         comboBox()->installEventFilter(this);
     145        this->installEventFilter(this);
     146
     147        /* Configure a type of line-edit: */
     148        setLineEdit(new QILineEdit);
    146149
    147150        /* Install line-edit connection/event-filter: */
     
    160163                       this, &UIFilePathSelector::onTextEdited);
    161164        }
    162         if (comboBox())
    163         {
    164             /* Remove combo-box event-filter: */
    165             comboBox()->removeEventFilter(this);
    166         }
    167         QIComboBox::setEditable(false);
    168     }
     165
     166        /* Remove combo-box event-filter: */
     167        this->removeEventFilter(this);
     168
     169        /* Call to base-class: */
     170        QComboBox::setEditable(false);
     171    }
     172}
     173
     174void UIFilePathSelector::setMarkable(bool fMarkable)
     175{
     176    QILineEdit *pLineEdit = isEditable() ? qobject_cast<QILineEdit*>(lineEdit()) : 0;
     177    if (pLineEdit)
     178        pLineEdit->setMarkable(fMarkable);
     179}
     180
     181void UIFilePathSelector::mark(bool fError, const QString &strErrorMessage, const QString &strNoErrorMessage)
     182{
     183    QILineEdit *pLineEdit = isEditable() ? qobject_cast<QILineEdit*>(lineEdit()) : 0;
     184    setMarkable(true);
     185    if (pLineEdit)
     186        pLineEdit->mark(fError, strErrorMessage, strNoErrorMessage);
    169187}
    170188
     
    202220{
    203221    /* Call to base-class: */
    204     QIComboBox::setToolTip(strToolTip);
     222    QComboBox::setToolTip(strToolTip);
    205223
    206224    /* Remember if the tool-tip overriden: */
     
    244262{
    245263    /* If the object is private combo-box: */
    246     if (pObject == comboBox())
     264    if (pObject == this)
    247265    {
    248266        /* Handle focus events related to private child: */
     
    263281
    264282    /* Call to base-class: */
    265     return QIComboBox::eventFilter(pObject, pEvent);
     283    return QComboBox::eventFilter(pObject, pEvent);
    266284}
    267285
    268286void UIFilePathSelector::resizeEvent(QResizeEvent *pEvent)
    269287{
    270     QIComboBox::resizeEvent(pEvent);
     288    QComboBox::resizeEvent(pEvent);
    271289    refreshText();
    272290}
     
    283301            refreshText();
    284302    }
    285     QIComboBox::focusInEvent(pEvent);
     303    QComboBox::focusInEvent(pEvent);
    286304}
    287305
     
    293311        refreshText();
    294312    }
    295     QIComboBox::focusOutEvent(pEvent);
     313    QComboBox::focusOutEvent(pEvent);
    296314}
    297315
     
    561579        /* Set the tool-tip: */
    562580        if (!m_fToolTipOverriden)
    563             QIComboBox::setToolTip(fullPath());
     581            QComboBox::setToolTip(fullPath());
    564582        setItemData(PathId, toolTip(), Qt::ToolTipRole);
    565583
     
    591609            /* Set the tool-tip: */
    592610            if (!m_fToolTipOverriden)
    593                 QIComboBox::setToolTip(m_strNoneToolTip);
     611                QComboBox::setToolTip(m_strNoneToolTip);
    594612            setItemData(PathId, toolTip(), Qt::ToolTipRole);
    595613        }
     
    611629        /* Set the tool-tip: */
    612630        if (!m_fToolTipOverriden)
    613             QIComboBox::setToolTip(fullPath());
     631            QComboBox::setToolTip(fullPath());
    614632        setItemData(PathId, toolTip(), Qt::ToolTipRole);
    615633    }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFilePathSelector.h

    r104358 r106002  
    3232#endif
    3333
     34/* Qt includes: */
     35#include <QComboBox>
     36
    3437/* GUI includes: */
    35 #include "QIComboBox.h"
    3638#include "UILibraryDefs.h"
    3739#include "UIMediumDefs.h"
     
    4951class QIToolButton;
    5052
    51 /** QIComboBox subclass providing GUI with the
     53/** QComboBox subclass providing GUI with the
    5254  * possibility to choose/reflect file/folder path. */
    53 class SHARED_LIBRARY_STUFF UIFilePathSelector : public QIComboBox
     55class SHARED_LIBRARY_STUFF UIFilePathSelector : public QComboBox
    5456{
    5557    Q_OBJECT;
     
    7880    };
    7981
    80     /** Constructs file-path selector passing @a pParent to QIComboBox base-class. */
     82    /** Constructs file-path selector passing @a pParent to QComboBox base-class. */
    8183    UIFilePathSelector(QWidget *pParent = 0);
    8284
     
    9092    /** Returns whether the path is editable. */
    9193    bool isEditable() const { return m_fEditable; }
     94    /** Calls QILineEdit member's setMarkable API. */
     95    void setMarkable(bool fMarkable);
     96    /** Marks the line edit of the combobox. Refer to QILineEdit::mark(..). */
     97    void mark(bool fError, const QString &strErrorMessage, const QString &strNoErrorMessage);
    9298
    9399    /** Defines whether the reseting to defauilt path is @a fEnabled. */
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