7#include <QtGui/QTextDocument>
8#include <QtGui/QAbstractTextDocumentLayout>
9#include <QtGui/QPainter>
10#include <QtGui/QImage>
11#include <QtQuick/private/qquickanchors_p.h>
12#include <QtLocation/private/qdeclarativegeomap_p.h>
13#include <QtQuick/private/qquickpainteditem_p.h>
70 if (qobject_cast<QDeclarativeGeoMap *>(
parent))
92 if (m_mapSource ==
map)
100 if (m_copyrightsHtml)
101 m_copyrightsHtml->
clear();
102 m_copyrightsImage =
QImage();
103 m_mapSource =
nullptr;
110 mapSource(), &QDeclarativeGeoMap::onAttachedCopyrightNoticeVisibilityChanged);
113 if (m_mapSource->m_copyrights && !m_mapSource->m_copyrights->m_copyrightsImage.
isNull())
114 m_copyrightsImage = m_mapSource->m_copyrights->m_copyrightsImage;
121 if (m_mapSource->m_map)
143 return m_mapSource.
data();
153 m_userDefinedStyleSheet =
true;
159 if (!m_html.
isEmpty() && m_copyrightsHtml) {
160 delete m_copyrightsHtml;
162#if QT_CONFIG(texthtmlparser)
163 m_copyrightsHtml->
setHtml(m_html);
182 if (m_copyrightsHtml) {
193 if (m_copyrightsHtml) {
195 if (anchor == m_activeAnchor && !anchor.
isEmpty()) {
197 m_activeAnchor.
clear();
204 if (!m_copyrightsHtml || m_copyrightsHtml->
isEmpty())
225void QDeclarativeGeoMapCopyrightNotice::createCopyright()
228#if QT_CONFIG(cssparser)
240 q->m_copyrightsVisible = visible;
250 if (
visible == m_copyrightsVisible)
254 d->QQuickItemPrivate::setVisible(!m_copyrightsImage.
isNull() &&
visible);
260 return m_copyrightsVisible;
278 delete m_copyrightsHtml;
279 m_copyrightsHtml =
nullptr;
281 m_copyrightsImage = copyrightsImage;
287 d->QQuickItemPrivate::setVisible(m_copyrightsVisible && !m_copyrightsImage.
isNull());
295 if (copyrightsHtml.
isEmpty()) {
296 d->QQuickItemPrivate::setVisible(
false);
299 d->QQuickItemPrivate::setVisible(m_copyrightsVisible);
304#if QT_CONFIG(texthtmlparser)
307 m_html = copyrightsHtml;
310 if (!m_copyrightsHtml)
313#if QT_CONFIG(texthtmlparser)
314 m_copyrightsHtml->
setHtml(m_html);
323 if (m_userDefinedStyleSheet ||
styleSheet == m_styleSheet)
327 if (!m_html.
isEmpty() && m_copyrightsHtml) {
328 delete m_copyrightsHtml;
330#if QT_CONFIG(texthtmlparser)
331 m_copyrightsHtml->
setHtml(m_html);
QString anchorAt(const QPointF &pos) const
Returns the reference of the anchor the given position, or an empty string if no anchor exists at tha...
virtual void draw(QPainter *painter, const PaintContext &context)=0
Draws the layout with the given painter using the given context.
The QColor class provides colors based on RGB, HSV or CMYK values.
static QColor fromString(QAnyStringView name) noexcept
void setVisible(bool visible) override
void rasterizeHtmlAndUpdate()
void copyrightsChanged(const QString ©rightsHtml)
bool copyrightsVisible() const
void setStyleSheet(const QString &styleSheet)
void copyrightsImageChanged(const QImage ©rightsImage)
void anchorToBottomLeft()
void linkActivated(const QString &link)
void styleSheetChanged(const QString &styleSheet)
void mousePressEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
QDeclarativeGeoMapCopyrightNotice(QQuickItem *parent=nullptr)
\qmltype MapCopyrightNotice \instantiates QDeclarativeGeoMapCopyrightNotice \inqmlmodule QtLocation
void copyrightsVisibleChanged()
void setCopyrightsZ(qreal copyrightsZ)
QDeclarativeGeoMap * mapSource
void onCopyrightsStyleSheetChanged(const QString &styleSheet)
void mouseReleaseEvent(QMouseEvent *event) override
This event handler can be reimplemented in a subclass to receive mouse release events for an item.
void setCopyrightsVisible(bool visible)
~QDeclarativeGeoMapCopyrightNotice()
void setMapSource(QDeclarativeGeoMap *mapSource)
void paint(QPainter *painter) override
void copyrightsChanged(const QString ©rightsHtml)
void mapReadyChanged(bool ready)
void copyrightsImageChanged(const QImage ©rightsImage)
void copyrightLinkActivated(const QString &link)
void copyrightsStyleSheetChanged(const QString &styleSheet)
virtual QString copyrightsStyleSheet() const
QSize size() const
Returns the size of the image, i.e.
int width() const
Returns the width of the image.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
int height() const
Returns the height of the image.
@ Format_ARGB32_Premultiplied
void fill(uint pixel)
Fills the entire image with the given pixelValue.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
The QPainter class performs low-level painting on widgets and other paint devices.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
void setBottom(const QQuickAnchorLine &edge)
void setLeft(const QQuickAnchorLine &edge)
virtual void setVisible(bool visible)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
bool visible
\qmlproperty bool QtQuick::Item::visible
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons accepted by this item to buttons.
virtual void mousePressEvent(QMouseEvent *event)
This event handler can be reimplemented in a subclass to receive mouse press events for an item.
QQuickItem * parent
\qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
void setKeepMouseGrab(bool)
Sets whether the mouse input should remain exclusively with this item.
void update()
Schedules a call to updatePaintNode() for this item.
void setImplicitSize(qreal, qreal)
The QQuickPaintedItem class provides a way to use the QPainter API in the QML Scene Graph.
void setContentsSize(const QSize &)
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
\macro QT_RESTRICTED_CAST_FROM_ASCII
void clear()
Clears the contents of the string and makes it null.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
\reentrant \inmodule QtGui
void setHtml(const QString &html)
Replaces the entire contents of the document with the given HTML-formatted text in the html string.
bool isEmpty() const
Returns true if the document is empty; otherwise returns false.
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
QSizeF size
the actual size of the document. This is equivalent to documentLayout()->documentSize();
virtual void clear()
Clears the document.
void setDefaultStyleSheet(const QString &sheet)
void setDocumentMargin(qreal margin)
void setPlainText(const QString &text)
Replaces the entire contents of the document with the given plain text.
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
GLdouble GLdouble GLdouble GLdouble q
QQuickAnchors * anchors(QQuickItem *item)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
constexpr QRgb qPremultiply(QRgb x)
#define QStringLiteral(str)
\reentrant \inmodule QtGui
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent