forked from qt-creator/qt-creator
QmlDesigner: reactivate special NavigatorTreeView style
it was a regression when everything switched to fusion style Change-Id: I87a660afd268ed76608edad8edc93f29db243748 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
484550d785
commit
c25ac73f65
@@ -41,6 +41,7 @@
|
||||
#include <QPixmapCache>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
#include <QStyleFactory>
|
||||
|
||||
|
||||
namespace QmlDesigner {
|
||||
@@ -53,6 +54,12 @@ namespace {
|
||||
class TreeViewStyle : public QProxyStyle
|
||||
{
|
||||
public:
|
||||
TreeViewStyle(QObject *parent) : QProxyStyle(QStyleFactory::create("fusion"))
|
||||
{
|
||||
setParent(parent);
|
||||
baseStyle()->setParent(parent);
|
||||
}
|
||||
|
||||
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0) const
|
||||
{
|
||||
static QRect mouseOverStateSavedFrameRectangle;
|
||||
@@ -162,9 +169,7 @@ private: // variables
|
||||
NavigatorTreeView::NavigatorTreeView(QWidget *parent)
|
||||
: QTreeView(parent)
|
||||
{
|
||||
TreeViewStyle *style = new TreeViewStyle;
|
||||
setStyle(style);
|
||||
style->setParent(this);
|
||||
setStyle(new TreeViewStyle(this));
|
||||
}
|
||||
|
||||
void NavigatorTreeView::drawSelectionBackground(QPainter *painter, const QStyleOption &option)
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
#include <QtDebug>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
#include <QStyleFactory>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
NavigatorWidget::NavigatorWidget(NavigatorView *view) :
|
||||
@@ -53,9 +51,6 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view) :
|
||||
m_treeView->setDefaultDropAction(Qt::LinkAction);
|
||||
m_treeView->setHeaderHidden(true);
|
||||
|
||||
QStyle *style = QStyleFactory::create("fusion");
|
||||
m_treeView->setStyle(style);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout;
|
||||
layout->setSpacing(0);
|
||||
layout->setMargin(0);
|
||||
|
||||
Reference in New Issue
Block a user