Files
qt-creator/tests/manual/tasking/dataexchange/recipe.h
Jarek Kobus 14f6954026 TaskTree: Disconnect from task's done() signal on destruction
If a task or task's adapter sends done() signal directly
from the destructor (which isn't really desired),
ensure we disconnect from this signal beforehand,
otherwise this may start invoking normal handling of task done()
and interfere with the destruction.

Fix NetworkQuery d'tor.

Add a test for it.

Add some TODO items.

Fixes: QTCREATORBUG-30204
Change-Id: I56a34d0f00c961c15bd1bcffef45520a4be5bce0
Reviewed-by: hjk <hjk@qt.io>
2024-01-15 08:29:57 +00:00

38 lines
805 B
C++

// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef RECIPE_H
#define RECIPE_H
#include <QImage>
#include <QMap>
#include <QUrl>
#include <optional>
namespace Tasking {
class Group;
template <typename T>
class Storage;
}
static const int s_sizeInterval = 10;
static const int s_imageCount = 100;
static const int s_maxSize = s_sizeInterval * s_imageCount;
class QNetworkAccessManager;
// TODO: Add an QObject with signal for feeding the images progressively.
class ExternalData
{
public:
QNetworkAccessManager *inputNam = nullptr;
QUrl inputUrl;
QMap<int, QImage> outputImages;
std::optional<QString> outputError;
};
Tasking::Group recipe(const Tasking::Storage<ExternalData> &externalStorage);
#endif // RECIPE_H