From 8b35a2b26f73d6aa9cb4026f8d14c2df8b8de8e5 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 5 Mar 2014 19:44:49 +0400 Subject: [PATCH] ILMAB: export GEOM fields to MED file Enable addition of custom widgets --- src/SalomeApp/SalomeApp_CheckFileDlg.cxx | 39 +++++++++++++++++++----- src/SalomeApp/SalomeApp_CheckFileDlg.h | 2 +- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/SalomeApp/SalomeApp_CheckFileDlg.cxx b/src/SalomeApp/SalomeApp_CheckFileDlg.cxx index 0b4562c98..a742eb611 100644 --- a/src/SalomeApp/SalomeApp_CheckFileDlg.cxx +++ b/src/SalomeApp/SalomeApp_CheckFileDlg.cxx @@ -51,31 +51,56 @@ SUIT_FileDlg( parent, open, showQuickDir, modal ) } /*! -Constructor + Constructor */ -SalomeApp_CheckFileDlg::SalomeApp_CheckFileDlg( QWidget* parent, bool open, const QStringList& theCheckBoxNames, bool showQuickDir, bool modal) : -SUIT_FileDlg( parent, open, showQuickDir, modal ) +SalomeApp_CheckFileDlg::SalomeApp_CheckFileDlg( QWidget* parent, + bool open, + const QStringList& theCheckBoxNames, + bool showQuickDir, + bool modal, + const QList< QWidget* >& wdgList, + const bool wdgAfter) : + SUIT_FileDlg( parent, open, showQuickDir, modal ) { - if ( theCheckBoxNames.count() > 0 ) + if ( theCheckBoxNames.count() > 0 || wdgList.count() > 0 ) { - QGridLayout* grid = ::qobject_cast( layout() ); if ( grid ) { + if ( !wdgAfter ) + for ( int i = 0; i < wdgList.count(); ++i ) + { + if ( wdgList[i] ) + { + int row = grid->rowCount(); + grid->addWidget( wdgList[i], row, 1 ); + } + } + for ( int i = 0; i < theCheckBoxNames.count(); ++i ) { QCheckBox* myCheckBox = new QCheckBox( theCheckBoxNames.at(i), this ); myCheckBoxes.append( myCheckBox ); - + int row = grid->rowCount(); grid->addWidget( myCheckBox, row, 1 ); } + + if ( wdgAfter ) + for ( int i = 0; i < wdgList.count(); ++i ) + { + if ( wdgList[i] ) + { + int row = grid->rowCount(); + grid->addWidget( wdgList[i], row, 1 ); + } + } } } } /*! -Destructor + Destructor */ SalomeApp_CheckFileDlg::~SalomeApp_CheckFileDlg() { diff --git a/src/SalomeApp/SalomeApp_CheckFileDlg.h b/src/SalomeApp/SalomeApp_CheckFileDlg.h index 632991dd3..27e7b3037 100644 --- a/src/SalomeApp/SalomeApp_CheckFileDlg.h +++ b/src/SalomeApp/SalomeApp_CheckFileDlg.h @@ -35,7 +35,7 @@ class SALOMEAPP_EXPORT SalomeApp_CheckFileDlg : public SUIT_FileDlg public: SalomeApp_CheckFileDlg( QWidget*, bool open, const QString& theCheckBoxName, bool showQuickDir = true, bool modal = true ); - SalomeApp_CheckFileDlg( QWidget*, bool open, const QStringList& theCheckBoxNames, bool showQuickDir = true, bool modal = true ); + SalomeApp_CheckFileDlg( QWidget*, bool open, const QStringList& theCheckBoxNames, bool showQuickDir = true, bool modal = true, const QList< QWidget* >& = QList< QWidget* >(), const bool wdgAfter = false ); virtual ~SalomeApp_CheckFileDlg(); public: -- 2.39.2