BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
qdesigner_widgetbox_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the Qt Designer of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists for the convenience
47 // of Qt Designer. This header
48 // file may change from version to version without notice, or even be removed.
49 //
50 // We mean it.
51 //
52 
53 // Patched JWu 12nov20 because QFlags(0) was deprecated
54 
55 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_WIDGETBOX_QDESIGNER_WIDGETBOX_P_H
56 #define BORNAGAIN_GUI_COREGUI_VIEWS_WIDGETBOX_QDESIGNER_WIDGETBOX_P_H
57 
59 #include <QtDesigner/QDesignerWidgetBoxInterface>
60 
61 QT_BEGIN_NAMESPACE
62 
63 class DomUI;
64 
65 namespace qdesigner_internal {
66 
67 // A widget box with a load mode that allows for updating custom widgets.
68 
69 class QDESIGNER_SHARED_EXPORT QDesignerWidgetBox : public QDesignerWidgetBoxInterface {
70  Q_OBJECT
71 public:
72  enum LoadMode { LoadMerge, LoadReplace, LoadCustomWidgetsOnly };
73 
74  explicit QDesignerWidgetBox(QWidget* parent = 0, Qt::WindowFlags flags = {});
75 
76  LoadMode loadMode() const;
78 
79  virtual bool loadContents(const QString& contents) = 0;
80 
81  // Convenience to access the widget box icon of a widget. Empty category
82  // matches all
83  virtual QIcon iconForWidget(const QString& className, const QString& category = "") const = 0;
84 
85  // Convenience to find a widget by class name. Empty category matches all
86  static bool findWidget(const QDesignerWidgetBoxInterface* wbox, const QString& className,
87  const QString& category /* = "" */, Widget* widgetData);
88  // Convenience functions to create a DomWidget from widget box xml.
89  static DomUI* xmlToUi(const QString& name, const QString& xml, bool insertFakeTopLevel,
90  QString* errorMessage);
91  static DomUI* xmlToUi(const QString& name, const QString& xml, bool insertFakeTopLevel);
92 
93 private:
95 };
96 } // namespace qdesigner_internal
97 
98 QT_END_NAMESPACE
99 
100 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_WIDGETBOX_QDESIGNER_WIDGETBOX_P_H
Definition: ui4_p.h:160
virtual QIcon iconForWidget(const QString &className, const QString &category="") const =0
QDesignerWidgetBox(QWidget *parent=0, Qt::WindowFlags flags={})
static DomUI * xmlToUi(const QString &name, const QString &xml, bool insertFakeTopLevel)
static DomUI * xmlToUi(const QString &name, const QString &xml, bool insertFakeTopLevel, QString *errorMessage)
static bool findWidget(const QDesignerWidgetBoxInterface *wbox, const QString &className, const QString &category, Widget *widgetData)
virtual bool loadContents(const QString &contents)=0
QString const & name(EShape k)
Definition: particles.cpp:21
#define QDESIGNER_SHARED_EXPORT