customtextedit.h
530 Bytes
#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