儲存庫 vbox 的更動 65329
- 時間撮記:
- 2017-1-16 下午01:32:36 (8 年 以前)
- 位置:
- trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
- 檔案:
-
- 修改 2 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.cpp
r65328 r65329 21 21 22 22 /* Qt includes: */ 23 # include <QApplication> 23 24 # include <QPainter> 24 # include <QApplication>25 # include <QAbstractTextDocumentLayout>26 25 # include <QTextDocument> 27 26 # include <QUrl> 28 27 29 28 /* GUI includes: */ 29 # include "VBoxGlobal.h" 30 30 # include "UIIconPool.h" 31 31 # include "UIInformationItem.h" 32 # include "VBoxGlobal.h"33 32 34 33 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ … … 62 61 } 63 62 64 const UITextTable &UIInformationItem::text() const63 const UITextTable &UIInformationItem::text() const 65 64 { 66 65 /* Return text: */ … … 77 76 { 78 77 /* Lines: */ 79 QString strLeftLine = line.first;80 QString strRightLine = line.second;78 const QString strLeftLine = line.first; 79 const QString strRightLine = line.second; 81 80 82 81 /* If 2nd line is NOT empty: */ … … 113 112 } 114 113 115 QString UIInformationItem::htmlData() 114 QString UIInformationItem::htmlData() const 116 115 { 117 116 /* Return html-data: */ … … 126 125 updateData(index); 127 126 /* If there is something to paint: */ 128 if ( m_text.count() != 0)127 if (!m_text.isEmpty()) 129 128 { 130 129 /* Draw item as per application style: */ … … 140 139 } 141 140 142 QSize UIInformationItem::sizeHint(const QStyleOptionViewItem & option, const QModelIndex &index) const141 QSize UIInformationItem::sizeHint(const QStyleOptionViewItem & /* option */, const QModelIndex &index) const 143 142 { 144 RT_NOREF(option);145 146 143 /* Update data: */ 147 144 updateData(index); 148 if (m_text.count() == 0) 149 { 145 if (m_text.isEmpty()) 150 146 return QSize(0, 0); 151 }152 147 /* Return size: */ 153 148 return m_pTextDocument->size().toSize(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationItem.h
r65328 r65329 20 20 21 21 /* Qt includes: */ 22 #include <QIcon>23 #include <QTextLayout>24 22 #include <QStyledItemDelegate> 25 #include <QStyleOptionViewItem>26 23 27 24 /* GUI includes: */ 25 #include "QIWithRetranslateUI.h" 26 #include "UIExtraDataDefs.h" 28 27 #include "UIGDetailsItem.h" 29 #include "UIExtraDataDefs.h"30 #include "QIWithRetranslateUI.h"31 28 32 29 /* Forward declarations: */ 33 class Q TextLayout;30 class QStyleOptionViewItem; 34 31 class QTextDocument; 35 32 … … 59 56 60 57 /** Returns the text-data of information-item. */ 61 const UITextTable &text() const;58 const UITextTable &text() const; 62 59 /** Defines the text-data of information-item as @a text. */ 63 60 void setText(const UITextTable &text) const; … … 67 64 68 65 /** Returns html data. */ 69 QString htmlData() ;66 QString htmlData() const; 70 67 71 68 protected: 72 69 73 70 /** Performs painting for @a index using @a pPainter and @a option set. */ 74 v oid paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const;71 virtual void paint(QPainter *pPainter, const QStyleOptionViewItem &option, const QModelIndex &index) const /* override */; 75 72 76 73 /** 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 */; 78 75 79 76 private:
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器