10#include "QskGraphic.h"
14#include <qshareddata.h>
34 Q_PROPERTY(
QskGraphic graphic READ graphic WRITE setGraphic )
35 Q_PROPERTY( QUrl source READ source WRITE setSource )
44 bool operator==(
const QskIcon& )
const noexcept;
45 bool operator!=(
const QskIcon& )
const noexcept;
49 void setSource(
const QUrl& );
50 QUrl source()
const noexcept;
57 QskHashValue hash( QskHashValue )
const;
62 class Data :
public QSharedData
65 ~Data() {
delete graphic; }
69 mutable QExplicitlySharedDataPointer< Data > m_data;
74inline QskIcon::QskIcon(
const QString& source )
79inline bool QskIcon::isNull()
const
81 if ( m_data->graphic )
82 return m_data->graphic->isNull();
84 return m_source.isEmpty();
87inline QUrl QskIcon::source() const noexcept
92inline QskGraphic QskIcon::maybeGraphic() const noexcept
94 return m_data->graphic ? *m_data->graphic :
QskGraphic();
97inline bool QskIcon::operator!=(
const QskIcon& other )
const noexcept
99 return ( !( *
this == other ) );
102#ifndef QT_NO_DEBUG_STREAM
106QSK_EXPORT QDebug operator<<( QDebug,
const QskIcon& );
A paint device for scalable graphics.