Add reset button to layer manager

This commit is contained in:
Dan Paulat 2023-10-28 05:39:54 -05:00
parent f222b4f666
commit dd7bfc7a6f
4 changed files with 50 additions and 1 deletions

View file

@ -4,6 +4,7 @@
#include <scwx/qt/model/layer_model.hpp>
#include <scwx/util/logger.hpp>
#include <QPushButton>
#include <QSortFilterProxyModel>
namespace scwx
@ -82,6 +83,12 @@ LayerDialog::~LayerDialog()
void LayerDialogImpl::ConnectSignals()
{
QObject::connect(
self_->ui->buttonBox->button(QDialogButtonBox::StandardButton::Reset),
&QAbstractButton::clicked,
self_,
[this]() { layerModel_->ResetLayers(); });
QObject::connect(self_->ui->layerFilter,
&QLineEdit::textChanged,
layerProxyModel_,

View file

@ -200,11 +200,17 @@
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
<set>QDialogButtonBox::Close|QDialogButtonBox::Reset</set>
</property>
</widget>
</item>