QAction QAction close Action close Action new Qaction Slides: 18 Download presentation QActionクラス • 初期化例 QAction *close. Action ; //ヘッダファイル close. Action = new Qaction(“閉じる”, this); //ソースファイル(thisはMain. Windowインスタンス) • スロット接続例 connect( close. Action, SIGNAL( triggered() ), this, SLOT( close() ) ); ウィンドウを閉じる時の処理 • ユーザに問いかけを行うok. To. Continue関数の実装 bool Main. Window: : ok. To. Continue() { if(is. Window. Modified()) { //ウィンドウの”変更有り”のフラグを見る int ret = QMessage. Box: : warning(this, tr("Text. Editor"), "テキストは変更されています。n変更を保存しますか?", QMessage. Box: : Yes | QMessage. Box: : Default, QMessage. Box: : No, QMessage. Box: : Cancel | QMessage. Box: : Escape); if(ret == QMessage. Box: : Yes) return save(); //ファイル保存処理 else if(ret == QMessage. Box: : Cancel) return false; } return true; } • Yes:ファイルの保存、No:保存せずに閉じる、Cancel:保存せずウィンドウを閉じな い A new settlement that keeps close ties to its homelandSplit direct speech worksheetNew york pennsylvania new jersey delawareNew oil and new wineskinNew hartford theaterBoth new hampshire and new york desire more territoryNew-old approach to creating new venturesMarketing kotler kellerNew years old is new againNew classical and new keynesian macroeconomicsChapter 16 toward a new heaven and a new earthBoth new hampshire and new york desire more territoryNew classical and new keynesian macroeconomicsNew nationalism vs new freedom venn diagramNew york statewide senior action councilVendorismClimax graphic organizerThe lion and the mouse falling action5 stages of plot in order