Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 748 Bytes
#ifndef DELEGATE_COMMAND_H
#define DELEGATE_COMMAND_H
#include <functional>
#include <QSharedPointer>
#include <MVVM/Commands/AbstractCommand.h>
class RelayCommand : public AbstractCommand {
Q_OBJECT
public:
RelayCommand(std::function<void()> executeDelegatep,
std::function<bool()> canExecuteDelegatep,
QObject *parent = 0)
: AbstractCommand(parent)
, executeDelegate(executeDelegatep)
, canExecuteDelegate(canExecuteDelegatep) {}
void execute() Q_DECL_OVERRIDE;
bool canExecute() const Q_DECL_OVERRIDE;
public slots:
void evaluateCanExecute();
private:
std::function<void()> executeDelegate;
std::function<bool()> canExecuteDelegate;
};
#endif // DELEGATE_COMMAND_H
You can’t perform that action at this time.