OpenStructure
Loading...
Searching...
No Matches
panel_bar_widget_holder.hh
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// This file is part of the OpenStructure project <www.openstructure.org>
3//
4// Copyright (C) 2008-2020 by the OpenStructure authors
5//
6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License as published by the Free
8// Software Foundation; either version 3.0 of the License, or (at your option)
9// any later version.
10// This library is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this library; if not, write to the Free Software Foundation, Inc.,
17// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18//------------------------------------------------------------------------------
19#ifndef OST_GUI_PANEL_BAR_WIDGET_HOLDER_HH
20#define OST_GUI_PANEL_BAR_WIDGET_HOLDER_HH
21
22
24
25#include "panel_bar.hh"
26
27#include <QWidget>
28#include <QMouseEvent>
29class QToolBar;
30class QAction;
31
32/*
33 Author: Marco Biasini
34 */
35
36namespace ost { namespace gui {
37
38class SideBar;
39class Widget;
40
42 Q_OBJECT
43public:
44 PanelBarWidgetHolder(Widget* widget, Qt::Orientation orientation, QWidget* parent=NULL);
46
47 void mousePressEvent(QMouseEvent *event);
48 void mouseMoveEvent(QMouseEvent *event);
49 void dragEnterEvent(QDragEnterEvent *event);
50 void dropEvent(QDropEvent *event);
51
52public slots:
53 void Remove();
54public:
55 Widget* GetWidget() { return widget_; }
56 void SetWidget(Widget* widget);
57private slots:
58 void LabelClick(bool checked);
59private:
60 void SetupToolBar();
61 QToolBar* toolbar_;
62 Widget* widget_;
63 QAction* label_;
64 QPoint drag_start_pos_;
65};
66
67}}
68
69
70#endif
void SetWidget(Widget *widget)
void dropEvent(QDropEvent *event)
void dragEnterEvent(QDragEnterEvent *event)
PanelBarWidgetHolder(Widget *widget, Qt::Orientation orientation, QWidget *parent=NULL)
void mousePressEvent(QMouseEvent *event)
void mouseMoveEvent(QMouseEvent *event)
Base class for widgets.
Definition widget.hh:40
#define DLLEXPORT_OST_GUI
Definition base.dox:1