-
Notifications
You must be signed in to change notification settings - Fork 1
/
options.h
49 lines (40 loc) · 1.06 KB
/
options.h
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
#ifndef OPTIONS_H
#define OPTIONS_H
#include "installer.h"
class Installer;
class Options : public QDialog
{
Q_OBJECT
public:
explicit Options(Installer *arg_parent = 0);
~Options();
void open();
private slots:
void closeEvent(QCloseEvent *event);
void valueChanged(QString text);
private:
Installer *parent;
QGroupBox *contentBox;
QLineEdit *portLine, *fileLine, *torrentLine;
};
class ClickEater : public QObject
{
Q_OBJECT
protected:
bool eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::MouseButtonRelease)
{
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
if (mouseEvent->button() != Qt::LeftButton)
return QObject::eventFilter(obj, event);
mouseEvent->accept();
QLineEdit *object = static_cast<QLineEdit*>(obj);
object->setText(QFileDialog::getExistingDirectory());
return true;
}
else
return QObject::eventFilter(obj, event);
}
};
#endif // OPTIONS_H