NDEVR
API Documentation
UpdateButton.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/Button.h>
4#include <NDEVR/UpdateChecker.h>
5namespace NDEVR
6{
10 class NDEVR_WIDGETS_API UpdateButton : public Button
11 {
12 public:
15 explicit UpdateButton(QWidget* parent = nullptr);
18 bool hasChecker() const;
19#ifndef Q_OS_WASM
25 void setUpdateAndCloseAppCallback(const std::function<void(std::function<void()>)>& close_and_update_callback);
26 protected slots:
31 protected:
32 std::function<void(std::function<void()>)> m_close_and_update_callback;
34#endif
35 };
36}
Button(QWidget *parent=nullptr)
Constructs a Button with an optional parent widget.
void updateStateSlot()
Slot that updates the button appearance when the update status changes.
UpdateButton(QWidget *parent=nullptr)
Constructs an UpdateButton with an optional parent.
void updatePercentSlot()
Slot that updates the button progress display when download progress changes.
std::function< void(std::function< void()>)> m_close_and_update_callback
Callback to close the app and apply the update.
UpdateChecker * m_checker
The UpdateChecker providing update state information.
void setUpdateAndCloseAppCallback(const std::function< void(std::function< void()>)> &close_and_update_callback)
Sets the callback invoked to close the application and apply an update.
bool hasChecker() const
Returns whether an UpdateChecker has been assigned to this button.
void setUpdateChecker(UpdateChecker *checker)
Assigns an UpdateChecker to monitor for software updates.
Provides logic for checking a source, typically online, for an update to the software.
The primary namespace for the NDEVR SDK.