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 INFORMATIONWINDOW_H
|
|
|
|
#define INFORMATIONWINDOW_H
|
|
|
|
|
2011-05-07 20:57:49 +00:00
|
|
|
#include <QtWidgets>
|
2011-04-27 10:05:43 +00:00
|
|
|
#include <QtSql>
|
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class InformationWindow : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-05-22 08:52:56 +00:00
|
|
|
InformationWindow(int id, QSqlRelationalTableModel *items,
|
2017-07-20 14:39:01 +00:00
|
|
|
QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2017-07-20 14:39:01 +00:00
|
|
|
int id() const;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void imageChanged(int id, const QString &fileName);
|
|
|
|
//! [0]
|
|
|
|
|
|
|
|
//! [1]
|
|
|
|
private slots:
|
|
|
|
void revert();
|
|
|
|
void submit();
|
|
|
|
void enableButtons(bool enable = true);
|
|
|
|
//! [1]
|
|
|
|
|
|
|
|
//! [2]
|
|
|
|
private:
|
|
|
|
void createButtons();
|
|
|
|
|
2013-05-22 08:52:56 +00:00
|
|
|
int itemId;
|
2011-04-27 10:05:43 +00:00
|
|
|
QString displayedImage;
|
|
|
|
|
2017-07-20 14:39:01 +00:00
|
|
|
QComboBox *imageFileEditor = nullptr;
|
|
|
|
QLabel *itemText = nullptr;
|
|
|
|
QTextEdit *descriptionEditor = nullptr;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2017-07-20 14:39:01 +00:00
|
|
|
QPushButton *closeButton = nullptr;
|
|
|
|
QPushButton *submitButton = nullptr;
|
|
|
|
QPushButton *revertButton = nullptr;
|
|
|
|
QDialogButtonBox *buttonBox = nullptr;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
2017-07-20 14:39:01 +00:00
|
|
|
QDataWidgetMapper *mapper = nullptr;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
//! [2]
|
|
|
|
|
|
|
|
#endif
|