qwt_text_label.h
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_TEXT_LABEL_H
11 #define QWT_TEXT_LABEL_H
12 
13 #include "qwt_global.h"
14 #include "qwt_text.h"
15 
16 #include <qframe.h>
17 
18 class QString;
19 class QPaintEvent;
20 class QPainter;
21 
26 class QWT_EXPORT QwtTextLabel : public QFrame
27 {
28  Q_OBJECT
29 
30  Q_PROPERTY( int indent READ indent WRITE setIndent )
31  Q_PROPERTY( int margin READ margin WRITE setMargin )
32  Q_PROPERTY( QString plainText READ plainText WRITE setPlainText )
33 
34 public:
35  explicit QwtTextLabel( QWidget *parent = NULL );
36  explicit QwtTextLabel( const QwtText &, QWidget *parent = NULL );
37  virtual ~QwtTextLabel();
38 
39  void setPlainText( const QString & );
40  QString plainText() const;
41 
42 public Q_SLOTS:
43  void setText( const QString &,
44  QwtText::TextFormat textFormat = QwtText::AutoText );
45  virtual void setText( const QwtText & );
46 
47  void clear();
48 
49 public:
50  const QwtText &text() const;
51 
52  int indent() const;
53  void setIndent( int );
54 
55  int margin() const;
56  void setMargin( int );
57 
58  virtual QSize sizeHint() const QWT_OVERRIDE;
59  virtual QSize minimumSizeHint() const QWT_OVERRIDE;
60  virtual int heightForWidth( int ) const QWT_OVERRIDE;
61 
62  QRect textRect() const;
63 
64  virtual void drawText( QPainter *, const QRectF & );
65 
66 protected:
67  virtual void paintEvent( QPaintEvent * ) QWT_OVERRIDE;
68  virtual void drawContents( QPainter * );
69 
70 private:
71  void init();
72  int defaultIndent() const;
73 
74  class PrivateData;
75  PrivateData *d_data;
76 };
77 
78 #endif
A Widget which displays a QwtText.
#define QWT_EXPORT
Definition: qwt_global.h:38
A class representing a text.
Definition: qwt_text.h:51
void clear(lua_State *L, int table_index)
Definition: sol.hpp:10569
#define QWT_OVERRIDE
Definition: qwt_global.h:53


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10