mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Not an ideal implementation (too much logic resides in the gui QgsMapCanvasAnnotationItem class), but any approach using current api will be dependant on some hacks. Ideally we need a QgsVectorDataProvider method for finding the closest feature(s) to a point(/line/polygon) within a certain tolerance, with provider specific implementations which offload this to the data store's spatial indices. Then this handling could be bumped up to reside in QgsAnnotation.
27 lines
641 B
Plaintext
27 lines
641 B
Plaintext
class QgsHtmlAnnotation : QgsAnnotation
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgshtmlannotation.h>
|
|
%End
|
|
public:
|
|
|
|
QgsHtmlAnnotation( QObject* parent /TransferThis/ = nullptr );
|
|
|
|
~QgsHtmlAnnotation();
|
|
|
|
QSizeF minimumFrameSize() const;
|
|
|
|
void setSourceFile( const QString& htmlFile );
|
|
QString sourceFile() const;
|
|
|
|
virtual void writeXml( QDomElement& elem, QDomDocument & doc ) const;
|
|
virtual void readXml( const QDomElement& itemElem, const QDomDocument& doc );
|
|
|
|
virtual void setAssociatedFeature( const QgsFeature& feature );
|
|
|
|
protected:
|
|
|
|
void renderAnnotation( QgsRenderContext& context, QSizeF size ) const;
|
|
|
|
};
|