1 /*
2 * Replacement fot QT Bindings that were removed from QT5
3 * Copyright (C) 2020 Pedro de Carvalho Gomes <pedrogomes81@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "GuiLabel.h"
20
21 using namespace QtBindings::Gui;
22
Label(QWidget * parent,Qt::WindowFlags f)23 Label::Label(QWidget *parent, Qt::WindowFlags f) : QLabel(parent, f)
24 {
25 }
26
Label(const Label & other)27 Label::Label(const Label &other) : QLabel (other.text())
28 {
29 *this=other;
30 }
31
Label(const QString & text,QWidget * parent,Qt::WindowFlags f)32 Label::Label(const QString &text, QWidget *parent,
33 Qt::WindowFlags f) : QLabel(text, parent, f)
34 {
35 }
36
~Label()37 Label::~Label()
38 {
39 }
40
alignment() const41 Qt::Alignment Label::alignment() const
42 {
43 return QLabel::alignment();
44 }
45
buddy() const46 QWidget *Label::buddy() const
47 {
48 return QLabel::buddy();
49 }
50
clear()51 void Label::clear()
52 {
53 QLabel::clear();
54 }
55
hasScaledContents() const56 bool Label::hasScaledContents() const
57 {
58 return QLabel::hasScaledContents();
59 }
60
hasSelectedText() const61 bool Label::hasSelectedText() const
62 {
63 return QLabel::hasSelectedText();
64 }
65
indent() const66 int Label::indent() const
67 {
68 return QLabel::indent();
69 }
70
margin() const71 int Label::margin() const
72 {
73 return QLabel::margin();
74 }
75
movie() const76 QMovie *Label::movie() const
77 {
78 return QLabel::movie();
79 }
80
openExternalLinks() const81 bool Label::openExternalLinks() const
82 {
83 return QLabel::openExternalLinks();
84 }
85
picture() const86 const QPicture *Label::picture() const
87 {
88 return QLabel::picture();
89 }
90
pixmap() const91 const QPixmap *Label::pixmap() const
92 {
93 return QLabel::pixmap();
94 }
95
selectedText() const96 QString Label::selectedText() const
97 {
98 return QLabel::selectedText();
99 }
100
selectionStart() const101 int Label::selectionStart() const
102 {
103 return QLabel::selectionStart();
104 }
105
setAlignment(Qt::Alignment alignment)106 void Label::setAlignment(Qt::Alignment alignment)
107 {
108 QLabel::setAlignment(alignment);
109 }
110
setBuddy(QWidget * buddy)111 void Label::setBuddy(QWidget *buddy)
112 {
113 QLabel::setBuddy(buddy);
114 }
115
setIndent(int indent)116 void Label::setIndent(int indent)
117 {
118 QLabel::setIndent(indent);
119 }
120
setMargin(int margin)121 void Label::setMargin(int margin)
122 {
123 QLabel::setMargin(margin);
124 }
125
setMovie(QMovie * movie)126 void Label::setMovie(QMovie *movie)
127 {
128 QLabel::setMovie(movie);
129 }
130
setNum(double num)131 void Label::setNum(double num)
132 {
133 QLabel::setNum(num);
134 }
135
setNum(int num)136 void Label::setNum(int num)
137 {
138 QLabel::setNum(num);
139 }
140
setOpenExternalLinks(bool open)141 void Label::setOpenExternalLinks(bool open)
142 {
143 QLabel::setOpenExternalLinks(open);
144 }
145
setPicture(const QPicture & picture)146 void Label::setPicture(const QPicture &picture)
147 {
148 QLabel::setPicture(picture);
149 }
150
setPixmap(const QPixmap & pixMap)151 void Label::setPixmap(const QPixmap &pixMap)
152 {
153 QLabel::setPixmap(pixMap);
154 }
155
setScaledContents(bool y)156 void Label::setScaledContents(bool y)
157 {
158 QLabel::setScaledContents(y);
159 }
160
setSelection(int start,int length)161 void Label::setSelection(int start, int length)
162 {
163 QLabel::setSelection(start, length);
164 }
165
setText(const QString & text)166 void Label::setText(const QString &text)
167 {
168 QLabel::setText(text);
169 }
170
setTextFormat(Qt::TextFormat textFormat)171 void Label::setTextFormat(Qt::TextFormat textFormat)
172 {
173 QLabel::setTextFormat(textFormat);
174 }
175
setTextInteractionFlags(Qt::TextInteractionFlags flags)176 void Label::setTextInteractionFlags(Qt::TextInteractionFlags flags)
177 {
178 QLabel::setTextInteractionFlags(flags);
179 }
180
setWordWrap(bool on)181 void Label::setWordWrap(bool on)
182 {
183 QLabel::setWordWrap(on);
184 }
185
text() const186 QString Label::text() const
187 {
188 return QLabel::text();
189 }
190
textFormat() const191 Qt::TextFormat Label::textFormat() const
192 {
193 return QLabel::textFormat();
194 }
195
textInteractionFlags() const196 Qt::TextInteractionFlags Label::textInteractionFlags() const
197 {
198 return QLabel::textInteractionFlags();
199 }
200
wordWrap() const201 bool Label::wordWrap() const
202 {
203 return QLabel::wordWrap();
204 }
205
close()206 bool Label::close()
207 {
208 return QWidget::close();
209 }
210
hide()211 void Label::hide()
212 {
213 QWidget::hide();
214 }
215
lower()216 void Label::lower()
217 {
218 QWidget::lower();
219 }
220
raise()221 void Label::raise()
222 {
223 QWidget::raise();
224 }
225
repaint()226 void Label::repaint()
227 {
228 QWidget::repaint();
229 }
230
setDisabled(bool disable)231 void Label::setDisabled(bool disable)
232 {
233 QWidget::setDisabled(disable);
234 }
235
setEnabled(bool enabled)236 void Label::setEnabled(bool enabled)
237 {
238 QWidget::setEnabled(enabled);
239 }
240
setFocus()241 void Label::setFocus()
242 {
243 QWidget::setFocus();
244 }
245
setHidden(bool hidden)246 void Label::setHidden(bool hidden)
247 {
248 QWidget::setHidden(hidden);
249 }
250
setStyleSheet(const QString & styleSheet)251 void Label::setStyleSheet(const QString &styleSheet)
252 {
253 QWidget::setStyleSheet(styleSheet);
254 }
255
setVisible(bool visible)256 void Label::setVisible(bool visible)
257 {
258 QWidget::setVisible(visible);
259 }
260
setWindowModified(bool windowModified)261 void Label::setWindowModified(bool windowModified)
262 {
263 QWidget::setWindowModified(windowModified);
264 }
265
setWindowTitle(const QString & title)266 void Label::setWindowTitle(const QString &title)
267 {
268 QWidget::setWindowTitle(title);
269 }
270
show()271 void Label::show()
272 {
273 QWidget::show();
274 }
275
showFullScreen()276 void Label::showFullScreen()
277 {
278 QWidget::showFullScreen();
279 }
280
showMaximized()281 void Label::showMaximized()
282 {
283 QWidget::showMaximized();
284 }
285
showMinimized()286 void Label::showMinimized()
287 {
288 QWidget::showMinimized();
289 }
290
showNormal()291 void Label::showNormal()
292 {
293 QWidget::showNormal();
294 }
295
update()296 void Label::update()
297 {
298 QWidget::update();
299 }
300
operator =(const Label & other)301 Label &Label::operator=(const Label &other)
302 {
303 if (this != &other) {
304 this->setEnabled( other.isEnabled() ) ;
305 this->setBuddy( other.buddy() );
306 this->setIndent( other.indent() );
307 this->setMargin( other.margin() );
308 this->setMovie( other.movie() );
309 this->setOpenExternalLinks( other.openExternalLinks() );
310 this->setPicture( *other.picture() ) ;
311 this->setPixmap( *other.pixmap() );
312 this->setScaledContents( other.hasScaledContents() );
313 this->setSelection( other.selectionStart(), other.selectedText().length() );
314 this->setText( other.text() );
315 this->setTextFormat( other.textFormat() );
316 this->setTextInteractionFlags( other.textInteractionFlags() );
317 this->setWordWrap( other.wordWrap() );
318 }
319 return *this;
320 }
321
322