- Timestamp:
- Aug 7, 2017 7:28:15 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIDesktopPane.cpp
r68281 r68310 133 133 UIDesktopPanePrivate(QWidget *pParent, QAction *pRefreshAction); 134 134 135 /** Assigns @a strText and switches to text pane. */136 void setText(const QString &strText);137 135 /** Assigns @a strError and switches to error pane. */ 138 136 void setError(const QString &strError); … … 154 152 void retranslateUi(); 155 153 156 /** Prepares text pane. */157 void prepareTextPane();158 154 /** Prepares error pane. */ 159 155 void prepareErrorPane(); … … 163 159 164 160 private: 165 166 /** Holds the text pane instance. */167 QRichTextBrowser *m_pText;168 161 169 162 /** Holds the error pane container. */ … … 467 460 UIDesktopPanePrivate::UIDesktopPanePrivate(QWidget *pParent, QAction *pRefreshAction) 468 461 : QIWithRetranslateUI<QStackedWidget>(pParent) 469 , m_pText(0)470 462 , m_pErrBox(0), m_pErrLabel(0), m_pErrText(0) 471 463 , m_pRefreshButton(0), m_pRefreshAction(pRefreshAction) … … 474 466 /* Translate finally: */ 475 467 retranslateUi(); 476 }477 478 void UIDesktopPanePrivate::setText(const QString &strText)479 {480 /* Prepare text pane if necessary: */481 prepareTextPane();482 483 /* Assign corresponding text: */484 m_pText->setText(strText);485 486 /* Raise corresponding widget: */487 setCurrentIndex(indexOf(m_pText));488 468 } 489 469 … … 571 551 m_pRefreshButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 572 552 } 573 }574 575 void UIDesktopPanePrivate::prepareTextPane()576 {577 if (m_pText)578 return;579 580 /* Create text pane: */581 m_pText = new QRichTextBrowser(this);582 m_pText->setFocusPolicy(Qt::StrongFocus);583 m_pText->document()->setDefaultStyleSheet("a { text-decoration: none; }");584 /* Make text pane transparent: */585 m_pText->setFrameShape(QFrame::NoFrame);586 m_pText->viewport()->setAutoFillBackground(false);587 m_pText->setOpenLinks(false);588 589 /* Add into the stack: */590 addWidget(m_pText);591 592 /* Retranslate finally: */593 retranslateUi();594 553 } 595 554 … … 742 701 } 743 702 744 void UIDesktopPane::updateDetailsText(const QString &strText)745 {746 m_pDesktopPrivate->setText(strText);747 }748 749 703 void UIDesktopPane::updateDetailsError(const QString &strError) 750 704 { -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIDesktopPane.h
r68281 r68310 43 43 UIDesktopPane(QAction *pRefreshAction = 0, QWidget *pParent = 0); 44 44 45 /** Updates @a strText details and switches to text details pane. */46 void updateDetailsText(const QString &strText);47 45 /** Updates @a strError details and switches to error details pane. */ 48 46 void updateDetailsError(const QString &strError);
Note:
See TracChangeset
for help on using the changeset viewer.