comparison layout_view.h @ 8:c63d67895cbe

layout designer: first draft
author Goffi <goffi@goffi.org>
date Wed, 24 Aug 2011 20:38:55 +0200
parents
children 0d7875c26974
comparison
equal deleted inserted replaced
7:017925589d4c 8:c63d67895cbe
1 /*
2 Bellaciao: a Salut à Toi frontend
3 Copyright (C) 2011 Jérôme Poisson (goffi@goffi.org)
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Affero General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef LAYOUT_VIEW_H
20 #define LAYOUT_VIEW_H
21
22 #include <QWidget>
23 #include <QDragEnterEvent>
24 #include "layout_widget.h"
25
26 #define LAYOUT_WIDGET_MIME "application/x-bellaciao-widget"
27
28
29 class LayoutView : public QWidget
30 {
31 Q_OBJECT
32
33 public:
34 LayoutView(QWidget* parent=0);
35 ~LayoutView();
36 void setLayoutWidgets(const QHash<QString, LayoutWidget*>& layout_widgets);
37 void dragEnterEvent (QDragEnterEvent* event );
38 void dragMoveEvent (QDragMoveEvent* event );
39 void dropEvent (QDropEvent * event);
40 protected:
41 void addWidget(const QString& name);
42 private:
43 QHash<QString, LayoutWidget*> m_layout_widgets;
44 QList<LayoutWidget> m_widgets_list;
45 QVBoxLayout* m_layout;
46 };
47 #endif