Seamly2D
Code documentation
expandingtextedit.h
Go to the documentation of this file.
1 /******************************************************************************
2  * @file expandingtextedit.h
3  ** @author DS Caskey
4  ** @date Feb 18, 2023
5  **
6  ** @brief
7  ** @copyright
8  ** This source code is part of the Seamly2D project, a pattern making
9  ** program, whose allow create and modeling patterns of clothing.
10  ** Copyright (C) 2017-2023 Seamly2D project
11  ** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
12  **
13  ** Seamly2D is free software: you can redistribute it and/or modify
14  ** it under the terms of the GNU General Public License as published by
15  ** the Free Software Foundation, either version 3 of the License, or
16  ** (at your option) any later version.
17  **
18  ** Seamly2D is distributed in the hope that it will be useful,
19  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  ** GNU General Public License for more details.
22  **
23  ** You should have received a copy of the GNU General Public License
24  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
25  **
26  *************************************************************************/
27 
28 #ifndef EXPANDINGTEXTEDIT_H
29 #define EXPANDINGTEXTEDIT_H
30 
31 #include <QPlainTextEdit>
32 #include <QWidget>
33 
34 class ExpandingTextEdit : public QPlainTextEdit
35 {
36  Q_OBJECT
37 public:
38  explicit ExpandingTextEdit(QWidget *parent = nullptr);
39  ExpandingTextEdit(const QString &contents, QWidget *parent = nullptr);
40 
41 protected:
42  virtual void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
43  virtual void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
44 
45 private:
46  Q_DISABLE_COPY(ExpandingTextEdit)
47 };
48 
49 #endif // EXPANDINGTEXTEDIT_H
virtual void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE
virtual void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE
ExpandingTextEdit(QWidget *parent=nullptr)