Commit d08fe8a7 authored by Jarosław Staniek's avatar Jarosław Staniek
Browse files

Add sorting in Forms

BUG:150372
FIXED-IN:2.9.11

Test Plan:
Open any form with nontrivial sortable data. Use sorting a->z, z->a.
Current record is unchanged but its index most likely changes, what can be observed in the record navigator.

Reviewers: piggz, wicik, wkosowicz

Subscribers: Kexi-Devel-list

Projects: #kexi, #calligra:_3.0

Differential Revision: https://phabricator.kde.org/D881

from calligra.git c1acca2808c76a297
parent bc54bad2
/* This file is part of the KDE project
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
Copyright (C) 2004-2015 Jarosław Staniek <staniek@kde.org>
Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -126,8 +126,6 @@ KexiFormScrollView::KexiFormScrollView(QWidget *parent, bool preview)
}
m_contextMenu = new QMenu(this);
m_contextMenu->setObjectName("m_contextMenu");
//! @todo sorting temporarily disabled because not it's not implemented in forms (bug 150372)
setSortingEnabled(false);
}
KexiFormScrollView::~KexiFormScrollView()
......@@ -224,7 +222,6 @@ void KexiFormScrollView::clearColumnsInternal(bool repaint)
Qt::SortOrder KexiFormScrollView::currentLocalSortOrder() const
{
//! @todo
return d->localSortOrder;
}
......@@ -235,16 +232,13 @@ int KexiFormScrollView::currentLocalSortColumn() const
void KexiFormScrollView::setLocalSortOrder(int column, Qt::SortOrder order)
{
//! @todo
d->currentLocalSortColumn = column;
d->localSortOrder = order;
}
void KexiFormScrollView::sortColumnInternal(int col, int order)
{
Q_UNUSED(col);
Q_UNUSED(order);
//! @todo
KexiDataAwareObjectInterface::sortColumnInternal(col, order);
}
void KexiFormScrollView::updateGUIAfterSorting(int previousRecord)
......
/* This file is part of the KDE project
Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
Copyright (C) 2004-2015 Jarosław Staniek <staniek@kde.org>
Copyright (C) 2004-2016 Jarosław Staniek <staniek@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -255,13 +255,16 @@ protected:
//! Implementation for KexiDataAwareObjectInterface
virtual int currentLocalSortColumn() const;
//! Implementation for KexiDataAwareObjectInterface
//! Implementation for KexiDataAwareObjectInterface. Visually does nothing
//! but remembers index of the currently sorted column and order.
virtual void setLocalSortOrder(int column, Qt::SortOrder order);
//! Implementation for KexiDataAwareObjectInterface
//! Implementation for KexiDataAwareObjectInterface.
//! Just calls KexiDataAwareObjectInterface's implementation.
void sortColumnInternal(int col, int order = 0);
//! Implementation for KexiDataAwareObjectInterface
//! Implementation for KexiDataAwareObjectInterface.
//! Nothing to do here. Record navigator is already updated.
virtual void updateGUIAfterSorting(int previousRecord);
//! Implementation for KexiDataAwareObjectInterface
......
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