VirtualBox

儲存庫 vbox 的更動 65329


忽略:
時間撮記:
2017-1-16 下午01:32:36 (8 年 以前)
作者:
vboxsync
訊息:

FE/Qt: bugref:6899: Accessibility support (step 176): A bit of care for UIInformationItem: Refactoring.

位置:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.cpp

    r65328 r65329  
    2121
    2222/* Qt includes: */
     23# include <QApplication>
    2324# include <QPainter>
    24 # include <QApplication>
    25 # include <QAbstractTextDocumentLayout>
    2625# include <QTextDocument>
    2726# include <QUrl>
    2827
    2928/* GUI includes: */
     29# include "VBoxGlobal.h"
    3030# include "UIIconPool.h"
    3131# include "UIInformationItem.h"
    32 # include "VBoxGlobal.h"
    3332
    3433#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
     
    6261}
    6362
    64 const UITextTable& UIInformationItem::text() const
     63const UITextTable &UIInformationItem::text() const
    6564{
    6665    /* Return text: */
     
    7776    {
    7877        /* Lines: */
    79         QString strLeftLine = line.first;
    80         QString strRightLine = line.second;
     78        const QString strLeftLine = line.first;
     79        const QString strRightLine = line.second;
    8180
    8281        /* If 2nd line is NOT empty: */
     
    113112}
    114113
    115 QString UIInformationItem::htmlData()
     114QString UIInformationItem::htmlData() const
    116115{
    117116    /* Return html-data: */
     
    126125    updateData(index);
    127126    /* If there is something to paint: */
    128     if (m_text.count() != 0)
     127    if (!m_text.isEmpty())
    129128    {
    130129        /* Draw item as per application style: */
     
    140139}
    141140
    142 QSize UIInformationItem::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
     141QSize UIInformationItem::sizeHint(const QStyleOptionViewItem & /* option */, const QModelIndex &index) const
    143142{
    144     RT_NOREF(option);
    145 
    146143    /* Update data: */
    147144    updateData(index);
    148     if (m_text.count() == 0)
    149     {
     145    if (m_text.isEmpty())
    150146        return QSize(0, 0);
    151     }
    152147    /* Return size: */
    153148    return m_pTextDocument->size().toSize();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.h

    r65328 r65329  
    2020
    2121/* Qt includes: */
    22 #include <QIcon>
    23 #include <QTextLayout>
    2422#include <QStyledItemDelegate>
    25 #include <QStyleOptionViewItem>
    2623
    2724/* GUI includes: */
     25#include "QIWithRetranslateUI.h"
     26#include "UIExtraDataDefs.h"
    2827#include "UIGDetailsItem.h"
    29 #include "UIExtraDataDefs.h"
    30 #include "QIWithRetranslateUI.h"
    3128
    3229/* Forward declarations: */
    33 class QTextLayout;
     30class QStyleOptionViewItem;
    3431class QTextDocument;
    3532
     
    5956
    6057    /** Returns the text-data of information-item. */
    61     const UITextTable& text() const;
     58    const UITextTable &text() const;
    6259    /** Defines the text-data of information-item as @a text. */
    6360    void setText(const UITextTable &text) const;
     
    6764
    6865    /** Returns html data. */
    69     QString htmlData();
     66    QString htmlData() const;
    7067
    7168protected:
    7269
    7370    /** Performs painting for @a index using @a pPainter and @a option set. */
    74     void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
     71    virtual void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const /* override */;
    7572
    7673    /** Calculates size-hint for @a index using @a option set. */
    77     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
     74    virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const /* override */;
    7875
    7976private:
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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