Changeset 43223 in vbox
- Timestamp:
- Sep 6, 2012 11:48:24 AM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp
r43153 r43223 826 826 int iLeading = fm.leading(); 827 827 828 /* Only bold sub-strings are currently handled: */ 829 QString strModifiedText(strText); 830 QRegExp boldRegExp("<b>([\\s\\S]+)</b>"); 831 QList<QTextLayout::FormatRange> formatRangeList; 832 while (boldRegExp.indexIn(strModifiedText) != -1) 833 { 834 /* Prepare format: */ 835 QTextLayout::FormatRange formatRange; 836 QFont font = formatRange.format.font(); 837 font.setBold(true); 838 formatRange.format.setFont(font); 839 formatRange.start = boldRegExp.pos(0); 840 formatRange.length = boldRegExp.cap(1).size(); 841 /* Add format range to list: */ 842 formatRangeList << formatRange; 843 /* Replace sub-string: */ 844 strModifiedText.replace(boldRegExp.cap(0), boldRegExp.cap(1)); 845 } 846 828 847 /* Create layout; */ 829 QTextLayout *pTextLayout = new QTextLayout(strText, font, pPaintDevice); 848 QTextLayout *pTextLayout = new QTextLayout(strModifiedText, font, pPaintDevice); 849 pTextLayout->setAdditionalFormats(formatRangeList); 830 850 831 851 /* Configure layout: */ -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp
r42855 r43223 449 449 /* Prepare attachment information: */ 450 450 QString strAttachmentInfo = vboxGlobal().details(attachment.GetMedium(), false, false); 451 /* That temporary hack makes sure 'Inaccessible' word is always bold: */ 452 { // hack 453 QString strInaccessibleString(VBoxGlobal::tr("Inaccessible", "medium")); 454 QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString)); 455 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString); 456 } // hack 451 457 /* Append 'device slot name' with 'device type name' for CD/DVD devices only: */ 452 458 QString strDeviceType = attachment.GetType() == KDeviceType_DVD ?
Note:
See TracChangeset
for help on using the changeset viewer.