Differential D22158 Diff 60904 kdevplatform/language/duchain/navigation/abstractnavigationwidget.cpp
Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/language/duchain/navigation/abstractnavigationwidget.cpp
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | |||||
91 | 91 | | |||
92 | void AbstractNavigationWidget::initBrowser(int height) | 92 | void AbstractNavigationWidget::initBrowser(int height) | ||
93 | { | 93 | { | ||
94 | Q_D(AbstractNavigationWidget); | 94 | Q_D(AbstractNavigationWidget); | ||
95 | 95 | | |||
96 | Q_ASSERT(!d->m_browser); | 96 | Q_ASSERT(!d->m_browser); | ||
97 | Q_UNUSED(height); | 97 | Q_UNUSED(height); | ||
98 | d->m_browser = new QTextBrowser; | 98 | d->m_browser = new QTextBrowser; | ||
99 | | ||||
100 | // since we can embed arbitrary HTML we have to make sure it stays readable by forcing a black-white palette | | |||
kossebau: This comment though still applies, as this is about HTML injected from the documentation, e.g. | |||||
What palette is used with by default ? Does it follow the KColorScheme ? tristanp: What palette is used with by default ? Does it follow the KColorScheme ? | |||||
101 | QPalette p; | | |||
102 | p.setColor(QPalette::AlternateBase, Qt::white); | | |||
103 | p.setColor(QPalette::Base, Qt::white); | | |||
104 | p.setColor(QPalette::Text, Qt::black); | | |||
105 | d->m_browser->setPalette(p); | | |||
106 | | ||||
107 | d->m_browser->setOpenLinks(false); | 99 | d->m_browser->setOpenLinks(false); | ||
108 | d->m_browser->setOpenExternalLinks(false); | 100 | d->m_browser->setOpenExternalLinks(false); | ||
109 | 101 | | |||
110 | auto* layout = new QVBoxLayout; | 102 | auto* layout = new QVBoxLayout; | ||
111 | layout->addWidget(d->m_browser); | 103 | layout->addWidget(d->m_browser); | ||
112 | layout->setMargin(0); | 104 | layout->setMargin(0); | ||
113 | setLayout(layout); | 105 | setLayout(layout); | ||
114 | 106 | | |||
▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines |
This comment though still applies, as this is about HTML injected from the documentation, e.g. about C++ classes.
Though admittedly this is currently partially broken at least for Qt documentation for me, will need testing for other documentation first.