inital commit
This commit is contained in:
56
src/ui/itemwidget.h
Normal file
56
src/ui/itemwidget.h
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef RELAYWIDGET_H
|
||||
#define RELAYWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <memory>
|
||||
#include <QShortcut>
|
||||
#include "itemsettingsdialog.h"
|
||||
#include "../items/item.h"
|
||||
|
||||
namespace Ui {
|
||||
class ItemWidget;
|
||||
}
|
||||
|
||||
class ItemWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
private:
|
||||
std::weak_ptr<Item> item_;
|
||||
|
||||
std::vector< std::unique_ptr<QShortcut> > shortcuts_;
|
||||
|
||||
void disable();
|
||||
|
||||
signals:
|
||||
|
||||
void deleteRequest(const ItemData& item);
|
||||
|
||||
private slots:
|
||||
void moveToValue(int value);
|
||||
void deleteItem();
|
||||
|
||||
void stepUp();
|
||||
void stepDown();
|
||||
|
||||
void f1(int state);
|
||||
void f2(int state);
|
||||
void f3(int state);
|
||||
void f4(int state);
|
||||
void reverse();
|
||||
|
||||
public:
|
||||
explicit ItemWidget(std::weak_ptr<Item> item, QWidget *parent);
|
||||
std::weak_ptr<Item> getItem();
|
||||
bool controles(const ItemData& relay);
|
||||
~ItemWidget();
|
||||
void setShortcuts(QKeySequence up, QKeySequence down, QKeySequence rev);
|
||||
|
||||
public slots:
|
||||
|
||||
void stateChanged(int state);
|
||||
|
||||
private:
|
||||
Ui::ItemWidget *ui;
|
||||
};
|
||||
|
||||
#endif // RELAYWIDGET_H
|
Reference in New Issue
Block a user