VirtualBox

儲存庫 vbox 的更動 62670


忽略:
時間撮記:
2016-7-29 上午06:51:40 (8 年 以前)
作者:
vboxsync
訊息:

FE/Qt: bugref:8088: Rework session-information window: Make icons HiDPI aware.

檔案:
修改 1 筆資料

圖例:

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

    r60021 r62670  
    2727
    2828/* GUI includes: */
     29# include "UIIconPool.h"
    2930# include "UIInformationItem.h"
    3031# include "VBoxGlobal.h"
     
    3839    m_pTextDocument = new QTextDocument(this);
    3940    AssertPtrReturnVoid(m_pTextDocument);
     41
     42    /* Dummy initialization of icon-string (to avoid assertion in icon-pool when model is empty): */
     43    m_strIcon = ":/machine_16px.png";
    4044}
    4145
     
    150154    /* Details templates: */
    151155    static const char *sSectionBoldTpl =
    152         "<tr><td width=22 rowspan=%1 align=left><img width=16 height=16 src='%2'></td>"
     156        "<tr><td width=22 rowspan=%1 align=left><img src=\"image://%2\" /></td>"
    153157            "<td><b><nobr>%3</nobr></b></td></tr>"
    154158            "%4";
     
    156160        "<tr><td width=200><nobr>%1</nobr></td><td/><td>%2</td></tr>";
    157161    const QString &sectionTpl = sSectionBoldTpl;
     162
     163    /* Initialize icon tag: */
     164    const QString strIconTag = QString("image://%1").arg(m_strIcon);
    158165
    159166    /* Compose details report: */
     
    172179    }
    173180
     181    /* Add pixmap to text-document as image resource: */
     182    m_pTextDocument->addResource(QTextDocument::ImageResource, QUrl(strIconTag), UIIconPool::pixmap(m_strIcon));
     183
    174184    /* Set html-data: */
    175185    m_pTextDocument->setHtml(report);
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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