2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2014-10-10 10:21:56 +02:00
|
|
|
#include <projectexplorer/jsonwizard/jsonwizardpagefactory.h>
|
|
|
|
|
|
|
|
|
|
#include <utils/wizardpage.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QDesignerNewFormWidgetInterface;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Designer {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-10-10 10:21:56 +02:00
|
|
|
class FormPageFactory : public ProjectExplorer::JsonWizardPageFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
FormPageFactory();
|
|
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
Utils::WizardPage *create(ProjectExplorer::JsonWizard *wizard, Utils::Id typeId, const QVariant &data) override;
|
2014-10-10 10:21:56 +02:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
bool validateData(Utils::Id typeId, const QVariant &data, QString *errorMessage) override;
|
2014-10-10 10:21:56 +02:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
// A wizard page embedding Qt Designer's QDesignerNewFormWidgetInterface
|
|
|
|
|
// widget.
|
|
|
|
|
|
2014-10-10 10:21:56 +02:00
|
|
|
// Sets FormContents property.
|
|
|
|
|
|
|
|
|
|
class FormTemplateWizardPage : public Utils::WizardPage
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-07-13 18:02:35 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
public:
|
2017-10-16 20:47:05 +02:00
|
|
|
explicit FormTemplateWizardPage(QWidget *parent = nullptr);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2015-06-02 09:24:27 +02:00
|
|
|
bool isComplete () const override;
|
|
|
|
|
bool validatePage() override;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
QString templateContents() const { return m_templateContents; }
|
|
|
|
|
|
|
|
|
|
static QString stripNamespaces(const QString &className);
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void templateActivated();
|
|
|
|
|
|
2017-03-18 23:25:06 +02:00
|
|
|
private:
|
2008-12-02 12:01:29 +01:00
|
|
|
void slotCurrentTemplateChanged(bool);
|
|
|
|
|
|
|
|
|
|
QString m_templateContents;
|
2017-10-16 20:47:05 +02:00
|
|
|
QDesignerNewFormWidgetInterface *m_newFormWidget = nullptr;
|
|
|
|
|
bool m_templateSelected = false;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Designer
|