forked from foruok/stockMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstock.h
46 lines (39 loc) · 985 Bytes
/
stock.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
#ifndef STOCK_H
#define STOCK_H
#include <QObject>
class StockDetail;
class StockProvider;
class StockState : public QObject
{
Q_OBJECT
Q_PROPERTY(QString loss READ loss WRITE setLoss)
Q_PROPERTY(QString gain READ gain WRITE setGain)
public:
StockState();
StockState(const StockState & rhs);
~StockState();
StockState & operator=(const StockState &rhs)
{
m_detail = rhs.m_detail;
m_provider = rhs.m_provider;
m_indexInProvider = rhs.m_indexInProvider;
}
QString loss();
void setLoss(QString loss);
QString gain();
void setGain(QString gain);
Q_INVOKABLE QString code();
Q_INVOKABLE QString name();
Q_INVOKABLE QString price();
Q_INVOKABLE int index();
void setProvider(StockProvider *provider)
{
m_provider = provider;
}
void setIndex(int index);
private:
StockDetail *m_detail;
StockProvider *m_provider;
int m_indexInProvider;
};
#endif // STOCK_H