Qt-Advanced-Docking-System/AdvancedDockingSystem/include/ads/SectionTitleWidget.h

55 lines
1.1 KiB
C
Raw Normal View History

2015-12-09 19:21:38 +08:00
#ifndef SECTION_TITLE_WIDGET_H
#define SECTION_TITLE_WIDGET_H
#include <QPointer>
2015-12-09 19:21:38 +08:00
#include <QPoint>
#include <QFrame>
#include "ads/API.h"
#include "ads/SectionContent.h"
2015-12-09 19:21:38 +08:00
ADS_NAMESPACE_BEGIN
class ContainerWidget;
2015-12-09 19:21:38 +08:00
class SectionWidget;
class FloatingWidget;
class SectionTitleWidget : public QFrame
{
Q_OBJECT
Q_PROPERTY(bool activeTab READ isActiveTab WRITE setActiveTab NOTIFY activeTabChanged)
2015-12-09 19:21:38 +08:00
friend class ContainerWidget;
2015-12-09 19:21:38 +08:00
friend class SectionWidget;
SectionContent::RefPtr _content;
// Drag & Drop (Floating)
2015-12-09 19:21:38 +08:00
QPointer<FloatingWidget> _fw;
QPoint _dragStartPos;
// Drag & Drop (Title/Tabs)
bool _tabMoving;
// Property values
2015-12-09 19:21:38 +08:00
bool _activeTab;
public:
SectionTitleWidget(SectionContent::RefPtr content, QWidget* parent);
virtual ~SectionTitleWidget();
2015-12-09 19:21:38 +08:00
bool isActiveTab() const;
void setActiveTab(bool active);
protected:
virtual void mousePressEvent(QMouseEvent* ev);
virtual void mouseReleaseEvent(QMouseEvent* ev);
virtual void mouseMoveEvent(QMouseEvent* ev);
signals:
void activeTabChanged();
void clicked();
};
ADS_NAMESPACE_END
2016-02-12 14:15:10 +08:00
#endif