Changeset 78997 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jun 5, 2019 2:22:48 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.cpp
r78954 r78997 149 149 /** Constructs null ranged-integer data. */ 150 150 RangedIntegerData() 151 : m_iMinimum(-1), m_iMaximum(-1), m_iInteger(-1) {} 152 /** Constructs ranged-integer data on the basis of passed @a iMinimum, @a iMaximum and @a iInteger. */ 153 RangedIntegerData(int iMinimum, int iMaximum, int iInteger) 154 : m_iMinimum(iMinimum), m_iMaximum(iMaximum), m_iInteger(iInteger) {} 151 : m_iMinimum(-1), m_iMaximum(-1) 152 , m_iInteger(-1), m_strSuffix(QString()) {} 153 /** Constructs ranged-integer data on the basis of passed @a iMinimum, @a iMaximum, @a iInteger and @a strSuffix. */ 154 RangedIntegerData(int iMinimum, int iMaximum, int iInteger, const QString strSuffix) 155 : m_iMinimum(iMinimum), m_iMaximum(iMaximum) 156 , m_iInteger(iInteger), m_strSuffix(strSuffix) {} 155 157 /** Constructs ranged-integer data on the basis of @a another ranged-integer data. */ 156 158 RangedIntegerData(const RangedIntegerData &another) 157 : m_iMinimum(another.minimum()), m_iMaximum(another.maximum()), m_iInteger(another.integer()) {} 159 : m_iMinimum(another.minimum()), m_iMaximum(another.maximum()) 160 , m_iInteger(another.integer()), m_strSuffix(another.suffix()) {} 158 161 159 162 /** Assigns values of @a another ranged-integer to this one. */ … … 163 166 m_iMaximum = another.maximum(); 164 167 m_iInteger = another.integer(); 168 m_strSuffix = another.suffix(); 165 169 return *this; 166 170 } … … 172 176 /** Returns current value. */ 173 177 int integer() const { return m_iInteger; } 178 /** Returns suffix value. */ 179 QString suffix() const { return m_strSuffix; } 174 180 175 181 private: 176 182 177 183 /** Holds minimum value. */ 178 int m_iMinimum;184 int m_iMinimum; 179 185 /** Holds maximum value. */ 180 int m_iMaximum;186 int m_iMaximum; 181 187 /** Holds current value. */ 182 int m_iInteger; 188 int m_iInteger; 189 /** Holds suffix value. */ 190 QString m_strSuffix; 183 191 }; 184 192 Q_DECLARE_METATYPE(RangedIntegerData); … … 594 602 setMaximum(rangedInteger.maximum()); 595 603 setValue(rangedInteger.integer()); 604 setSuffix(QString(" %1").arg(QApplication::translate("VBoxGlobal", rangedInteger.suffix().toUtf8().constData()))); 596 605 } 597 606 598 607 RangedIntegerData RangedIntegerEditor::rangedInteger() const 599 608 { 600 return RangedIntegerData(minimum(), maximum(), value() );609 return RangedIntegerData(minimum(), maximum(), value(), suffix()); 601 610 } 602 611 … … 856 865 const int iMaximum = comValue.GetMaximum(); 857 866 const int iInteger = comValue.GetInteger(); 858 m_rangedInteger = RangedIntegerData(iMinimum, iMaximum, iInteger); 867 const QString strSuffix = comValue.GetSuffix(); 868 m_rangedInteger = RangedIntegerData(iMinimum, iMaximum, iInteger, strSuffix); 859 869 m_cells[UIFormEditorDataType_Value]->setText(QString::number(m_rangedInteger.integer())); 860 870 /// @todo check for errors
Note:
See TracChangeset
for help on using the changeset viewer.