Krita Source Code Documentation
Loading...
Searching...
No Matches
LimitedTextEditor Class Reference

#include <StoryboardDelegate.h>

+ Inheritance diagram for LimitedTextEditor:

Public Slots

void restrictText ()
 

Public Member Functions

 LimitedTextEditor (int limit, QWidget *parent=nullptr)
 
 ~LimitedTextEditor ()
 

Private Attributes

const int m_charLimit
 

Detailed Description

Definition at line 101 of file StoryboardDelegate.h.

Constructor & Destructor Documentation

◆ LimitedTextEditor()

LimitedTextEditor::LimitedTextEditor ( int limit,
QWidget * parent = nullptr )
inline

Definition at line 104 of file StoryboardDelegate.h.

105 : QTextEdit(parent)
106 , m_charLimit(limit){
107 connect(this, SIGNAL(textChanged()), this, SLOT(restrictText()));
108 }
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))

References connect(), and restrictText().

◆ ~LimitedTextEditor()

LimitedTextEditor::~LimitedTextEditor ( )
inline

Definition at line 110 of file StoryboardDelegate.h.

110{}

Member Function Documentation

◆ restrictText

void LimitedTextEditor::restrictText ( )
inlineslot

Definition at line 113 of file StoryboardDelegate.h.

113 {
114 if (toPlainText().length() > m_charLimit) {
115 setText(toPlainText().left(m_charLimit));
116 QTextCursor c = textCursor();
117 c.setPosition(m_charLimit);
118 setTextCursor(c);
119 }
120 }
qreal length(const QPointF &vec)
Definition Ellipse.cc:82
void setText(QSpinBox *spinBox, const QStringView textTemplate)

References length(), and m_charLimit.

Member Data Documentation

◆ m_charLimit

const int LimitedTextEditor::m_charLimit
private

Definition at line 123 of file StoryboardDelegate.h.


The documentation for this class was generated from the following file: