VirtualBox

Changeset 78167 in vbox


Ignore:
Timestamp:
Apr 17, 2019 2:57:04 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130082
Message:

FE/Qt: bugref:9434: Import Appliance wizard: Form Editor widget: A bit of cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIFormEditorWidget.cpp

    r78143 r78167  
    4949
    5050
     51/** Class used to hold choice data. */
     52class ChoiceData
     53{
     54public:
     55
     56    /** Constructs null choice data. */
     57    ChoiceData() {}
     58    /** Constructs choice data on the basis of passed @a choices and @a iSelectedChoice. */
     59    ChoiceData(const QVector<QString> &choices, int iSelectedChoice)
     60        : m_choices(choices), m_iSelectedChoice(iSelectedChoice) {}
     61
     62    /** Returns choice list. */
     63    QVector<QString> choices() const { return m_choices; }
     64    /** Returns current selected choice. */
     65    int selectedChoice() const { return m_iSelectedChoice; }
     66
     67private:
     68
     69    /** Holds choice list. */
     70    QVector<QString>  m_choices;
     71    /** Holds current selected choice. */
     72    int               m_iSelectedChoice;
     73};
     74Q_DECLARE_METATYPE(ChoiceData);
     75
     76
    5177/** QComboBox extension used as Port editor. */
    5278class ChoiceEditor : public QComboBox
     
    391417            return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
    392418        case UIFormEditorDataType_Value:
    393             return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
     419            return   m_dataList[index.row()]->valueType() != KFormValueType_Boolean
     420                   ? Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable
     421                   : Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable;
    394422        default:
    395423            return Qt::NoItemFlags;
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIFormEditorWidget.h

    r78143 r78167  
    2929class UIFormEditorView;
    3030class CVirtualSystemDescriptionForm;
    31 
    32 
    33 /** Class used to hold choice data. */
    34 class ChoiceData
    35 {
    36 public:
    37 
    38     /** Constructs null choice data. */
    39     ChoiceData() {}
    40     /** Constructs choice data on the basis of passed @a choices and @a iSelectedChoice. */
    41     ChoiceData(const QVector<QString> &choices, int iSelectedChoice)
    42         : m_choices(choices), m_iSelectedChoice(iSelectedChoice) {}
    43 
    44     /** Returns choice list. */
    45     QVector<QString> choices() const { return m_choices; }
    46     /** Returns current selected choice. */
    47     int selectedChoice() const { return m_iSelectedChoice; }
    48 
    49 private:
    50 
    51     /** Holds choice list. */
    52     QVector<QString>  m_choices;
    53     /** Holds current selected choice. */
    54     int               m_iSelectedChoice;
    55 };
    56 Q_DECLARE_METATYPE(ChoiceData);
    57 
    5831
    5932/** QWidget subclass representing model/view Form Editor widget. */
     
    9265typedef QPointer<UIFormEditorWidget> UIFormEditorWidgetPointer;
    9366
    94 
    9567#endif /* !FEQT_INCLUDED_SRC_wizards_importappliance_UIFormEditorWidget_h */
Note: See TracChangeset for help on using the changeset viewer.

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