From ffa6d8b9583a87f5fa355daab94c46fb506c1a7e Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 18 Jul 2014 01:18:41 +0200 Subject: [PATCH] Use the QWidget modified property instead of the UXTEditor's own. --- .../studio/src/plugins/translation_manager/uxt_editor.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/studio/src/plugins/translation_manager/uxt_editor.cpp b/code/studio/src/plugins/translation_manager/uxt_editor.cpp index a6c4ec500..bf6e787b6 100644 --- a/code/studio/src/plugins/translation_manager/uxt_editor.cpp +++ b/code/studio/src/plugins/translation_manager/uxt_editor.cpp @@ -38,12 +38,10 @@ public: UXTEditorPvt() { t = new QTableWidget(); - changed = false; } QTableWidget *t; std::vector< STRING_MANAGER::TStringInfo > infos; - bool changed; }; @@ -141,7 +139,7 @@ void UXTEditor::saveAs( QString filename ) f.close(); - d_ptr->changed = false; + setWindowModified( false ); } void UXTEditor::activateWindow() @@ -152,7 +150,7 @@ void UXTEditor::activateWindow() void UXTEditor::closeEvent( QCloseEvent *e ) { - if( d_ptr->changed ) + if( isWindowModified() ) { int reply = QMessageBox::question( this, tr( "Table changed" ), @@ -181,7 +179,7 @@ void UXTEditor::onCellChanged( int row, int column ) if( column == 1 ) info.Text = item->text().toUtf8().constData(); - d_ptr->changed = true; + setWindowModified( true ); } void UXTEditor::setHeaderText( const QString &id, const QString &text )