Utils: Make PathChooser remote support configurable in aspects

... and switch is _on_ by default.

Change-Id: I82e66da477dae1ee955b81babc6230b67e530d45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
hjk
2023-06-01 09:51:27 +02:00
parent f72a5d1832
commit 9375979698
2 changed files with 10 additions and 0 deletions

View File

@@ -670,6 +670,7 @@ public:
// Used to block recursive editingFinished signals for example when return is pressed, and
// the validation changes focus by opening a dialog
bool m_blockAutoApply = false;
bool m_allowPathFromDevice = true;
template<class Widget> void updateWidgetFromCheckStatus(StringAspect *aspect, Widget *w)
{
@@ -977,6 +978,13 @@ void StringAspect::setCommandVersionArguments(const QStringList &arguments)
d->m_pathChooserDisplay->setCommandVersionArguments(arguments);
}
void StringAspect::setAllowPathFromDevice(bool allowPathFromDevice)
{
d->m_allowPathFromDevice = allowPathFromDevice;
if (d->m_pathChooserDisplay)
d->m_pathChooserDisplay->setAllowPathFromDevice(allowPathFromDevice);
}
/*!
Sets \a elideMode as label elide mode.
*/
@@ -1122,6 +1130,7 @@ void StringAspect::addToLayout(LayoutItem &parent)
d->m_pathChooserDisplay->setPromptDialogFilter(d->m_prompDialogFilter);
d->m_pathChooserDisplay->setPromptDialogTitle(d->m_prompDialogTitle);
d->m_pathChooserDisplay->setCommandVersionArguments(d->m_commandVersionArguments);
d->m_pathChooserDisplay->setAllowPathFromDevice(d->m_allowPathFromDevice);
if (defaultValue() == value())
d->m_pathChooserDisplay->setDefaultValue(defaultValue());
else