VirtualBox

Changeset 81074 in vbox


Ignore:
Timestamp:
Sep 30, 2019 11:18:49 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133678
Message:

FE/Qt: bugref:9510. Some table improvement

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationConfiguration.cpp

    r80989 r81074  
    140140    m_pTableWidget->setColumnWidth(1, 1.5 * iMaxColumn1Length);
    141141    m_pTableWidget->resizeColumnToContents(2);
     142    m_pTableWidget->horizontalHeader()->setStretchLastSection(true);
    142143}
    143144
     
    155156        /* Configure the table by hiding the headers etc.: */
    156157        m_pTableWidget->setColumnCount(m_iColumCount);
     158        m_pTableWidget->setAlternatingRowColors(true);
    157159        m_pTableWidget->verticalHeader()->hide();
    158160        m_pTableWidget->horizontalHeader()->hide();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r81000 r81074  
    126126    int m_iMinimumWidth;
    127127    QVector<QString> m_screenResolutions;
     128    QVector<QString*> m_labels;
    128129    QTimer *m_pTimer;
    129130};
     
    159160    }
    160161
     162    m_labels << &m_strScreenResolutionLabel
     163             << &m_strUptimeLabel
     164             << &m_strDragAndDropLabel
     165             << &m_strExcutionEngineLabel
     166             << &m_strNestedPagingLabel
     167             << &m_strUnrestrictedExecutionLabel
     168             << &m_strParavirtualizationLabel
     169             << &m_strGuestAdditionsLabel
     170             << &m_strGuestOSTypeLabel
     171             << &m_strRemoteDesktopLabel;
     172
     173
    161174    retranslateUi();
    162175    computeMinimumWidth();
     
    165178void UIRuntimeInfoWidget::retranslateUi()
    166179{
     180
    167181    m_strTableTitle = QApplication::translate("UIVMInformationDialog", "Runtime Attributes");
    168182    m_strScreenResolutionLabel = QApplication::translate("UIVMInformationDialog", "Screen Resolution");
     
    184198    m_strNotDetected = QApplication::translate("UIVMInformationDialog", "Not Detected");
    185199
     200    QString* strLongest = 0;
     201    foreach (QString *strLabel, m_labels)
     202    {
     203        if (!strLongest)
     204            strLongest = strLabel;
     205        if (strLabel && strLongest->length() < strLabel->length())
     206            strLongest = strLabel;
     207    }
     208    QFontMetrics fontMetrics(font());
     209    setColumnWidth(0, 1.5 * fontMetrics.width(*strLongest));
     210
    186211    /* Make the API calls and populate the table: */
    187212    createInfoRows();
     
    267292    }
    268293    resizeColumnToContents(1);
     294    horizontalHeader()->setStretchLastSection(true);
    269295}
    270296
     
    415441    insertInfoRow(InfoRow_GuestOSType, QString("%1:").arg(m_strGuestOSTypeLabel), strOSType);
    416442    updateVRDE();
    417 
    418     resizeColumnToContents(0);
    419443    resizeColumnToContents(1);
    420444}
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r80999 r81074  
    247247        }
    248248
    249 
    250249        /* Create Guest Process Control tab: */
    251250        QString strMachineName;
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