QPlaceIcon Class
QPlaceIconクラスはアイコンを表します。詳細...
Header: | #include <QPlaceIcon> |
qmake: | QT += location |
パブリック関数
QPlaceIcon() | |
QPlaceIcon(const QPlaceIcon &other) | |
~QPlaceIcon() | |
bool | isEmpty() const |
QPlaceManager * | manager() const |
QVariantMap | parameters() const |
void | setManager(QPlaceManager *manager) |
void | setParameters(const QVariantMap ¶meters) |
QUrl | url(const QSize &size = QSize()) const |
QPlaceIcon & | operator=(const QPlaceIcon &other) |
静的パブリックメンバ
const QString | SingleUrl |
関連する非メンバー
bool | operator!=(const QPlaceIcon &lhs, const QPlaceIcon &rhs) |
bool | operator==(const QPlaceIcon &lhs, const QPlaceIcon &rhs) |
詳細説明
アイコンの典型的な使用法は、url() 関数を使用して好みのアイコンサイズを指定することです。
QUrl iconSourceUrl = place.icon().url(QSize(32,32)); //A default icon may also be requested like so iconSourceUrl = place.icon().url();
マネージャのバックエンドが指定されたサイズをサポートしていない場合、それらのパラメータに最も近いアイコンの URL が返されます。
iconクラスには、キーと値のパラメータセットもある。正確なキーは使用するプラグインに依存します。これらのパラメータは、マネージャがどのアイコンURLを返すかに影響し、アイコンを保存する際にアイコンURLの場所を指定するために使用することもできます。
アイコンの画像が1つしかない場合、QPlaceIcon::SingleUrl をパラメータキーとして、QUrl を関連値として使用できます。このキーが設定されている場合、url()関数は常に指定されたURLを返し、どのマネージャにも委ねられない。
メンバ関数ドキュメント
QPlaceIcon::QPlaceIcon()
アイコンを構築する。
[noexcept]
QPlaceIcon::QPlaceIcon(const QPlaceIcon &other)
other のコピーを作成する。
[noexcept]
QPlaceIcon::~QPlaceIcon()
アイコンを破壊する。
bool QPlaceIcon::isEmpty() const
アイコンのすべてのフィールドが空かどうかを示すブール値を返します。
QPlaceManager *QPlaceIcon::manager() const
このアイコンが関連付けられているマネージャを返します。
注意: プロパティ・マネージャのゲッター関数です。
setManager()も参照してください 。
QVariantMap QPlaceIcon::parameters() const
マネージャ/プラグイン固有のアイコンのパラメータを返します。これらのパラメータは、マネージャがurl() をコールした際に適切な URL を返したり、アイコンを保存する際に保存先を指定したりするために使用されます。
サポートされているパラメータとその使用方法については、プラグインのドキュメントを参照してください。
注意: プロパティパラメータ用のゲッター関数です。
setParameters()も参照してください 。
void QPlaceIcon::setManager(QPlaceManager *manager)
このアイコンを関連付けるmanager を設定する。アイコンはポインタの所有権を持たない。
注: プロパティmanager のセッター関数です。
manager()も参照 。
void QPlaceIcon::setParameters(const QVariantMap ¶meters)
アイコンのパラメータをparameters に設定する。
注: プロパティのセッター関数parameters 。
parameters()も参照 。
[invokable]
QUrl QPlaceIcon::url(const QSize &size = QSize()) const
与えられたsize に従ってアイコンの URL を返す。
アイコンにマネージャが割り当てられておらず、パラメータにQPlaceIcon::SingleUrl キーが含まれていない場合、デフォルトのQUrl が返される。
注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。
[noexcept]
QPlaceIcon &QPlaceIcon::operator=(const QPlaceIcon &other)
このアイコンにother を割り当て、このアイコンへの参照を返す。
メンバー変数ドキュメント
const QString QPlaceIcon::SingleUrl
単一の画像URLのみを持つアイコン用のパラメータキー。
このキーで使用されるパラメータ値はQUrl です。 このパラメータが設定されたアイコンは、url() が呼び出されると、要求されたサイズに関係なく、常に指定された URL を返します。
関連する非会員
[noexcept]
bool operator!=(const QPlaceIcon &lhs, const QPlaceIcon &rhs)
lhs がrhs と等しくなければ真を返し、そうでなければ偽を返す。
[noexcept]
bool operator==(const QPlaceIcon &lhs, const QPlaceIcon &rhs)
lhs がrhs と等しければ真を返し、そうでなければ偽を返す。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.