-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include <QCompleter>
#include <QKeyEvent>
#include <QToolButton>
-#include <QFileDialog>
#include <QRegExpValidator>
static const char* browse_icon[] = {
updateState();
}
+/*!
+ \brief Set path file dialog options.
+ \param f new file or directory path options
+ \sa pathOptions()
+*/
+void QtxPathEdit::setPathOptions(const QFileDialog::Options options)
+{
+ if ( myOptions == options )
+ return;
+
+ myOptions = options;
+}
+
+/*!
+ \brief Get currently used path options.
+ \return file or directory path options
+ \sa setPathOptions()
+*/
+QFileDialog::Options QtxPathEdit::pathOptions() const
+{
+ return myOptions;
+}
+
+
/*!
\brief Called when user clicks "Browse" button.
switch ( pathType() )
{
case Qtx::PT_OpenFile:
- path = QFileDialog::getOpenFileName( myPath, QString(), initial, pathFilter() );
+ path = QFileDialog::getOpenFileName( myPath, QString(), initial, pathFilter(), nullptr, pathOptions() );
break;
case Qtx::PT_SaveFile:
- path = QFileDialog::getSaveFileName( myPath, QString(), initial, pathFilter() );
+ path = QFileDialog::getSaveFileName( myPath, QString(), initial, pathFilter(), nullptr, pathOptions() );
break;
case Qtx::PT_Directory:
- path = QFileDialog::getExistingDirectory( myPath, QString(), initial );
+ path = QFileDialog::getExistingDirectory( myPath, QString(), initial, pathOptions() );
break;
}