2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef VIEW_H
|
|
|
|
#define VIEW_H
|
|
|
|
|
2011-05-07 20:57:49 +00:00
|
|
|
#include <QtWidgets>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <QtSql>
|
|
|
|
|
|
|
|
class ImageItem;
|
|
|
|
class InformationWindow;
|
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class View : public QGraphicsView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-07-20 14:39:01 +00:00
|
|
|
View(const QString &items, const QString &images, QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 08:12:35 +00:00
|
|
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
2011-04-27 10:05:43 +00:00
|
|
|
//! [0]
|
|
|
|
|
|
|
|
//! [1]
|
|
|
|
private slots:
|
|
|
|
void updateImage(int id, const QString &fileName);
|
|
|
|
//! [1]
|
|
|
|
|
|
|
|
//! [2]
|
|
|
|
private:
|
|
|
|
void addItems();
|
2017-07-20 14:39:01 +00:00
|
|
|
InformationWindow *findWindow(int id) const;
|
2011-04-27 10:05:43 +00:00
|
|
|
void showInformation(ImageItem *image);
|
|
|
|
|
|
|
|
QGraphicsScene *scene;
|
|
|
|
QList<InformationWindow *> informationWindows;
|
|
|
|
//! [2] //! [3]
|
2013-05-22 08:52:56 +00:00
|
|
|
QSqlRelationalTableModel *itemTable;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
//! [3]
|
|
|
|
|
|
|
|
#endif
|