Blame view

customtextedit.h 530 Bytes
Imanol-Mikel Barba Sabariego authored
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef CUSTOMTEXTEDIT_H
#define CUSTOMTEXTEDIT_H

#include <QtGui/QTextEdit>

class CustomTextEdit : public QTextEdit
{
    Q_OBJECT
    public:
        explicit CustomTextEdit(QObject *parent = 0);
        int getMaxLength();

    public slots:
        void setMaxLength(int length);

    protected:
        /*virtual void keyPressEvent(QKeyEvent *e);
        void insertFromMimeData(const QMimeData* source);*/

    private:
        int maxLength;
    private slots:
        void truncateText();
};

#endif // CUSTOMTEXTEDIT_H