// Code taken from the Qt Creator project and customized a little
+#include <config.h>
+
#include "FancyLineEdit.h"
#if QT_VERSION >= 0x040600
-#include <QtCore/QEvent>
-#include <QtCore/QDebug>
-#include <QtCore/QString>
-#include <QtCore/QPropertyAnimation>
-#include <QtGui/QApplication>
-#include <QtGui/QMenu>
-#include <QtGui/QMouseEvent>
-#include <QtGui/QLabel>
-#include <QtGui/QAbstractButton>
-#include <QtGui/QPainter>
-#include <QtGui/QStyle>
-#include <QtGui/QPaintEvent>
+#include <QEvent>
+#include <QDebug>
+#include <QString>
+#include <QPropertyAnimation>
+#include <QApplication>
+#include <QMenu>
+#include <QMouseEvent>
+#include <QLabel>
+#include <QAbstractButton>
+#include <QPainter>
+#include <QStyle>
+#include <QPaintEvent>
enum { margin = 6 };
// IconButton - helper class to represent a clickable icon
IconButton::IconButton(QWidget *parent)
- : QAbstractButton(parent), m_autoHide(false)
+ : QAbstractButton(parent), m_iconOpacity(0.0), m_autoHide(false)
{
setCursor(Qt::ArrowCursor);
setFocusPolicy(Qt::NoFocus);
void IconButton::paintEvent(QPaintEvent *)
{
QPainter painter(this);
- // Note isDown should really use the active state but in most styles
- // this has no proper feedback
- QIcon::Mode state = QIcon::Disabled;
- if (isEnabled())
- state = isDown() ? QIcon::Selected : QIcon::Normal;
QRect pixmapRect = QRect(0, 0, m_pixmap.width(), m_pixmap.height());
pixmapRect.moveCenter(rect().center());