2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2013-01-08 16:20:26 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-01-08 16:20:26 +01:00
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
2015-04-01 17:19:43 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
2013-01-08 16:20:26 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QScrollArea;
|
|
|
|
|
class QLabel;
|
|
|
|
|
class QImage;
|
|
|
|
|
class QContextMenuEvent;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2022-07-05 15:37:08 +02:00
|
|
|
namespace Debugger::Internal {
|
|
|
|
|
|
2013-01-08 16:20:26 +01:00
|
|
|
class ImageWidget;
|
|
|
|
|
|
|
|
|
|
// Image viewer showing images in scroll area, displays color on click.
|
|
|
|
|
class ImageViewer : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2022-07-05 15:37:08 +02:00
|
|
|
|
2013-01-08 16:20:26 +01:00
|
|
|
public:
|
2018-02-01 10:59:24 +01:00
|
|
|
explicit ImageViewer(QWidget *parent = nullptr);
|
2013-01-08 16:20:26 +01:00
|
|
|
|
2015-04-01 17:19:43 +02:00
|
|
|
void setImage(const QImage &image);
|
|
|
|
|
void setInfo(const QString &description);
|
2013-01-08 16:20:26 +01:00
|
|
|
|
2015-04-01 17:19:43 +02:00
|
|
|
private:
|
2018-02-01 10:59:24 +01:00
|
|
|
void contextMenuEvent(QContextMenuEvent *) final;
|
2013-01-08 16:20:26 +01:00
|
|
|
void clicked(const QString &);
|
|
|
|
|
|
|
|
|
|
QScrollArea *m_scrollArea;
|
|
|
|
|
ImageWidget *m_imageWidget;
|
|
|
|
|
QLabel *m_infoLabel;
|
|
|
|
|
QString m_info;
|
|
|
|
|
};
|
|
|
|
|
|
2015-04-01 17:19:43 +02:00
|
|
|
class PlotViewer : public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2022-07-05 15:37:08 +02:00
|
|
|
|
2015-04-01 17:19:43 +02:00
|
|
|
public:
|
2018-02-01 10:59:24 +01:00
|
|
|
explicit PlotViewer(QWidget *parent = nullptr);
|
2015-04-01 17:19:43 +02:00
|
|
|
|
2018-07-23 22:28:49 +02:00
|
|
|
using Data = std::vector<double>;
|
2015-04-01 17:19:43 +02:00
|
|
|
void setData(const Data &data);
|
|
|
|
|
void setInfo(const QString &description);
|
|
|
|
|
|
2018-02-01 10:59:24 +01:00
|
|
|
void paintEvent(QPaintEvent *ev) final;
|
2015-04-01 17:19:43 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Data m_data;
|
|
|
|
|
QString m_info;
|
|
|
|
|
};
|
2022-07-05 15:37:08 +02:00
|
|
|
|
|
|
|
|
} // Debugger::Internal
|