From 52a4a831547ed9e9924cd62196f486c19735adc2 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 6 Jul 2020 15:24:44 +0200 Subject: [PATCH] Debugger: Remove ConsoleViewStyle This interferes with the general theming of the output pane and the purpose is no more obvious. This patch fixes using a wrong scrollbar style on the QML Debugger Console. Change-Id: I4dfeecb77746b345f35809dd5e1bcb27a0fcd604 Reviewed-by: Robert Loehning Reviewed-by: hjk --- src/plugins/debugger/console/consoleview.cpp | 40 -------------------- 1 file changed, 40 deletions(-) diff --git a/src/plugins/debugger/console/consoleview.cpp b/src/plugins/debugger/console/consoleview.cpp index 823e37ae6ba..13115cb43b2 100644 --- a/src/plugins/debugger/console/consoleview.cpp +++ b/src/plugins/debugger/console/consoleview.cpp @@ -48,35 +48,6 @@ namespace Debugger { namespace Internal { -class ConsoleViewStyle : public ManhattanStyle -{ -public: - ConsoleViewStyle(const QString &baseStyleName) : ManhattanStyle(baseStyleName) {} - - void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, - const QWidget *widget = nullptr) const final - { - if (element != QStyle::PE_PanelItemViewRow) - ManhattanStyle::drawPrimitive(element, option, painter, widget); - } - - int styleHint(StyleHint hint, const QStyleOption *option = nullptr, - const QWidget *widget = nullptr, - QStyleHintReturn *returnData = nullptr) const final - { - if (hint == SH_ItemView_ShowDecorationSelected) - return 0; - else - return ManhattanStyle::styleHint(hint, option, widget, returnData); - } -}; - -/////////////////////////////////////////////////////////////////////// -// -// ConsoleView -// -/////////////////////////////////////////////////////////////////////// - ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) : Utils::TreeView(parent), m_model(model) { @@ -102,17 +73,6 @@ ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) : "border-image: none;" "image: none; }"); - QString baseName = QApplication::style()->objectName(); - if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost() - && baseName == "windows") { - // Sometimes we get the standard windows 95 style as a fallback - if (QStyleFactory::keys().contains("Fusion")) { - baseName = "fusion"; // Qt5 - } - } - auto style = new ConsoleViewStyle(baseName); - setStyle(style); - style->setParent(this); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);