NDEVR
API Documentation
DownloadDatasetWidget.h
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/File.h>
4#include <QWidget>
5namespace NDEVR
6{
7 class QTModelManager;
8 class ProgressWidget;
9 class ItemDownloader;
14 class NDEVR_API DownloadDatasetWidget : public QWidget
15 {
16 Q_OBJECT
17 public:
22 DownloadDatasetWidget(QWidget* parent = nullptr);
28 void startDownload(const StringView& url, const File& file);
38 void loadFile(const File& f);
39 protected slots:
53 signals:
58 void downloadActiveSignal(bool is_downloading);
68 protected:
73 };
74}
A core class where all Design Objects including models, materials, and geometries are stored.
void onFailureSignal()
Emitted when a download fails.
void startDownload(const StringView &url, const File &file)
Starts downloading a remote dataset from the given URL to the specified file.
void downloadActiveSignal(bool is_downloading)
Emitted when the download active state changes.
void downloadFinishedSlot()
Slot called when the download completes successfully.
File m_file
The target file for the current download.
void updatePercentSlot()
Slot called periodically to update the progress display.
void loadFile(const File &f)
Loads a previously downloaded file into the design object lookup.
void setUpdateTarget(DesignObjectLookup *lookup)
Sets the design object lookup to update once the download completes.
DownloadDatasetWidget(QWidget *parent=nullptr)
Constructs a DownloadDatasetWidget.
ProgressWidget * m_progress
The progress bar widget.
ItemDownloader * m_downloader
The downloader handling the network transfer.
void onFinishedSignal(File file)
Emitted when a download finishes successfully.
void downloadFailedSlot(StringView error)
Slot called when the download fails.
DesignObjectLookup * m_lookup
The design object lookup to update after download.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
Used for Downloading resources from a network.
Displays the progress, either horizontally as a bar or as a round spin dial.
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
The core String View class for the NDEVR API.
Definition StringView.h:58
The primary namespace for the NDEVR SDK.