forked from qt-creator/qt-creator
Header cleanup in utils.
This commit is contained in:
@@ -29,19 +29,20 @@
|
||||
|
||||
#include "detailsbutton.h"
|
||||
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
#include <QtGui/QPaintEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QStyleOption>
|
||||
#include <QtGui/QGraphicsOpacityEffect>
|
||||
#include <QtCore/QPropertyAnimation>
|
||||
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
FadingPanel::FadingPanel(QWidget *parent) : QWidget(parent), m_opacityEffect(0)
|
||||
|
||||
FadingPanel::FadingPanel(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
m_opacityEffect(new QGraphicsOpacityEffect)
|
||||
{
|
||||
m_opacityEffect = new QGraphicsOpacityEffect;
|
||||
m_opacityEffect->setOpacity(0);
|
||||
setGraphicsEffect(m_opacityEffect);
|
||||
|
||||
|
||||
@@ -30,15 +30,13 @@
|
||||
#ifndef DETAILSBUTTON_H
|
||||
#define DETAILSBUTTON_H
|
||||
|
||||
#include <QtGui/QAbstractButton>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QGraphicsOpacityEffect>
|
||||
#include <QtCore/QPropertyAnimation>
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QtGui/QAbstractButton>
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QGraphicsOpacityEffect)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT FadingPanel : public QWidget
|
||||
@@ -50,11 +48,9 @@ protected:
|
||||
QGraphicsOpacityEffect *m_opacityEffect;
|
||||
};
|
||||
|
||||
|
||||
class QTCREATOR_UTILS_EXPORT DetailsButton : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(float fader READ fader WRITE setFader)
|
||||
|
||||
public:
|
||||
@@ -74,5 +70,5 @@ private:
|
||||
QPixmap m_uncheckedPixmap;
|
||||
float m_fader;
|
||||
};
|
||||
}
|
||||
} // namespace Utils
|
||||
#endif // DETAILSBUTTON_H
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QPropertyAnimation>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QMouseEvent>
|
||||
@@ -39,8 +40,7 @@
|
||||
#include <QtGui/QAbstractButton>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QStyle>
|
||||
#include <QtCore/QPropertyAnimation>
|
||||
|
||||
#include <QtGui/QPaintEvent>
|
||||
|
||||
enum { margin = 6 };
|
||||
|
||||
|
||||
@@ -33,20 +33,20 @@
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QtGui/QLineEdit>
|
||||
#include <QtGui/QPaintEvent>
|
||||
#include <QtGui/QAbstractButton>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
class FancyLineEditPrivate;
|
||||
|
||||
class IconButton: public QAbstractButton
|
||||
class QTCREATOR_UTILS_EXPORT IconButton: public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(float iconOpacity READ iconOpacity WRITE setIconOpacity)
|
||||
Q_PROPERTY(bool autoHide READ hasAutoHide WRITE setAutoHide)
|
||||
Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
|
||||
public:
|
||||
IconButton(QWidget *parent = 0);
|
||||
explicit IconButton(QWidget *parent = 0);
|
||||
void paintEvent(QPaintEvent *event);
|
||||
void setPixmap(const QPixmap &pixmap) { m_pixmap = pixmap; update(); }
|
||||
QPixmap pixmap() const { return m_pixmap; }
|
||||
|
||||
@@ -33,7 +33,8 @@
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtGui/QAbstractButton>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAbstractButton)
|
||||
|
||||
namespace Utils {
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ class QTCREATOR_UTILS_EXPORT QtColorButton : public QToolButton
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool backgroundCheckered READ isBackgroundCheckered WRITE setBackgroundCheckered)
|
||||
Q_PROPERTY(bool alphaAllowed READ isAlphaAllowed WRITE setAlphaAllowed)
|
||||
Q_PROPERTY(QColor color READ color WRITE setColor)
|
||||
public:
|
||||
QtColorButton(QWidget *parent = 0);
|
||||
~QtColorButton();
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <QTabBar>
|
||||
#include <QImageReader>
|
||||
#include <QMimeData>
|
||||
#include <QWheelEvent>
|
||||
|
||||
#include <QDeclarativeView>
|
||||
#include <QDeclarativeItem>
|
||||
|
||||
@@ -103,6 +103,17 @@ PathChooser_CW::PathChooser_CW(QObject *parent) :
|
||||
{
|
||||
}
|
||||
|
||||
IconButton_CW::IconButton_CW(QObject *parent) :
|
||||
QObject(parent),
|
||||
CustomWidget<Utils::IconButton>
|
||||
(QLatin1String("<utils/fancylineedit.h>"),
|
||||
false,
|
||||
QLatin1String(groupC),
|
||||
QIcon(),
|
||||
QLatin1String("Icon button of FancyLineEdit"))
|
||||
{
|
||||
}
|
||||
|
||||
FancyLineEdit_CW::FancyLineEdit_CW(QObject *parent) :
|
||||
QObject(parent),
|
||||
CustomWidget<Utils::FancyLineEdit>
|
||||
@@ -372,6 +383,7 @@ WidgetCollection::WidgetCollection(QObject *parent) :
|
||||
m_plugins.push_back(new ProjectNameValidatingLineEdit_CW(this));
|
||||
m_plugins.push_back(new LineColumnLabel_CW(this));
|
||||
m_plugins.push_back(new PathChooser_CW(this));
|
||||
m_plugins.push_back(new IconButton_CW(this));
|
||||
m_plugins.push_back(new FancyLineEdit_CW(this));
|
||||
m_plugins.push_back(new FilterLineEdit_CW(this));
|
||||
m_plugins.push_back(new QtColorButton_CW(this));
|
||||
|
||||
@@ -122,6 +122,16 @@ public:
|
||||
explicit PathChooser_CW(QObject *parent = 0);
|
||||
};
|
||||
|
||||
class IconButton_CW :
|
||||
public QObject,
|
||||
public CustomWidget<Utils::IconButton>
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
public:
|
||||
explicit IconButton_CW(QObject *parent = 0);
|
||||
};
|
||||
|
||||
class FancyLineEdit_CW :
|
||||
public QObject,
|
||||
public CustomWidget<Utils::FancyLineEdit>
|
||||
|
||||
Reference in New Issue
Block a user