source: ntrip/trunk/BNC/qwt/qwt_text_label.h@ 9184

Last change on this file since 9184 was 8127, checked in by stoecker, 7 years ago

update qwt and qwtpolar, many QT5 fixes (unfinished)

File size: 1.8 KB
Line 
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#include <qframe.h>
16
17class QString;
18class QPaintEvent;
19class QPainter;
20
21/*!
22 \brief A Widget which displays a QwtText
23*/
24
25class QWT_EXPORT QwtTextLabel : public QFrame
26{
27 Q_OBJECT
28
29 Q_PROPERTY( int indent READ indent WRITE setIndent )
30 Q_PROPERTY( int margin READ margin WRITE setMargin )
31 Q_PROPERTY( QString plainText READ plainText WRITE setPlainText )
32
33public:
34 explicit QwtTextLabel( QWidget *parent = NULL );
35 explicit QwtTextLabel( const QwtText &, QWidget *parent = NULL );
36 virtual ~QwtTextLabel();
37
38 void setPlainText( const QString & );
39 QString plainText() const;
40
41public Q_SLOTS:
42 void setText( const QString &,
43 QwtText::TextFormat textFormat = QwtText::AutoText );
44 virtual void setText( const QwtText & );
45
46 void clear();
47
48public:
49 const QwtText &text() const;
50
51 int indent() const;
52 void setIndent( int );
53
54 int margin() const;
55 void setMargin( int );
56
57 virtual QSize sizeHint() const;
58 virtual QSize minimumSizeHint() const;
59 virtual int heightForWidth( int ) const;
60
61 QRect textRect() const;
62
63 virtual void drawText( QPainter *, const QRectF & );
64
65protected:
66 virtual void paintEvent( QPaintEvent *e );
67 virtual void drawContents( QPainter * );
68
69private:
70 void init();
71 int defaultIndent() const;
72
73 class PrivateData;
74 PrivateData *d_data;
75};
76
77#endif
Note: See TracBrowser for help on using the repository browser.