Core: Move HighlightScrollBarOverlay to source file

This is an implementation detail, and does not even require meta object.

Change-Id: Iee52ded9dd68539494490fdca428d49fd9c8dc45
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Orgad Shaneh
2017-01-14 22:49:37 +02:00
committed by Orgad Shaneh
parent 2e2c3c39af
commit 884eb8c059
2 changed files with 34 additions and 33 deletions

View File

@@ -33,8 +33,39 @@
#include <QStyleOptionSlider>
#include <QTimer>
using namespace Core;
using namespace Utils;
namespace Core {
class HighlightScrollBarOverlay : public QWidget
{
public:
HighlightScrollBarOverlay(HighlightScrollBar *scrollBar)
: QWidget(scrollBar)
, m_visibleRange(0.0)
, m_offset(0.0)
, m_cacheUpdateScheduled(false)
, m_scrollBar(scrollBar)
{}
void scheduleUpdate();
void updateCache();
void adjustPosition();
float m_visibleRange;
float m_offset;
QHash<Id, QSet<int> > m_highlights;
QHash<Id, Utils::Theme::Color> m_colors;
QHash<Id, HighlightScrollBar::Priority> m_priorities;
bool m_cacheUpdateScheduled;
QMap<int, Id> m_cache;
protected:
void paintEvent(QPaintEvent *paintEvent) override;
private:
HighlightScrollBar *m_scrollBar;
};
HighlightScrollBar::HighlightScrollBar(Qt::Orientation orientation, QWidget *parent)
: QScrollBar(orientation, parent)
@@ -295,3 +326,5 @@ void HighlightScrollBarOverlay::paintEvent(QPaintEvent *paintEvent)
}
}
}
} // namespace Core

View File

@@ -82,36 +82,4 @@ private:
friend class HighlightScrollBarOverlay;
};
class HighlightScrollBarOverlay : public QWidget
{
Q_OBJECT
public:
HighlightScrollBarOverlay(HighlightScrollBar *scrollBar)
: QWidget(scrollBar)
, m_visibleRange(0.0)
, m_offset(0.0)
, m_cacheUpdateScheduled(false)
, m_scrollBar(scrollBar)
{}
void scheduleUpdate();
void updateCache();
void adjustPosition();
float m_visibleRange;
float m_offset;
QHash<Id, QSet<int> > m_highlights;
QHash<Id, Utils::Theme::Color> m_colors;
QHash<Id, HighlightScrollBar::Priority> m_priorities;
bool m_cacheUpdateScheduled;
QMap<int, Id> m_cache;
protected:
void paintEvent(QPaintEvent *paintEvent) override;
private:
HighlightScrollBar *m_scrollBar;
};
} // namespace Core