defuze.me  Client
clearablelineedit.hpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 #ifndef CLEARABLELINEEDIT_HPP
00012 #define CLEARABLELINEEDIT_HPP
00013 
00014 #include <QLineEdit>
00015 #include <QToolButton>
00016 
00017 class ClearableLineEdit : public QLineEdit
00018 {
00019     Q_OBJECT
00020 public:
00021     explicit    ClearableLineEdit(QWidget *parent = 0);
00022 
00023 protected:
00024     void        resizeEvent(QResizeEvent *);
00025 
00026 private slots:
00027     void        updateCloseButton(const QString &text);
00028 
00029 private:
00030     QToolButton *clearButton;
00031 };
00032 
00033 #endif // CLEARABLELINEEDIT_HPP