Obsolete Members for QMessageBox
クラスQMessageBox の以下のメンバーは非推奨です。これらは古いソース・コードの動作を維持するために提供されています。新しいコードでは使用しないことを強くお勧めします。
パブリック型
(deprecated) | Button |
パブリック関数
(deprecated) | QMessageBox(const QString &title, const QString &text, QMessageBox::Icon icon, int button0, int button1, int button2, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint) |
(deprecated in 6.2) QString | buttonText(int button) const |
(deprecated in 6.2) void | setButtonText(int button, const QString &text) |
静的パブリック・メンバー
(deprecated in 6.2) int | critical(QWidget *parent, const QString &title, const QString &text, int button0, int button1, int button2 = 0) |
(deprecated in 6.2) int | critical(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1) |
(deprecated in 6.2) int | information(QWidget *parent, const QString &title, const QString &text, int button0, int button1 = 0, int button2 = 0) |
(deprecated in 6.2) int | information(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1) |
(deprecated in 6.2) int | question(QWidget *parent, const QString &title, const QString &text, int button0, int button1 = 0, int button2 = 0) |
(deprecated in 6.2) int | question(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1) |
(deprecated in 6.2) QPixmap | standardIcon(QMessageBox::Icon icon) |
(deprecated in 6.2) int | warning(QWidget *parent, const QString &title, const QString &text, int button0, int button1, int button2 = 0) |
(deprecated in 6.2) int | warning(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1) |
メンバー型ドキュメント
[deprecated]
QMessageBox::Button
この型定義は非推奨である。新しいコードでは使用しないことを強く推奨する。
代わりにQMessageBox::StandardButton 。
メンバ関数のドキュメント
[deprecated]
QMessageBox::QMessageBox(const QString &title, const QString &text, QMessageBox::Icon icon, int button0, int button1, int button2, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint)
この関数は非推奨である。新しいコードでは使用しないことを強くお勧めします。
title 、text 、icon 、最大3つのボタンを持つメッセージボックスを構築します。
icon は以下のいずれかでなければなりません:
- QMessageBox::NoIcon
- QMessageBox::Question
- QMessageBox::Information
- QMessageBox::Warning
- QMessageBox::Critical
各ボタン、button0 、button1 、button2 は、以下のいずれかの値を持つことができます:
- QMessageBox::NoButton
- QMessageBox::Ok
- QMessageBox::Cancel
- QMessageBox::Yes
- QMessageBox::No
- QMessageBox::Abort
- QMessageBox::Retry
- QMessageBox::Ignore
- QMessageBox::YesAll
- QMessageBox::NoAll
メッセージ・ボックスのボタンを 3 つ未満にするには、後のパラメータにQMessageBox::NoButton を使用します。ボタンを全く指定しない場合、QMessageBoxはOkボタンを提供します。
ボタンの1つをQMessageBox::Default フラグと OR することで、デフォルトのボタンにすることができます(Enter が押されたときにクリックされます)。
ボタンのひとつをQMessageBox::Escape フラグと OR することで、キャンセルまたは閉じるボタンにすることができます(Esc が押されたときにクリックされます)。
QMessageBox mb("Application Name", "Hardware failure.\n\nDisk error detected\nDo you want to stop?", QMessageBox::Question, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape, QMessageBox::NoButton); if (mb.exec() == QMessageBox::No) { // try again
メッセージ・ボックスはapplication modal ダイアログ・ボックスです。
parent とf の引数はQDialog コンストラクタに渡されます。
setWindowTitle()、setText()、setIcon()も参照 。
[deprecated in 6.2]
QString QMessageBox::buttonText(int button) const
この関数は6.2から非推奨となった。新しいコードでは使わないことを強くお勧めします。
メッセージ・ボックス・ボタンbutton のテキストを返すか、メッセージ・ボックスにボタンがない場合は空文字列を返します。
代わりにbutton() とQPushButton::text() を使用してください。
setButtonText()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::critical(QWidget *parent, const QString &title, const QString &text, int button0, int button1, int button2 = 0)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
与えられたtitle とtext でクリティカルメッセージボックスを開きます。ダイアログには最大3つのボタンがあります。各ボタン・パラメータ、button0 、button1 、button2 には、以下の値のいずれかを設定することができます:
- QMessageBox::NoButton
- QMessageBox::Ok
- QMessageBox::Cancel
- QMessageBox::Yes
- QMessageBox::No
- QMessageBox::Abort
- QMessageBox::Retry
- QMessageBox::Ignore
- QMessageBox::YesAll
- QMessageBox::NoAll
3つのボタンがすべて必要でない場合は、最後のボタン、または最後の2つのボタンをQMessageBox::NoButton に設定してください。
1つのボタンはQMessageBox::Default と OR することができ、1つのボタンはQMessageBox::Escape と OR することができる。
クリックされたボタンの ID(QMessageBox::Ok 、またはQMessageBox::No など)を返します。
メッセージ・ボックスはapplication modal ダイアログ・ボックスである。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを自分で作成する必要があります。
information()、question()、warning()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::critical(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
これはオーバーロードされた関数です。
指定されたtitle とtext 、および1つ、2つ、または3つのボタンを持つクリティカルエラーメッセージボックスを表示します。クリックされたボタンの番号(0、1、2)を返します。
button0Text は最初のボタンのテキストで、省略可能です。 が与えられないと、"OK"(翻訳済み)が使われる。 は2番目のボタンのテキストで、省略可能。 は3番目のボタンのテキストで、省略可能。 (0,1,2)はデフォルト・ボタンのインデックスで、ReturnまたはEnterを押すとデフォルト・ボタンをクリックしたのと同じことになります。デフォルトは0(最初のボタン)です。 はEscapeボタンのインデックスです。Escapeを押すと、このボタンをクリックしたのと同じことになります。デフォルトは-1です。0, 1, 2を指定すると、Escapeを押したときに該当するボタンをクリックしたのと同じことになります。button0Text button1Text button2Text defaultButtonNumber escapeButtonNumber
メッセージボックスはapplication modal ダイアログボックスです。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを作成する必要があります。
information()、question()、warning()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::information(QWidget *parent, const QString &title, const QString &text, int button0, int button1 = 0, int button2 = 0)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
与えられたtitle とtext で情報メッセージボックスを開きます。 ダイアログは最大3つのボタンを持つことができます。各ボタン、button0 、button1 、button2 には、以下の値のいずれかを設定することができます:
- QMessageBox::NoButton
- QMessageBox::Ok
- QMessageBox::Cancel
- QMessageBox::Yes
- QMessageBox::No
- QMessageBox::Abort
- QMessageBox::Retry
- QMessageBox::Ignore
- QMessageBox::YesAll
- QMessageBox::NoAll
3つのボタンがすべて必要でない場合は、最後のボタン、または最後の2つのボタンをQMessageBox::NoButton に設定します。
1つのボタンはQMessageBox::Default と OR することができ、1つのボタンはQMessageBox::Escape と OR することができる。
クリックされたボタンの ID(QMessageBox::Ok 、またはQMessageBox::No など)を返します。
メッセージ・ボックスはapplication modal ダイアログ・ボックスである。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを自分で作成する必要があります。
question()、warning()、critical()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::information(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
これはオーバーロードされた関数です。
与えられたtitle とtext 、および1つ、2つ、または3つのボタンを持つ情報メッセージボックスを表示します。クリックされたボタンのインデックス(0、1、2)を返します。
button0Text は最初のボタンのテキストで、省略可能です。 が与えられないと、"OK"(翻訳済み)が使われます。 は2番目のボタンのテキストで、省略可能です。 は3番目のボタンのテキストで、省略可能です。 (0、1または2)はデフォルト・ボタンのインデックスで、ReturnまたはEnterを押すとデフォルト・ボタンをクリックしたのと同じことになります。デフォルトは0(最初のボタン)です。 はエスケープボタンのインデックスです。 を押すと、このボタンをクリックしたのと同じことになります。デフォルトは-1です。 を押すと、該当するボタンをクリックしたのと同じになるように、0、1、2を指定してください。button0Text button1Text button2Text defaultButtonNumber escapeButtonNumber Esc Esc
メッセージ・ボックスはapplication modal ダイアログ・ボックスです。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを作成する必要があります。
question()、warning()、critical()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::question(QWidget *parent, const QString &title, const QString &text, int button0, int button1 = 0, int button2 = 0)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
与えられたtitle とtext で質問メッセージボックスを開きます。ダイアログには最大3つのボタンがあります。各ボタン、button0 、button1 、button2 には、以下の値のいずれかを設定することができます:
- QMessageBox::NoButton
- QMessageBox::Ok
- QMessageBox::Cancel
- QMessageBox::Yes
- QMessageBox::No
- QMessageBox::Abort
- QMessageBox::Retry
- QMessageBox::Ignore
- QMessageBox::YesAll
- QMessageBox::NoAll
3つのボタンがすべて必要でない場合は、最後のボタン、または最後の2つのボタンをQMessageBox::NoButton に設定してください。
1つのボタンはQMessageBox::Default と OR することができ、1つのボタンはQMessageBox::Escape と OR することができる。
クリックされたボタンの ID(QMessageBox::Yes 、またはQMessageBox::No など)を返します。
メッセージ・ボックスはapplication modal ダイアログ・ボックスである。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを自分で作成する必要があります。
information()、warning()、critical()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::question(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
これはオーバーロードされた関数です。
与えられたtitle とtext 、および1つ、2つ、または3つのボタンを持つ質問メッセージボックスを表示します。クリックされたボタンのインデックス(0、1、2)を返します。
button0Text は最初のボタンのテキストで、省略可能です。 が与えられないと、"OK"(翻訳済み)が使われます。 は2番目のボタンのテキストで、省略可能です。 は3番目のボタンのテキストで、省略可能です。 (0、1または2)はデフォルト・ボタンのインデックスで、ReturnまたはEnterを押すとデフォルト・ボタンをクリックしたのと同じことになります。デフォルトは0(最初のボタン)です。 はEscapeボタンのインデックスです。Escapeを押すと、このボタンをクリックしたのと同じことになります。デフォルトは-1です。0, 1, 2を指定すると、Escapeを押したときに該当するボタンをクリックしたのと同じことになります。button0Text button1Text button2Text defaultButtonNumber escapeButtonNumber
メッセージボックスはapplication modal ダイアログボックスです。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを作成する必要があります。
information()、warning()、critical()も参照してください 。
[deprecated in 6.2]
void QMessageBox::setButtonText(int button, const QString &text)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
メッセージ・ボックス・ボタンbutton のテキストをtext に設定します。 メッセージ・ボックスにないボタンのテキストを設定しても、無視されます。
代わりにaddButton() を使用してください。
buttonText()も参照してください 。
[static, deprecated in 6.2]
QPixmap QMessageBox::standardIcon(QMessageBox::Icon icon)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
標準的なアイコンに使用されている pixmap を返します。これにより、より複雑なメッセージボックスで pixmap を使用することができます。icon は必要なアイコンを指定します。例えば、QMessageBox::Question 、QMessageBox::Information 、QMessageBox::Warning 、QMessageBox::Critical などです。
代わりにQStyle::SP_MessageBoxInformation などを指定してQStyle::standardIcon() を呼び出します。
[static, deprecated in 6.2]
int QMessageBox::warning(QWidget *parent, const QString &title, const QString &text, int button0, int button1, int button2 = 0)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
与えられたtitle とtext で警告メッセージボックスを開きます。ダイアログには最大3つのボタンがあります。各ボタン・パラメータ、button0 、button1 、button2 には、以下の値のいずれかを設定することができます:
- QMessageBox::NoButton
- QMessageBox::Ok
- QMessageBox::Cancel
- QMessageBox::Yes
- QMessageBox::No
- QMessageBox::Abort
- QMessageBox::Retry
- QMessageBox::Ignore
- QMessageBox::YesAll
- QMessageBox::NoAll
3つのボタンがすべて必要でない場合は、最後のボタン、または最後の2つのボタンをQMessageBox::NoButton に設定してください。
1つのボタンはQMessageBox::Default と OR することができ、1つのボタンはQMessageBox::Escape と OR することができます。
クリックされたボタンの ID (QMessageBox::Ok またはQMessageBox::No または ...) を返します。
メッセージ・ボックスはapplication modal ダイアログ・ボックスである。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用して、ダイアログを自分で作成する必要があります。
information()、question()、critical()も参照してください 。
[static, deprecated in 6.2]
int QMessageBox::warning(QWidget *parent, const QString &title, const QString &text, const QString &button0Text, const QString &button1Text = QString(), const QString &button2Text = QString(), int defaultButtonNumber = 0, int escapeButtonNumber = -1)
この関数は6.2から非推奨となった。新しいコードでは使用しないことを強くお勧めします。
代わりにStandardButtons を取るオーバーロードを使用してください。
これはオーバーロードされた関数です。
与えられたtitle とtext 、および1つ、2つ、または3つのボタンを持つ警告メッセージボックスを表示します。クリックされたボタンの番号(0、1、2)を返します。
button0Text は最初のボタンのテキストで、省略可能です。 が与えられない場合、"OK"(翻訳済み)が使用されます。 は2番目のボタンのテキストで、省略可能です。 は3番目のボタンのテキストで、省略可能です。 (0,1,2)はデフォルト・ボタンのインデックスで、ReturnまたはEnterを押すとデフォルト・ボタンをクリックしたのと同じことになります。デフォルトは0(最初のボタン)です。 はEscapeボタンのインデックスです。Escapeを押すと、このボタンをクリックしたのと同じことになります。デフォルトは-1です。0, 1, 2を指定すると、Escapeを押したときに該当するボタンをクリックしたのと同じことになります。button0Text button1Text button2Text defaultButtonNumber escapeButtonNumber
メッセージボックスはapplication modal ダイアログボックスです。
警告 ダイアログの実行中にparent を削除しないでください。これを行いたい場合は、QMessageBox コンストラクタのいずれかを使用してダイアログを作成する必要があります。
information()、question()、critical()も参照してください 。
© 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.