Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_text_engine.h


Ignore:
Timestamp:
Nov 3, 2026, 10:53:35 AM (3 weeks ago)
Author:
stuerze
Message:

deprecated functions exchanged libs updated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_text_engine.h

    r9383 r11158  
    1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
     1/******************************************************************************
    22 * Qwt Widget Library
    33 * Copyright (C) 1997   Josef Wilgen
    … …  
    99
    1010#ifndef QWT_TEXT_ENGINE_H
    11 #define QWT_TEXT_ENGINE_H 1
     11#define QWT_TEXT_ENGINE_H
    1212
    1313#include "qwt_global.h"
    … …  
    2020
    2121/*!
    22   \brief Abstract base class for rendering text strings
     22   \brief Abstract base class for rendering text strings
    2323
    24   A text engine is responsible for rendering texts for a
    25   specific text format. They are used by QwtText to render a text.
     24   A text engine is responsible for rendering texts for a
     25   specific text format. They are used by QwtText to render a text.
    2626
    27   QwtPlainTextEngine and QwtRichTextEngine are part of the Qwt library.
    28   The implementation of QwtMathMLTextEngine uses code from the
    29   Qt solution package. Because of license implications it is built into
    30   a separate library.
    31 
    32   \sa QwtText::setTextEngine()
    33 */
     27   \sa QwtText::setTextEngine()
     28 */
    3429
    3530class QWT_EXPORT QwtTextEngine
    3631{
    37 public:
     32  public:
    3833    virtual ~QwtTextEngine();
    3934
    4035    /*!
    41       Find the height for a given width
     36       Find the height for a given width
    4237
    43       \param font Font of the text
    44       \param flags Bitwise OR of the flags used like in QPainter::drawText
    45       \param text Text to be rendered
    46       \param width Width
     38       \param font Font of the text
     39       \param flags Bitwise OR of the flags used like in QPainter::drawText
     40       \param text Text to be rendered
     41       \param width Width
    4742
    48       \return Calculated height
     43       \return Calculated height
    4944     */
    50     virtual double heightForWidth( const QFont &font, int flags,
    51         const QString &text, double width ) const = 0;
     45    virtual double heightForWidth( const QFont& font, int flags,
     46        const QString& text, double width ) const = 0;
    5247
    5348    /*!
    54       Returns the size, that is needed to render text
     49       Returns the size, that is needed to render text
    5550
    56       \param font Font of the text
    57       \param flags Bitwise OR of the flags like in for QPainter::drawText
    58       \param text Text to be rendered
     51       \param font Font of the text
     52       \param flags Bitwise OR of the flags like in for QPainter::drawText
     53       \param text Text to be rendered
    5954
    60       \return Calculated size
     55       \return Calculated size
    6156     */
    62     virtual QSizeF textSize( const QFont &font, int flags,
    63         const QString &text ) const = 0;
     57    virtual QSizeF textSize( const QFont& font, int flags,
     58        const QString& text ) const = 0;
    6459
    6560    /*!
    66       Test if a string can be rendered by this text engine
     61       Test if a string can be rendered by this text engine
    6762
    68       \param text Text to be tested
    69       \return true, if it can be rendered
     63       \param text Text to be tested
     64       \return true, if it can be rendered
    7065     */
    71     virtual bool mightRender( const QString &text ) const = 0;
     66    virtual bool mightRender( const QString& text ) const = 0;
    7267
    7368    /*!
    74       Return margins around the texts
     69       Return margins around the texts
    7570
    76       The textSize might include margins around the
    77       text, like QFontMetrics::descent(). In situations
    78       where texts need to be aligned in detail, knowing
    79       these margins might improve the layout calculations.
     71       The textSize might include margins around the
     72       text, like QFontMetrics::descent(). In situations
     73       where texts need to be aligned in detail, knowing
     74       these margins might improve the layout calculations.
    8075
    81       \param font Font of the text
    82       \param text Text to be rendered
    83       \param left Return value for the left margin
    84       \param right Return value for the right margin
    85       \param top Return value for the top margin
    86       \param bottom Return value for the bottom margin
     76       \param font Font of the text
     77       \param text Text to be rendered
     78       \param left Return value for the left margin
     79       \param right Return value for the right margin
     80       \param top Return value for the top margin
     81       \param bottom Return value for the bottom margin
    8782     */
    88     virtual void textMargins( const QFont &font, const QString &text,
    89         double &left, double &right, double &top, double &bottom ) const = 0;
     83    virtual void textMargins( const QFont& font, const QString& text,
     84        double& left, double& right, double& top, double& bottom ) const = 0;
    9085
    9186    /*!
    92       Draw the text in a clipping rectangle
     87       Draw the text in a clipping rectangle
    9388
    94       \param painter Painter
    95       \param rect Clipping rectangle
    96       \param flags Bitwise OR of the flags like in for QPainter::drawText()
    97       \param text Text to be rendered
     89       \param painter Painter
     90       \param rect Clipping rectangle
     91       \param flags Bitwise OR of the flags like in for QPainter::drawText()
     92       \param text Text to be rendered
    9893     */
    99     virtual void draw( QPainter *painter, const QRectF &rect,
    100         int flags, const QString &text ) const = 0;
     94    virtual void draw( QPainter* painter, const QRectF& rect,
     95        int flags, const QString& text ) const = 0;
    10196
    102 protected:
     97  protected:
    10398    QwtTextEngine();
     99
     100  private:
     101    Q_DISABLE_COPY(QwtTextEngine)
    104102};
    105103
    106104
    107105/*!
    108   \brief A text engine for plain texts
     106   \brief A text engine for plain texts
    109107
    110   QwtPlainTextEngine renders texts using the basic Qt classes
    111   QPainter and QFontMetrics.
    112 */
    113 class QWT_EXPORT QwtPlainTextEngine: public QwtTextEngine
     108   QwtPlainTextEngine renders texts using the basic Qt classes
     109   QPainter and QFontMetrics.
     110 */
     111class QWT_EXPORT QwtPlainTextEngine : public QwtTextEngine
    114112{
    115 public:
     113  public:
    116114    QwtPlainTextEngine();
    117115    virtual ~QwtPlainTextEngine();
    118116
    119     virtual double heightForWidth( const QFont &font, int flags,
    120         const QString &text, double width ) const;
     117    virtual double heightForWidth( const QFont& font, int flags,
     118        const QString& text, double width ) const QWT_OVERRIDE;
    121119
    122     virtual QSizeF textSize( const QFont &font, int flags,
    123         const QString &text ) const;
     120    virtual QSizeF textSize( const QFont& font, int flags,
     121        const QString& text ) const QWT_OVERRIDE;
    124122
    125     virtual void draw( QPainter *painter, const QRectF &rect,
    126         int flags, const QString &text ) const;
     123    virtual void draw( QPainter*, const QRectF& rect,
     124        int flags, const QString& text ) const QWT_OVERRIDE;
    127125
    128     virtual bool mightRender( const QString & ) const;
     126    virtual bool mightRender( const QString& ) const QWT_OVERRIDE;
    129127
    130     virtual void textMargins( const QFont &, const QString &,
    131         double &left, double &right, double &top, double &bottom ) const;
     128    virtual void textMargins(
     129        const QFont&, const QString&,
     130        double& left, double& right,
     131        double& top, double& bottom ) const QWT_OVERRIDE;
    132132
    133 private:
     133  private:
    134134    class PrivateData;
    135     PrivateData *d_data;
     135    PrivateData* m_data;
    136136};
    137137
    … …  
    140140
    141141/*!
    142   \brief A text engine for Qt rich texts
     142   \brief A text engine for Qt rich texts
    143143
    144   QwtRichTextEngine renders Qt rich texts using the classes
    145   of the Scribe framework of Qt.
    146 */
    147 class QWT_EXPORT QwtRichTextEngine: public QwtTextEngine
     144   QwtRichTextEngine renders Qt rich texts using the classes
     145   of the Scribe framework of Qt.
     146 */
     147class QWT_EXPORT QwtRichTextEngine : public QwtTextEngine
    148148{
    149 public:
     149  public:
    150150    QwtRichTextEngine();
    151151
    152     virtual double heightForWidth( const QFont &font, int flags,
    153         const QString &text, double width ) const;
     152    virtual double heightForWidth( const QFont& font, int flags,
     153        const QString& text, double width ) const QWT_OVERRIDE;
    154154
    155     virtual QSizeF textSize( const QFont &font, int flags,
    156         const QString &text ) const;
     155    virtual QSizeF textSize( const QFont& font, int flags,
     156        const QString& text ) const QWT_OVERRIDE;
    157157
    158     virtual void draw( QPainter *painter, const QRectF &rect,
    159         int flags, const QString &text ) const;
     158    virtual void draw( QPainter*, const QRectF& rect,
     159        int flags, const QString& text ) const QWT_OVERRIDE;
    160160
    161     virtual bool mightRender( const QString & ) const;
     161    virtual bool mightRender( const QString& ) const QWT_OVERRIDE;
    162162
    163     virtual void textMargins( const QFont &, const QString &,
    164         double &left, double &right, double &top, double &bottom ) const;
     163    virtual void textMargins(
     164        const QFont&, const QString&,
     165        double& left, double& right,
     166        double& top, double& bottom ) const QWT_OVERRIDE;
    165167
    166 private:
    167     QString taggedText( const QString &, int flags ) const;
     168  private:
     169    QString taggedText( const QString&, int flags ) const;
    168170};
    169171
Note: See TracChangeset for help on using the changeset viewer.