Commit 1e3df898 authored by Thomas Baumgart's avatar Thomas Baumgart
Browse files

Allow to programatically select next or previoius page of a wizard

BUG: 440736
FIXED-IN: 5.1.3

(cherry picked from commit 8a4df778 and
adjusted to 5.1 branch)
parent 84fddd10
Pipeline #74098 passed with stage
in 7 minutes and 57 seconds
......@@ -196,6 +196,7 @@ void KMyMoneyAccountTreeView::keyPressEvent(QKeyEvent *event)
Q_D(KMyMoneyAccountTreeView);
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
d->openIndex(currentIndex());
emit returnPressed();
event->accept();
} else {
QTreeView::keyPressEvent(event);
......
......@@ -57,6 +57,7 @@ protected Q_SLOTS:
Q_SIGNALS:
void selectByObject(const MyMoneyObject&, eView::Intent);
void selectByVariant(const QVariantList&, eView::Intent);
void returnPressed();
private:
KMyMoneyAccountTreeViewPrivate * const d_ptr;
......
......@@ -163,3 +163,13 @@ void KMyMoneyWizard::accept()
if (page->isComplete())
QDialog::accept();
}
void KMyMoneyWizard::selectNextPage()
{
nextButtonClicked();
}
void KMyMoneyWizard::selectPreviousPage()
{
backButtonClicked();
}
......@@ -165,6 +165,10 @@ public:
virtual ~KMyMoneyWizard();
public Q_SLOTS:
void selectNextPage();
void selectPreviousPage();
Q_SIGNALS:
// /**
// * This signal is sent out, when a new payee needs to be created
......
......@@ -61,6 +61,7 @@ HierarchyPage::HierarchyPage(Wizard* wizard) :
d->ui->m_parentAccounts->sortByColumn((int)eAccountsModel::Column::Account, Qt::AscendingOrder);
connect(d->ui->m_parentAccounts->selectionModel(), &QItemSelectionModel::currentChanged, this, &HierarchyPage::parentAccountChanged);
connect(d->ui->m_parentAccounts, &KMyMoneyAccountTreeView::returnPressed, wizard, &KMyMoneyWizard::selectNextPage);
}
HierarchyPage::~HierarchyPage()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment