📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)
細 文字列「__FORCETOC__」を「{{#seo: |title={{PAGENAME}} : Exploring Electronics and SUSE Linux | MochiuWiki |keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,Podman,電気回路,電子回路,基板,プリント基板 |description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This pag… |
|||
| (同じ利用者による、間の1版が非表示) | |||
| 4行目: | 4行目: | ||
== タイトルバー == | == タイトルバー == | ||
==== アイコン ==== | |||
ウインドウのタイトルバーにアイコンを指定するには、<code>setWindowIcon</code>メソッドを使用する。<br> | ウインドウのタイトルバーにアイコンを指定するには、<code>setWindowIcon</code>メソッドを使用する。<br> | ||
<center> | <center> | ||
{| class="wikitable" style="background-color:#fefefe;" | {| class="wikitable" style="background-color:#fefefe;" | ||
|- | |- | ||
! style="background-color:# | ! style="background-color:#66CCFF;" | データ | ||
! style="background-color:# | ! style="background-color:#66CCFF;" | アイコンの設定例(QIconクラス) | ||
|- | |- | ||
| 標準画像 || QIcon Icon = style()->standardIcon(QStyle::SP_MediaPlay); | | style="text-align: center;" | 標準画像 || | ||
<syntaxhighlight lang="c++">QIcon Icon = style()->standardIcon(QStyle::SP_MediaPlay); | |||
QApplication::setWindowIcon(Icon);</syntaxhighlight> | |||
|- | |- | ||
| 標準カーソル || QCursor Cursor = Qt::WaitCursor; | | style="text-align: center;" | 標準カーソル || | ||
<syntaxhighlight lang="c++">QCursor Cursor = Qt::WaitCursor; | |||
if(!Cursor.pixmap().isNull()) | |||
{ | |||
QIcon Icon = QIcon(QPixmap(csr.pixmap())); | |||
QApplication::setWindowIcon(Icon); | |||
} | |||
</syntaxhighlight> | |||
|- | |- | ||
| | | style="text-align: center;" | リソースの指定 || | ||
<syntaxhighlight lang="c++"> | |||
QIcon Icon = QIcon(":/images/mouse.png"); | |||
QApplication::setWindowIcon(Icon); | |||
</syntaxhighlight> | |||
|- | |- | ||
| | | style="text-align: center;" | ファイルパスの指定 || | ||
<syntaxhighlight lang="c++"> | |||
QIcon Icon = QIcon("C:/temp/testimage.ico"); | |||
QApplication::setWindowIcon(Icon); | |||
</syntaxhighlight> | |||
|} | |} | ||
</center> | </center> | ||
<br> | |||
==== タイトルバーの非表示 ==== | |||
<code>setWindowFlags</code>メソッドを使用して、<code>Qt::FramelessWindowHint</code>フラグを設定することにより、ウインドウのタイトルバーが非表示になる。<br> | |||
この<code>Qt::FramelessWindowHint</code>フラグを使用すると、最大化/最小化ボタン、ウインドウの境界線、タイトルバーが非表示になる。<br> | |||
<br> | |||
したがって、このフラグを使用することにより、ウインドウ全体がカスタム外観になり、デフォルトのウインドウ機能が失われる。<br> | |||
また、必要に応じて、これらの機能を再実装することもできる。<br> | |||
<syntaxhighlight lang="c++"> | |||
#include <QGUIApplication> | |||
#include <QMainwindow> | |||
int main(int argc, char *argv[]) | |||
{ | |||
QGUIApplication a(argc, argv); | |||
QMainWindow Window; | |||
// タイトルバーを非表示にする | |||
Window.setWindowFlags(Qt::FramelessWindowHint); | |||
Window.show(); | |||
return a.exec(); | |||
} | |||
</syntaxhighlight> | |||
<br><br> | <br><br> | ||
| 609行目: | 652行目: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<br><br> | <br><br> | ||
{{#seo: | |||
|title={{PAGENAME}} : Exploring Electronics and SUSE Linux | MochiuWiki | |||
|keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,Podman,電気回路,電子回路,基板,プリント基板 | |||
|description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This page is {{PAGENAME}} in our wiki about electronic circuits and SUSE Linux | |||
|image=/resources/assets/MochiuLogo_Single_Blue.png | |||
}} | |||
__FORCETOC__ | __FORCETOC__ | ||
[[カテゴリ:Qt]] | [[カテゴリ:Qt]] | ||