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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
|
/* 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 "pivotoptions.h"
#include "ui_pivotoptions.h"
#include<QtGui>
#include<QListWidgetItem>
#include<QListWidget>
#include<QObject>
#include <sheets/Sheet.h>
#include <sheets/ui/Selection.h>
using namespace Calligra::Sheets;
class PivotOptions::Private
{
public:
Selection *selection;
Ui::PivotOptions mainWidget;
QString function;
};//Private
PivotOptions::PivotOptions(QWidget* parent,Selection* selection):
KDialog(parent),
d(new Private)
{
setButtons(Ok|Cancel);
QWidget* widget = new QWidget;
d->mainWidget.setupUi(widget);
setCaption(i18n("Pivot Options"));
setMainWidget(widget);
d->selection= selection;
// selectBase();
enableButton(Ok,true);
d->mainWidget.SelectFunction->addItem("prod");
d->mainWidget.SelectFunction->addItem("devsq");
connect(this, SIGNAL(okClicked()), this, SLOT(on_Ok_clicked()));
}//PivotOptions
QString PivotOptions::returnFunction()
{
d->function=d->mainWidget.SelectFunction->currentText();
return d->function;
}//returnFunction
/*
void PivotOptions::selectBase()
{
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.BaseItem->addItem(text);
d->mainWidget.BaseField->addItem(text);
}
}
}
*/
void PivotOptions::on_Ok_clicked()
{
//returnFunction();
}
PivotOptions::~PivotOptions()
{
delete d;
}//~PivotOptions
|