Atlas Game Manager
A game manager for f95 and dlsite written in c++
Loading...
Searching...
No Matches
ImageLoader.hpp
Go to the documentation of this file.
1//
2// Created by kj16609 on 9/23/23.
3//
4
5#pragma once
6#ifndef ATLASGAMEMANAGER_IMAGELOADER_HPP
7#define ATLASGAMEMANAGER_IMAGELOADER_HPP
8
9#include <QFuture>
10#include <QFutureWatcher>
11#include <QObject>
12#include <QPersistentModelIndex>
13#include <QPixmap>
14
15namespace atlas::images
16{
17 struct ImageLoader final : public QObject
18 {
19 Q_OBJECT
20
21 QPersistentModelIndex m_index;
23 QFutureWatcher< QPixmap > watcher {};
24
25 public:
26
27 ImageLoader( QPersistentModelIndex index, const QFuture< QPixmap > future );
28
29 void triggerReady();
30
31 ~ImageLoader() { m_future.cancel(); }
32
33 signals:
34 void imageReady( QPersistentModelIndex index );
35 };
36
37} // namespace atlas::images
38
39#endif //ATLASGAMEMANAGER_IMAGELOADER_HPP
Definition blurhash.cpp:16
QPersistentModelIndex m_index
Definition ImageLoader.hpp:21
QFuture< QPixmap > m_future
Definition ImageLoader.hpp:22
ImageLoader(QPersistentModelIndex index, const QFuture< QPixmap > future)
Definition ImageLoader.cpp:11
QFutureWatcher< QPixmap > watcher
Definition ImageLoader.hpp:23
~ImageLoader()
Definition ImageLoader.hpp:31
void triggerReady()
Definition ImageLoader.cpp:19
void imageReady(QPersistentModelIndex index)