1// qlabel.sip generated by MetaSIP 2// 3// This file is part of the QtWidgets Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QLabel : QFrame 24{ 25%TypeHeaderCode 26#include <qlabel.h> 27%End 28 29public: 30 QLabel(QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags()); 31 QLabel(const QString &text, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::WindowFlags()); 32 virtual ~QLabel(); 33 QString text() const; 34 const QPixmap *pixmap() const; 35 const QPicture *picture() const; 36 QMovie *movie() const; 37 Qt::TextFormat textFormat() const; 38 void setTextFormat(Qt::TextFormat); 39 Qt::Alignment alignment() const; 40 void setAlignment(Qt::Alignment); 41 void setWordWrap(bool on); 42 bool wordWrap() const; 43 int indent() const; 44 void setIndent(int); 45 int margin() const; 46 void setMargin(int); 47 bool hasScaledContents() const; 48 void setScaledContents(bool); 49 virtual QSize sizeHint() const; 50 virtual QSize minimumSizeHint() const; 51 void setBuddy(QWidget * /KeepReference/); 52 QWidget *buddy() const; 53 virtual int heightForWidth(int) const; 54 bool openExternalLinks() const; 55 void setTextInteractionFlags(Qt::TextInteractionFlags flags); 56 Qt::TextInteractionFlags textInteractionFlags() const; 57 void setOpenExternalLinks(bool open); 58 59public slots: 60 void clear(); 61 void setMovie(QMovie *movie /KeepReference/); 62 void setNum(double /Constrained/); 63 void setNum(int); 64 void setPicture(const QPicture &); 65 void setPixmap(const QPixmap &); 66 void setText(const QString &); 67 68signals: 69 void linkActivated(const QString &link); 70 void linkHovered(const QString &link); 71 72protected: 73 virtual bool event(QEvent *e); 74 virtual void paintEvent(QPaintEvent *); 75 virtual void changeEvent(QEvent *); 76 virtual void keyPressEvent(QKeyEvent *ev); 77 virtual void mousePressEvent(QMouseEvent *ev); 78 virtual void mouseMoveEvent(QMouseEvent *ev); 79 virtual void mouseReleaseEvent(QMouseEvent *ev); 80 virtual void contextMenuEvent(QContextMenuEvent *ev); 81 virtual void focusInEvent(QFocusEvent *ev); 82 virtual void focusOutEvent(QFocusEvent *ev); 83 virtual bool focusNextPrevChild(bool next); 84 85public: 86 void setSelection(int, int); 87 bool hasSelectedText() const; 88 QString selectedText() const; 89 int selectionStart() const; 90}; 91