1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
|
/*
* python-qwt. Python wrapper for the Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
* Copyright (C) 2015 Gudjon I. Gudjonsson
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
class QwtTextEngine
{
%TypeHeaderCode
#include <qwt_text_engine.h>
%End
public:
virtual ~QwtTextEngine();
virtual double heightForWidth( const QFont &font, int flags, const QString &text, double width ) const = 0;
virtual QSizeF textSize( const QFont &font, int flags, const QString &text ) const = 0;
virtual bool mightRender( const QString &text ) const = 0;
virtual void textMargins( const QFont &font, const QString &text, double &left, double &right, double &top, double &bottom ) const = 0;
virtual void draw( QPainter *painter, const QRectF &rect, int flags, const QString &text ) const = 0;
protected:
QwtTextEngine();
};
class QwtPlainTextEngine: QwtTextEngine
{
%TypeHeaderCode
#include <qwt_text_engine.h>
%End
public:
QwtPlainTextEngine();
virtual ~QwtPlainTextEngine();
virtual double heightForWidth( const QFont &font, int flags,
const QString &text, double width ) const;
virtual QSizeF textSize( const QFont &font, int flags,
const QString &text ) const;
virtual void draw( QPainter *painter, const QRectF &rect,
int flags, const QString &text ) const;
virtual bool mightRender( const QString & ) const;
virtual void textMargins( const QFont &, const QString &,
double &left, double &right, double &top, double &bottom ) const;
/*private:
class PrivateData;
PrivateData *d_data;*/
};
/*#ifndef QT_NO_RICHTEXT
class QWT_EXPORT QwtRichTextEngine: public QwtTextEngine
{
public:
QwtRichTextEngine();
virtual double heightForWidth( const QFont &font, int flags,
const QString &text, double width ) const;
virtual QSizeF textSize( const QFont &font, int flags,
const QString &text ) const;
virtual void draw( QPainter *painter, const QRectF &rect,
int flags, const QString &text ) const;
virtual bool mightRender( const QString & ) const;
virtual void textMargins( const QFont &, const QString &,
double &left, double &right, double &top, double &bottom ) const;
private:
QString taggedText( const QString &, int flags ) const;
};
#endif // !QT_NO_RICHTEXT
*/
|