forked from qt-creator/qt-creator
Factor an overlay widget out of progress indicator
The principle of having a widget on top of all other children of the same parent, for the purpose of painting an overlay, is generic. Change-Id: I6d3ee89cc51354988fedcc40340bb45a065db607 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "overlaywidget.h"
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QTimer>
|
||||
@@ -76,7 +77,7 @@ private:
|
||||
UpdateCallback m_callback;
|
||||
};
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT ProgressIndicator : public QWidget
|
||||
class QTCREATOR_UTILS_EXPORT ProgressIndicator : public OverlayWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -86,17 +87,11 @@ public:
|
||||
|
||||
QSize sizeHint() const final;
|
||||
|
||||
void attachToWidget(QWidget *parent);
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) final;
|
||||
void showEvent(QShowEvent *) final;
|
||||
void hideEvent(QHideEvent *) final;
|
||||
bool eventFilter(QObject *obj, QEvent *ev) final;
|
||||
|
||||
private:
|
||||
void resizeToParent();
|
||||
|
||||
ProgressIndicatorPainter m_paint;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user