Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef LINEEDIT_H
Toshihiro Shimizu 890ddd
#define LINEEDIT_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tcommon.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qlineedit></qlineedit>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TOONZQT_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
namespace DVGui {
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
/*! \brief It is a \b QLineEdit which lost focus when enter is pressed and emit
Shinya Kitaoka 120a6e
                                         focusIn signal when line edit take
Shinya Kitaoka 120a6e
   focus.
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
                Inherits \b QLineEdit.
Toshihiro Shimizu 890ddd
*/
Shinya Kitaoka 120a6e
class DVAPI LineEdit : public QLineEdit {
Shinya Kitaoka 120a6e
  Q_OBJECT
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool m_isReturnPressed;
Shinya Kitaoka 120a6e
  bool m_forbiddenSpecialChars;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  LineEdit(QWidget *parent = 0, bool forbiddenSpecialChars = false);
Shinya Kitaoka 120a6e
  LineEdit(const QString &contents, QWidget *parent = 0,
Shinya Kitaoka 120a6e
           bool forbiddenSpecialChars = false);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  bool isReturnPressed() const { return m_isReturnPressed; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  ~LineEdit() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 473e70
  void focusInEvent(QFocusEvent *event) override;
Shinya Kitaoka 473e70
  void keyPressEvent(QKeyEvent *event) override;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
signals:
Shinya Kitaoka 120a6e
  void focusIn();
Jeremy Bullock f3ea7c
  void returnPressedNow();
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Shinya Kitaoka 120a6e
}  // namespace DVGui
Toshihiro Shimizu 890ddd
//-----------------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // LINEEDIT_H