VirtualBox

Ignore:
Timestamp:
Feb 9, 2012 9:12:30 AM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 6073: Switch VirtualBox wizards into new QIRichTextLabel: Summary fields.

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  
    3131#include <math.h>
    3232
    33 QIWizard::QIWizard(QWidget *pParent) : QIWithRetranslateUI<QWizard>(pParent)
     33QIWizard::QIWizard(QWidget *pParent)
     34    : QIWithRetranslateUI<QWizard>(pParent)
     35    , m_iMinimumContentWidth(0)
    3436{
    3537#ifdef Q_WS_MAC
     
    5355    int iNewLabelWidth = iGoldRatioWidth - iLabelDelta;
    5456    resizeAccordingLabelWidth(iNewLabelWidth);
     57    m_iMinimumContentWidth = iNewLabelWidth;
    5558}
    5659
     
    182185}
    183186
    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 
    192187QString QIWizardPage::standardHelpText() const
    193188{
     
    217212}
    218213
     214QIWizard* QIWizardPage::wizard() const
     215{
     216    return qobject_cast<QIWizard*>(QWizardPage::wizard());
     217}
     218
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIWizard.h

    r35234 r40044  
    3737    QIWizard(QWidget *pParent);
    3838
     39    int minimumContentWidth() const { return m_iMinimumContentWidth; }
     40
    3941protected:
    4042
     
    4850
    4951    void resizeAccordingLabelWidth(int iLabelWidth);
     52
     53    int m_iMinimumContentWidth;
    5054};
    5155
     
    6569protected:
    6670
    67     static void setSummaryFieldLinesNumber(QTextEdit *pSummaryField, int iNumber);
    68 
    6971    QString standardHelpText() const;
    7072
    7173    void startProcessing();
    7274    void endProcessing();
     75
     76    QIWizard* wizard() const;
    7377
    7478private:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzd.cpp

    r39593 r40044  
    242242    /* Register 'machine' field */
    243243    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);
    249244}
    250245
     
    286281    ;
    287282
     283    m_pSummaryText->setMinimumTextWidth(wizard()->minimumContentWidth());
    288284    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>");
    289285}
     
    294290    retranslateUi();
    295291
    296     /* Update summary geometry: */
    297     m_pSummaryText->updateGeometry();
    298292    /* Summary should initially have focus */
    299293    m_pSummaryText->setFocus();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/firstrun/UIFirstRunWzdPage3.ui

    r39593 r40044  
    5555   </item>
    5656   <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"/>
    7758   </item>
    7859   <item>
     
    11899  </customwidget>
    119100  <customwidget>
    120    <class>QITextEdit</class>
    121    <extends>QTextEdit</extends>
    122    <header>QITextEdit.h</header>
     101   <class>QIRichTextLabel</class>
     102   <extends>QWidget</extends>
     103   <header>QIRichTextLabel.h</header>
    123104  </customwidget>
    124105 </customwidgets>
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizard.cpp

    r39593 r40044  
    948948    /* Register 'hardDisk' field: */
    949949    registerField("hardDisk", this, "hardDisk");
    950 
    951     /* Disable the background painting of the summary widget: */
    952     m_pSummaryText->viewport()->setAutoFillBackground(false);
    953950}
    954951
     
    996993    .arg(UINewHDWizard::tr("Size", "summary"), sizeFormatted, sizeUnformatted);
    997994
     995    m_pSummaryText->setMinimumTextWidth(wizard()->minimumContentWidth());
    998996    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + strSummary + "</table>");
    999997}
     
    10041002    retranslateUi();
    10051003
    1006     /* Update summary geometry: */
    1007     m_pSummaryText->updateGeometry();
    10081004    /* Summary should have focus initially: */
    10091005    m_pSummaryText->setFocus();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newhd/UINewHDWizardPageSummary.ui

    r39593 r40044  
    4242   </item>
    4343   <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"/>
    6445   </item>
    6546   <item>
     
    8970  </customwidget>
    9071  <customwidget>
    91    <class>QITextEdit</class>
    92    <extends>QTextEdit</extends>
    93    <header>QITextEdit.h</header>
     72   <class>QIRichTextLabel</class>
     73   <extends>QWidget</extends>
     74   <header>QIRichTextLabel.h</header>
    9475  </customwidget>
    9576 </customwidgets>
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzd.cpp

    r39919 r40044  
    640640    /* Register 'machine' field */
    641641    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);
    647642}
    648643
     
    682677    }
    683678
     679    m_pSummaryText->setMinimumTextWidth(wizard()->minimumContentWidth());
    684680    m_pSummaryText->setText("<table cellspacing=0 cellpadding=0>" + summary + "</table>");
    685681
     
    697693    retranslateUi();
    698694
    699     /* Update summary geometry: */
    700     m_pSummaryText->updateGeometry();
    701695    /* Summary should have focus initially */
    702696    m_pSummaryText->setFocus();
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UINewVMWzdPage5.ui

    r39593 r40044  
    5151   </item>
    5252   <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"/>
    6754   </item>
    6855   <item>
     
    9279  </customwidget>
    9380  <customwidget>
    94    <class>QITextEdit</class>
    95    <extends>QTextEdit</extends>
    96    <header>QITextEdit.h</header>
     81   <class>QIRichTextLabel</class>
     82   <extends>QWidget</extends>
     83   <header>QIRichTextLabel.h</header>
    9784  </customwidget>
    9885 </customwidgets>
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