1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Designer of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29//
30// W A R N I N G
31// -------------
32//
33// This file is not part of the Qt API. It exists for the convenience
34// of Qt Designer. This header
35// file may change from version to version without notice, or even be removed.
36//
37// We mean it.
38//
39
40#ifndef QTRESOURCEEDITOR_H
41#define QTRESOURCEEDITOR_H
42
43#include <QtCore/qscopedpointer.h>
44#include <QtWidgets/qdialog.h>
45
46QT_BEGIN_NAMESPACE
47
48class QtResourceModel;
49class QDesignerDialogGuiInterface;
50class QDesignerFormEditorInterface;
51
52class QtResourceEditorDialog : public QDialog
53{
54 Q_OBJECT
55public:
56 QtResourceModel *model() const;
57 void setResourceModel(QtResourceModel *model);
58
59 QString selectedResource() const;
60
61 static QString editResources(QDesignerFormEditorInterface *core, QtResourceModel *model,
62 QDesignerDialogGuiInterface *dlgGui, QWidget *parent = nullptr);
63
64 // Helper to display a message box with rcc logs in case of errors.
65 static void displayResourceFailures(const QString &logOutput, QDesignerDialogGuiInterface *dlgGui, QWidget *parent = nullptr);
66
67public slots:
68 void accept() override;
69
70private:
71 QtResourceEditorDialog(QDesignerFormEditorInterface *core, QDesignerDialogGuiInterface *dlgGui, QWidget *parent = nullptr);
72 ~QtResourceEditorDialog() override;
73
74 QScopedPointer<class QtResourceEditorDialogPrivate> d_ptr;
75 Q_DECLARE_PRIVATE(QtResourceEditorDialog)
76 Q_DISABLE_COPY_MOVE(QtResourceEditorDialog)
77
78 Q_PRIVATE_SLOT(d_func(), void slotQrcFileInserted(QtQrcFile *))
79 Q_PRIVATE_SLOT(d_func(), void slotQrcFileMoved(QtQrcFile *))
80 Q_PRIVATE_SLOT(d_func(), void slotQrcFileRemoved(QtQrcFile *))
81 Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixInserted(QtResourcePrefix *))
82 Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixMoved(QtResourcePrefix *))
83 Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixChanged(QtResourcePrefix *))
84 Q_PRIVATE_SLOT(d_func(), void slotResourceLanguageChanged(QtResourcePrefix *))
85 Q_PRIVATE_SLOT(d_func(), void slotResourcePrefixRemoved(QtResourcePrefix *))
86 Q_PRIVATE_SLOT(d_func(), void slotResourceFileInserted(QtResourceFile *))
87 Q_PRIVATE_SLOT(d_func(), void slotResourceFileMoved(QtResourceFile *))
88 Q_PRIVATE_SLOT(d_func(), void slotResourceAliasChanged(QtResourceFile *))
89 Q_PRIVATE_SLOT(d_func(), void slotResourceFileRemoved(QtResourceFile *))
90
91 Q_PRIVATE_SLOT(d_func(), void slotCurrentQrcFileChanged(QListWidgetItem *))
92 Q_PRIVATE_SLOT(d_func(), void slotCurrentTreeViewItemChanged(const QModelIndex &))
93 Q_PRIVATE_SLOT(d_func(), void slotListWidgetContextMenuRequested(const QPoint &))
94 Q_PRIVATE_SLOT(d_func(), void slotTreeViewContextMenuRequested(const QPoint &))
95 Q_PRIVATE_SLOT(d_func(), void slotTreeViewItemChanged(QStandardItem *))
96
97 Q_PRIVATE_SLOT(d_func(), void slotNewQrcFile())
98 Q_PRIVATE_SLOT(d_func(), void slotImportQrcFile())
99 Q_PRIVATE_SLOT(d_func(), void slotRemoveQrcFile())
100 Q_PRIVATE_SLOT(d_func(), void slotMoveUpQrcFile())
101 Q_PRIVATE_SLOT(d_func(), void slotMoveDownQrcFile())
102
103 Q_PRIVATE_SLOT(d_func(), void slotNewPrefix())
104 Q_PRIVATE_SLOT(d_func(), void slotAddFiles())
105 Q_PRIVATE_SLOT(d_func(), void slotChangePrefix())
106 Q_PRIVATE_SLOT(d_func(), void slotChangeLanguage())
107 Q_PRIVATE_SLOT(d_func(), void slotChangeAlias())
108 Q_PRIVATE_SLOT(d_func(), void slotClonePrefix())
109 Q_PRIVATE_SLOT(d_func(), void slotRemove())
110 Q_PRIVATE_SLOT(d_func(), void slotMoveUp())
111 Q_PRIVATE_SLOT(d_func(), void slotMoveDown())
112};
113
114QT_END_NAMESPACE
115
116#endif
117
118

source code of qttools/src/designer/src/lib/shared/qtresourceeditordialog_p.h