summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/filterwidget2.cpp
blob: 9bf526a8885f5ec6b7206509e55feae41d26b94b (plain) (blame)
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
#include "desktop-widgets/filterwidget2.h"
#include "desktop-widgets/simplewidgets.h"

#include <QDoubleSpinBox>

FilterWidget2::FilterWidget2(QWidget* parent)
: QWidget(parent)
, ui(new Ui::FilterWidget2())
{
	ui->setupUi(this);
	ui->minRating->setCurrentStars(0);
	ui->maxRating->setCurrentStars(5);
	ui->minVisibility->setCurrentStars(0);
	ui->maxVisibility->setCurrentStars(5);

	connect(ui->maxRating, &StarWidget::valueChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->minRating, &StarWidget::valueChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->maxVisibility, &StarWidget::valueChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->minVisibility, &StarWidget::valueChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->maxAirTemp, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
		this, &FilterWidget2::updateFilter);

	connect(ui->minAirTemp, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
		this, &FilterWidget2::updateFilter);

	connect(ui->maxWaterTemp, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
		this, &FilterWidget2::updateFilter);

	connect(ui->minWaterTemp, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
		this, &FilterWidget2::updateFilter);

	connect(ui->from, &QDateTimeEdit::dateTimeChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->to, &QDateTimeEdit::dateTimeChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->tags, &QLineEdit::textChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->people, &QLineEdit::textChanged,
		this, &FilterWidget2::updateFilter);

	connect(ui->location, &QLineEdit::textChanged,
		this, &FilterWidget2::updateFilter);
}

void FilterWidget2::updateFilter()
{

}