12,951
回編集
(→画像の表示) |
(→画像の表示) |
||
112行目: | 112行目: | ||
|- | |- | ||
! style="background-color:#00ffff;" | データ | ! style="background-color:#00ffff;" | データ | ||
! style="background-color:#00ffff;" | | ! style="background-color:#00ffff;" | 画像の取得例(QPixmapクラス) | ||
|- | |- | ||
| 標準画像 || QPixmap Pixmap = style()->standardPixmap(QStyle::SP_MediaPlay); | | 標準画像 || QPixmap Pixmap = style()->standardPixmap(QStyle::SP_MediaPlay); | ||
161行目: | 161行目: | ||
ui->label->setPixmap(pix.scaled(<横のピクセル>, <縦のピクセル>)); | ui->label->setPixmap(pix.scaled(<横のピクセル>, <縦のピクセル>)); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<br><br> | |||
== カーソル == | |||
ラベルコントロール上のカーソルの画像を変更するには、<code>QLabel</code>クラスの<code>setCursor</code>メソッドを使用する。<br> | |||
<center> | |||
{| class="wikitable" style="background-color:#fefefe;" | |||
|- | |||
! style="background-color:#00ffff;" | データ | |||
! style="background-color:#00ffff;" | カーソル画像の取得例(QCursorクラス) | |||
|- | |||
| 標準画像 || QCursor Cursor = QCursor(style()->standardPixmap(QStyle::SP_MediaPlay));<br>label->setCursor(Cursor); | |||
|- | |||
| 標準カーソル || Qcursor Cursor = Qt::WaitCursor;<br>label->setCursor(Cursor); | |||
|- | |||
| リソース || QCursor Cursor = QCursor(QPixmap(":/images/mouse01.png"));<br>label->setCursor(Cursor); | |||
|- | |||
| ファイル || QCursor Cursor = QCursor(QPixmap("C:/temp/testimage.ico"));<br>label->setCursor(Cursor); | |||
|} | |||
</center> | |||
<br><br> | <br><br> | ||
__FORCETOC__ | __FORCETOC__ | ||
[[カテゴリ:Qt]] | [[カテゴリ:Qt]] |