File indexing completed on 2025-01-05 04:26:49
0001 /* 0002 * Replacement fot QT Bindings that were removed from QT5 0003 * Copyright (C) 2020 Pedro de Carvalho Gomes <pedrogomes81@gmail.com> 0004 * 0005 * This program is free software: you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation, either version 3 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0017 */ 0018 0019 #ifndef GUILABEL_H 0020 #define GUILABEL_H 0021 0022 #include "QtBinding.h" 0023 0024 #include <QLabel> 0025 0026 namespace QtBindings { 0027 namespace Gui 0028 { 0029 class Label : public QLabel, public QtBindings::Base<Label> 0030 { 0031 Q_OBJECT 0032 public: 0033 Q_INVOKABLE Label(QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); 0034 Q_INVOKABLE Label(const Label &other); 0035 Q_INVOKABLE Label(const QString &text, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); 0036 Q_INVOKABLE ~Label(); 0037 Label &operator=(const Label &other); 0038 public slots: 0039 Qt::Alignment alignment() const; 0040 QWidget *buddy() const; 0041 void clear(); 0042 bool hasScaledContents() const; 0043 bool hasSelectedText() const; 0044 int indent() const; 0045 int margin() const; 0046 QMovie *movie() const; 0047 bool openExternalLinks() const; 0048 const QPicture *picture() const; 0049 const QPixmap *pixmap() const; 0050 QString selectedText() const; 0051 int selectionStart() const; 0052 void setAlignment(Qt::Alignment); 0053 void setBuddy(QWidget *buddy); 0054 void setIndent(int); 0055 void setMargin(int); 0056 void setMovie(QMovie *movie); 0057 void setNum(double num); 0058 void setNum(int num); 0059 void setOpenExternalLinks(bool open); 0060 void setPicture(const QPicture &picture); 0061 void setPixmap(const QPixmap &); 0062 void setScaledContents(bool); 0063 void setSelection(int start, int length); 0064 void setText(const QString &); 0065 void setTextFormat(Qt::TextFormat); 0066 void setTextInteractionFlags(Qt::TextInteractionFlags flags); 0067 void setWordWrap(bool on); 0068 QString text() const; 0069 Qt::TextFormat textFormat() const; 0070 Qt::TextInteractionFlags textInteractionFlags() const; 0071 bool wordWrap() const; 0072 // QWidget 0073 bool close(); 0074 void hide(); 0075 void lower(); 0076 void raise(); 0077 void repaint(); 0078 void setDisabled(bool disable); 0079 void setEnabled(bool); 0080 void setFocus(); 0081 void setHidden(bool hidden); 0082 void setStyleSheet(const QString &styleSheet); 0083 virtual void setVisible(bool visible) override; 0084 void setWindowModified(bool); 0085 void setWindowTitle(const QString &); 0086 void show(); 0087 void showFullScreen(); 0088 void showMaximized(); 0089 void showMinimized(); 0090 void showNormal(); 0091 void update(); 0092 }; 0093 } 0094 } 0095 Q_DECLARE_METATYPE(QtBindings::Gui::Label) 0096 #endif //GUILABEL_H