Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfTextlayer.cpp
Context not available. | |||||
41 | : QObject(parent) | 41 | : QObject(parent) | ||
---|---|---|---|---|---|
42 | , d(new Private) | 42 | , d(new Private) | ||
43 | { | 43 | { | ||
44 | qRegisterMetaType<Textlayer*>("Textlayer*"); | ||||
44 | } | 45 | } | ||
45 | 46 | | |||
46 | Textlayer::~Textlayer() = default; | 47 | Textlayer::~Textlayer() = default; | ||
Context not available. | |||||
97 | void Textlayer::setLanguage(const QString& language) | 98 | void Textlayer::setLanguage(const QString& language) | ||
98 | { | 99 | { | ||
99 | d->language = language; | 100 | d->language = language; | ||
101 | emit languageChanged(); | ||||
100 | } | 102 | } | ||
101 | 103 | | |||
102 | QString Textlayer::bgcolor() const | 104 | QString Textlayer::bgcolor() const | ||
Context not available. | |||||
107 | void Textlayer::setBgcolor(const QString& newColor) | 109 | void Textlayer::setBgcolor(const QString& newColor) | ||
108 | { | 110 | { | ||
109 | d->bgcolor = newColor; | 111 | d->bgcolor = newColor; | ||
112 | emit bgcolorChanged(); | ||||
110 | } | 113 | } | ||
111 | 114 | | |||
112 | QList<Textarea *> Textlayer::textareas() const | 115 | QList<Textarea *> Textlayer::textareas() const | ||
Context not available. | |||||
132 | else { | 135 | else { | ||
133 | d->textareas.append(textarea); | 136 | d->textareas.append(textarea); | ||
134 | } | 137 | } | ||
138 | emit textareaCountChanged(); | ||||
139 | } | ||||
140 | | ||||
141 | void Textlayer::addTextarea(int index) | ||||
142 | { | ||||
143 | Textarea* text = new Textarea(this); | ||||
144 | addTextarea(text, index); | ||||
135 | } | 145 | } | ||
136 | 146 | | |||
137 | void Textlayer::removeTextarea(Textarea* textarea) | 147 | void Textlayer::removeTextarea(Textarea* textarea) | ||
138 | { | 148 | { | ||
139 | d->textareas.removeAll(textarea); | 149 | d->textareas.removeAll(textarea); | ||
150 | emit textareaCountChanged(); | ||||
140 | } | 151 | } | ||
141 | 152 | | |||
142 | bool Textlayer::swapTextareas(Textarea* swapThis, Textarea* withThis) | 153 | void Textlayer::removeTextarea(int index) | ||
143 | { | 154 | { | ||
144 | int index1 = d->textareas.indexOf(swapThis); | 155 | removeTextarea(textarea(index)); | ||
145 | int index2 = d->textareas.indexOf(withThis); | 156 | } | ||
146 | if(index1 > -1 && index2 > -1) { | 157 | | ||
147 | d->textareas.swap(index1, index2); | 158 | bool Textlayer::swapTextareas(int swapThis, int withThis) | ||
159 | { | ||||
160 | if(swapThis > -1 && withThis > -1) { | ||||
161 | d->textareas.swap(swapThis, withThis); | ||||
162 | emit textareaCountChanged(); | ||||
148 | return true; | 163 | return true; | ||
149 | } | 164 | } | ||
150 | return false; | 165 | return false; | ||
151 | } | 166 | } | ||
167 | | ||||
168 | int Textlayer::textareaCount() | ||||
169 | { | ||||
170 | return d->textareas.size(); | ||||
171 | } | ||||
Context not available. |