]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Correction from BR_QT4_Dev.
authornds <nds@opencascade.com>
Fri, 25 Apr 2008 07:08:40 +0000 (07:08 +0000)
committernds <nds@opencascade.com>
Fri, 25 Apr 2008 07:08:40 +0000 (07:08 +0000)
src/SUIT/SUIT_FileDlg.cxx
src/SUIT/SUIT_FileDlg.h

index 6bebf3c9cc218b06f39b60c8f4bf8e70d8121419..7d169045c7660ee3375bf35bfed452fbde357c77 100755 (executable)
@@ -553,3 +553,18 @@ QString SUIT_FileDlg::getExistingDirectory( QWidget* parent, const QString& init
   QApplication::processEvents();
   return dirname;
 }
+
+/*!
+  \brief Selects current file
+
+  This version of selectFile() methods works similar to Qt version 3.x:
+  it selects the given file as current and it changes the current file dialog's directory
+  to the directory of the file
+  
+  \param f - new current file name 
+*/
+void SUIT_FileDlg::selectFile( const QString& f )
+{
+  QFileDialog::selectFile( f );
+  setDirectory( QFileInfo( f ).absoluteDir() );
+}
index c2d7e4c44adf7072ea9dbef835c5f8ed64178cbc..1adee9e3d73f93e07036b8df60ee280019f0a489 100755 (executable)
@@ -43,6 +43,8 @@ public:
   bool                isOpenDlg()    const;    
   QString             selectedFile() const;
 
+  void                selectFile( const QString& );
+
   void                setValidator( SUIT_FileValidator* );
 
   static QString      getFileName( QWidget* parent, const QString& initial, const QStringList& filters,