forked from qt-creator/qt-creator
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 <robert.loehning@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -48,35 +48,6 @@
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
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) :
|
ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) :
|
||||||
Utils::TreeView(parent), m_model(model)
|
Utils::TreeView(parent), m_model(model)
|
||||||
{
|
{
|
||||||
@@ -102,17 +73,6 @@ ConsoleView::ConsoleView(ConsoleItemModel *model, QWidget *parent) :
|
|||||||
"border-image: none;"
|
"border-image: none;"
|
||||||
"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);
|
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||||
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||||
|
Reference in New Issue
Block a user