1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
/* This file is part of the KDE project
Copyright (C) 2012-2013 Jigar Raisinghani <jigarraisinghani@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
// Local
#include "pivotsubtotals.h"
#include "ui_pivotsubtotals.h"
#include "Sheet.h"
#include "ui/Selection.h"
using namespace Calligra::Sheets;
class PivotSubTotals::Private{
public:
Selection *selection;
Ui::PivotSubTotals mainWidget;
};
PivotSubTotals::PivotSubTotals(QWidget* parent,Selection* selection):
KDialog(parent),
d(new Private)
{
QWidget* widget = new QWidget(this);
d->mainWidget.setupUi(widget);
setMainWidget(widget);
d->selection=selection;
d->mainWidget.None->setChecked(true);
d->mainWidget.SortBy->setChecked(true);
selectLabels();
}
public:
explicit PivotOptions(QWidget* parent, Selection* selection);
~PivotOptions();
QString returnFunction();
public slots:
void on_Ok_clicked();
private:
// void selectBase();
class Private;
Private *const d;
void PivotFilters::selectLabels()
{
Sheet *const sheet = d->selection->lastSheet();
const QRect range = d->selection->lastRange();
int r = range.right();
int row = range.top();
Cell cell;
QString text;
int index = 0;
for (int i = range.left(); i <= r; ++i) {
cell = Cell(sheet, i, row);
text = cell.displayText();
if(text.length() >0)
{
d->mainWidget.LabelSelect->addItem(text);
}
}
}
PivotSubTotals::~PivotSubTotals()
{
delete d;
}
#include "PivotSubTotals.moc"
|