mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Previously only some annotations had (incomplete) support for attaching to a particular vector layer and synchronising their visibility with the layer's visibility. This handling has all been moved up to QgsAnnotation, so that all annotation types can be attached to layers. This will allow selective annotation visibility based on the visible layers of a particular canvas, eg in multi-canvas environments. Additionally: - show the attached layer in the annotation properties dialog, and allow it to be cleared to always show the annotation - allow attaching annotations to non-vector layers - add unit tests for visibility
25 lines
572 B
Plaintext
25 lines
572 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 );
|
|
|
|
protected:
|
|
|
|
void renderAnnotation( QgsRenderContext& context, QSizeF size ) const;
|
|
|
|
};
|