From 2217d9e6676a8b51ac75140e3bb1602cfcfcc180 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 25 Apr 2008 07:08:40 +0000 Subject: [PATCH] Correction from BR_QT4_Dev. --- src/SUIT/SUIT_FileDlg.cxx | 15 +++++++++++++++ src/SUIT/SUIT_FileDlg.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/SUIT/SUIT_FileDlg.cxx b/src/SUIT/SUIT_FileDlg.cxx index 6bebf3c9c..7d169045c 100755 --- a/src/SUIT/SUIT_FileDlg.cxx +++ b/src/SUIT/SUIT_FileDlg.cxx @@ -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() ); +} diff --git a/src/SUIT/SUIT_FileDlg.h b/src/SUIT/SUIT_FileDlg.h index c2d7e4c44..1adee9e3d 100755 --- a/src/SUIT/SUIT_FileDlg.h +++ b/src/SUIT/SUIT_FileDlg.h @@ -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, -- 2.39.2