Changeset 40044 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 9, 2012 9:12:30 AM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.cpp
r35234 r40044 31 31 #include <math.h> 32 32 33 QIWizard::QIWizard(QWidget *pParent) : QIWithRetranslateUI<QWizard>(pParent) 33 QIWizard::QIWizard(QWidget *pParent) 34 : QIWithRetranslateUI<QWizard>(pParent) 35 , m_iMinimumContentWidth(0) 34 36 { 35 37 #ifdef Q_WS_MAC … … 53 55 int iNewLabelWidth = iGoldRatioWidth - iLabelDelta; 54 56 resizeAccordingLabelWidth(iNewLabelWidth); 57 m_iMinimumContentWidth = iNewLabelWidth; 55 58 } 56 59 … … 182 185 } 183 186 184 void QIWizardPage::setSummaryFieldLinesNumber(QTextEdit *pSummaryField, int iNumber)185 {186 /* Set the minimum height for the <pSummaryField> to <iNumber> lines of text including text margins */187 int lineHeight = pSummaryField->fontMetrics().height();188 int textMargin = 4; /* QTextDocument::documentMargin() returns '4' but available only since Qt 4.5 */189 pSummaryField->setFixedHeight(lineHeight * iNumber + textMargin * 2);190 }191 192 187 QString QIWizardPage::standardHelpText() const 193 188 { … … 217 212 } 218 213 214 QIWizard* QIWizardPage::wizard() const 215 { 216 return qobject_cast<QIWizard*>(QWizardPage::wizard()); 217 } 218 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h
r35234 r40044 37 37 QIWizard(QWidget *pParent); 38 38 39 int minimumContentWidth() const { return m_iMinimumContentWidth; } 40 39 41 protected: 40 42 … … 48 50 49 51 void resizeAccordingLabelWidth(int iLabelWidth); 52 53 int m_iMinimumContentWidth; 50 54 }; 51 55 … … 65 69 protected: 66 70 67 static void setSummaryFieldLinesNumber(QTextEdit *pSummaryField, int iNumber);68 69 71 QString standardHelpText() const; 70 72 71 73 void startProcessing(); 72 74 void endProcessing(); 75 76 QIWizard* wizard() const; 73 77 74 78 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp
r39593 r40044 242 242 /* Register 'machine' field */ 243 243 registerField("machine", this, "machine"); 244 245 /* Disable the background painting of the summary widget */246 m_pSummaryText->viewport()->setAutoFillBackground(false);247 /* Make the summary field read-only */248 m_pSummaryText->setReadOnly(true);249 244 } 250 245 … … 286 281 ; 287 282 283 m_pSummaryText->setMinimumTextWidth(wizard()->minimumContentWidth()); 288 284 m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>"); 289 285 } … … 294 290 retranslateUi(); 295 291 296 /* Update summary geometry: */297 m_pSummaryText->updateGeometry();298 292 /* Summary should initially have focus */ 299 293 m_pSummaryText->setFocus(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage3.ui
r39593 r40044 55 55 </item> 56 56 <item> 57 <widget class="QITextEdit" name="m_pSummaryText"> 58 <property name="sizePolicy"> 59 <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> 60 <horstretch>0</horstretch> 61 <verstretch>0</verstretch> 62 </sizepolicy> 63 </property> 64 <property name="minimumSize"> 65 <size> 66 <width>300</width> 67 <height>0</height> 68 </size> 69 </property> 70 <property name="frameShape"> 71 <enum>QFrame::NoFrame</enum> 72 </property> 73 <property name="readOnly"> 74 <bool>true</bool> 75 </property> 76 </widget> 57 <widget class="QIRichTextLabel" name="m_pSummaryText"/> 77 58 </item> 78 59 <item> … … 118 99 </customwidget> 119 100 <customwidget> 120 <class>QI TextEdit</class>121 <extends>Q TextEdit</extends>122 <header>QI TextEdit.h</header>101 <class>QIRichTextLabel</class> 102 <extends>QWidget</extends> 103 <header>QIRichTextLabel.h</header> 123 104 </customwidget> 124 105 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp
r39593 r40044 948 948 /* Register 'hardDisk' field: */ 949 949 registerField("hardDisk", this, "hardDisk"); 950 951 /* Disable the background painting of the summary widget: */952 m_pSummaryText->viewport()->setAutoFillBackground(false);953 950 } 954 951 … … 996 993 .arg(UINewHDWizard::tr("Size", "summary"), sizeFormatted, sizeUnformatted); 997 994 995 m_pSummaryText->setMinimumTextWidth(wizard()->minimumContentWidth()); 998 996 m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + strSummary + "</table>"); 999 997 } … … 1004 1002 retranslateUi(); 1005 1003 1006 /* Update summary geometry: */1007 m_pSummaryText->updateGeometry();1008 1004 /* Summary should have focus initially: */ 1009 1005 m_pSummaryText->setFocus(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageSummary.ui
r39593 r40044 42 42 </item> 43 43 <item> 44 <widget class="QITextEdit" name="m_pSummaryText"> 45 <property name="sizePolicy"> 46 <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> 47 <horstretch>0</horstretch> 48 <verstretch>0</verstretch> 49 </sizepolicy> 50 </property> 51 <property name="minimumSize"> 52 <size> 53 <width>300</width> 54 <height>0</height> 55 </size> 56 </property> 57 <property name="frameShape"> 58 <enum>QFrame::NoFrame</enum> 59 </property> 60 <property name="readOnly"> 61 <bool>true</bool> 62 </property> 63 </widget> 44 <widget class="QIRichTextLabel" name="m_pSummaryText"/> 64 45 </item> 65 46 <item> … … 89 70 </customwidget> 90 71 <customwidget> 91 <class>QI TextEdit</class>92 <extends>Q TextEdit</extends>93 <header>QI TextEdit.h</header>72 <class>QIRichTextLabel</class> 73 <extends>QWidget</extends> 74 <header>QIRichTextLabel.h</header> 94 75 </customwidget> 95 76 </customwidgets> -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp
r39919 r40044 640 640 /* Register 'machine' field */ 641 641 registerField("machine", this, "machine"); 642 643 /* Disable the background painting of the summary widget */644 m_pSummaryText->viewport()->setAutoFillBackground (false);645 /* Make the summary field read-only */646 m_pSummaryText->setReadOnly (true);647 642 } 648 643 … … 682 677 } 683 678 679 m_pSummaryText->setMinimumTextWidth(wizard()->minimumContentWidth()); 684 680 m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>"); 685 681 … … 697 693 retranslateUi(); 698 694 699 /* Update summary geometry: */700 m_pSummaryText->updateGeometry();701 695 /* Summary should have focus initially */ 702 696 m_pSummaryText->setFocus(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage5.ui
r39593 r40044 51 51 </item> 52 52 <item> 53 <widget class="QITextEdit" name="m_pSummaryText"> 54 <property name="sizePolicy"> 55 <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> 56 <horstretch>0</horstretch> 57 <verstretch>0</verstretch> 58 </sizepolicy> 59 </property> 60 <property name="frameShape"> 61 <enum>QFrame::NoFrame</enum> 62 </property> 63 <property name="readOnly"> 64 <bool>true</bool> 65 </property> 66 </widget> 53 <widget class="QIRichTextLabel" name="m_pSummaryText"/> 67 54 </item> 68 55 <item> … … 92 79 </customwidget> 93 80 <customwidget> 94 <class>QI TextEdit</class>95 <extends>Q TextEdit</extends>96 <header>QI TextEdit.h</header>81 <class>QIRichTextLabel</class> 82 <extends>QWidget</extends> 83 <header>QIRichTextLabel.h</header> 97 84 </customwidget> 98 85 </customwidgets>
Note:
See TracChangeset
for help on using the changeset viewer.