added filter box and basic record filter UI (not functional yet; only supporting on-the-fly filters for now)

This commit is contained in:
Marc Zinnschlag 2013-08-11 20:39:21 +02:00
parent f5b06d5d52
commit 789a66eaa7
6 changed files with 83 additions and 1 deletions

View file

@ -116,7 +116,7 @@ opencs_hdrs_noqt (model/filter
)
opencs_units (view/filter
filtercreator
filtercreator filterbox recordfilterbox
)
set (OPENCS_US

View file

@ -0,0 +1,18 @@
#include "filterbox.hpp"
#include <QHBoxLayout>
#include "recordfilterbox.hpp"
CSVFilter::FilterBox::FilterBox (QWidget *parent)
: QWidget (parent)
{
QHBoxLayout *layout = new QHBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
layout->addWidget (new RecordFilterBox (this));
setLayout (layout);
}

View file

@ -0,0 +1,19 @@
#ifndef CSV_FILTER_FILTERBOX_H
#define CSV_FILTER_FILTERBOX_H
#include <QWidget>
namespace CSVFilter
{
class FilterBox : public QWidget
{
Q_OBJECT
public:
FilterBox (QWidget *parent = 0);
};
}
#endif

View file

@ -0,0 +1,20 @@
#include "recordfilterbox.hpp"
#include <QHBoxLayout>
#include <QLineEdit>
#include <QLabel>
CSVFilter::RecordFilterBox::RecordFilterBox (QWidget *parent)
: QWidget (parent)
{
QHBoxLayout *layout = new QHBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
layout->addWidget (new QLabel ("Record Filter", this));
layout->addWidget (new QLineEdit (this));
setLayout (layout);
}

View file

@ -0,0 +1,21 @@
#ifndef CSV_FILTER_RECORDFILTERBOX_H
#define CSV_FILTER_RECORDFILTERBOX_H
#include <QWidget>
#include <QHBoxLayout>
namespace CSVFilter
{
class RecordFilterBox : public QWidget
{
Q_OBJECT
public:
RecordFilterBox (QWidget *parent = 0);
};
}
#endif

View file

@ -5,6 +5,8 @@
#include "../../model/doc/document.hpp"
#include "../filter/filterbox.hpp"
#include "table.hpp"
#include "tablebottombox.hpp"
#include "creator.hpp"
@ -23,6 +25,8 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
layout->insertWidget (0, mTable =
new Table (id, document.getData(), document.getUndoStack(), mBottom->canCreateAndDelete()), 2);
layout->insertWidget (0, new CSVFilter::FilterBox (this));
QWidget *widget = new QWidget;
widget->setLayout (layout);