2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-02-26 11:08:17 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-02-26 11:08:17 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-02-26 11:08:17 +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.
|
2010-02-26 11:08:17 +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
|
|
|
****************************************************************************/
|
2010-02-26 11:08:17 +01:00
|
|
|
|
|
|
|
|
#ifndef FORMEDITORSTACK_H
|
|
|
|
|
#define FORMEDITORSTACK_H
|
|
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
#include "editordata.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QStackedWidget>
|
|
|
|
|
#include <QList>
|
2010-02-26 11:08:17 +01:00
|
|
|
|
2010-03-09 10:26:20 +01:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QDesignerFormWindowInterface;
|
|
|
|
|
class QDesignerFormEditorInterface;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
namespace Core {
|
|
|
|
|
class IEditor;
|
2010-03-09 15:48:01 +01:00
|
|
|
class IMode;
|
2010-02-26 11:08:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace Designer {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
/* FormEditorStack: Maintains a stack of Qt Designer form windows embedded
|
|
|
|
|
* into a scrollarea and their associated XML editors.
|
|
|
|
|
* Takes care of updating the XML editor once design mode is left.
|
|
|
|
|
* Also updates the maincontainer resize handles when the active form
|
|
|
|
|
* window changes. */
|
2010-02-26 11:08:17 +01:00
|
|
|
class FormEditorStack : public QStackedWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-07-13 18:02:35 +02:00
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
public:
|
2010-03-09 10:26:20 +01:00
|
|
|
explicit FormEditorStack(QWidget *parent = 0);
|
|
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
void add(const EditorData &d);
|
|
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
bool setVisibleEditor(Core::IEditor *xmlEditor);
|
2010-03-10 10:21:52 +01:00
|
|
|
SharedTools::WidgetHost *formWindowEditorForXmlEditor(const Core::IEditor *xmlEditor) const;
|
|
|
|
|
SharedTools::WidgetHost *formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const;
|
2010-03-09 17:01:34 +01:00
|
|
|
|
|
|
|
|
EditorData activeEditor() const;
|
2010-02-26 11:08:17 +01:00
|
|
|
|
2011-03-30 11:52:15 +02:00
|
|
|
public slots:
|
|
|
|
|
void removeFormWindowEditor(QObject *);
|
|
|
|
|
|
2010-02-26 11:08:17 +01:00
|
|
|
private slots:
|
2010-03-09 10:26:20 +01:00
|
|
|
void updateFormWindowSelectionHandles();
|
2010-03-09 15:48:01 +01:00
|
|
|
void modeAboutToChange(Core::IMode *);
|
2010-03-10 10:21:52 +01:00
|
|
|
void formSizeChanged(int w, int h);
|
2010-02-26 11:08:17 +01:00
|
|
|
|
|
|
|
|
private:
|
2011-03-30 11:52:15 +02:00
|
|
|
inline int indexOfFormWindow(const QDesignerFormWindowInterface *) const;
|
|
|
|
|
inline int indexOfFormEditor(const QObject *xmlEditor) const;
|
2010-02-26 11:08:17 +01:00
|
|
|
|
2010-03-09 15:48:01 +01:00
|
|
|
QList<EditorData> m_formEditors;
|
2010-03-09 10:26:20 +01:00
|
|
|
QDesignerFormEditorInterface *m_designerCore;
|
2010-02-26 11:08:17 +01:00
|
|
|
};
|
|
|
|
|
|
2010-03-09 10:26:20 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Designer
|
2010-02-26 11:08:17 +01:00
|
|
|
|
|
|
|
|
#endif // FORMEDITORSTACK_H
|