change: preserve search term across different mod providers
Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -244,7 +244,14 @@ void PageContainer::help()
|
||||
|
||||
void PageContainer::currentChanged(const QModelIndex ¤t)
|
||||
{
|
||||
showPage(current.isValid() ? m_proxyModel->mapToSource(current).row() : -1);
|
||||
int selected_index = current.isValid() ? m_proxyModel->mapToSource(current).row() : -1;
|
||||
|
||||
auto* selected = m_model->pages().at(selected_index);
|
||||
auto* previous = m_currentPage;
|
||||
|
||||
emit selectedPageChanged(previous, selected);
|
||||
|
||||
showPage(selected_index);
|
||||
}
|
||||
|
||||
bool PageContainer::prepareToClose()
|
||||
|
@ -95,6 +95,10 @@ private:
|
||||
public slots:
|
||||
void help();
|
||||
|
||||
signals:
|
||||
/** Emitted when the currently selected page is changed */
|
||||
void selectedPageChanged(BasePage* previous, BasePage* selected);
|
||||
|
||||
private slots:
|
||||
void currentChanged(const QModelIndex ¤t);
|
||||
void showPage(int row);
|
||||
|
Reference in New Issue
Block a user