28 #ifndef SPLITTERORVIEW_H
29 #define SPLITTERORVIEW_H
32 #include <QMouseEvent>
45 bool restoring =
false);
48 void split(Qt::Orientation orientation,
bool restoring =
false);
51 inline bool isView()
const {
return m_view !=
nullptr; }
53 inline bool isSplitter()
const {
return m_splitter !=
nullptr; }
57 return m_view && m_view->hasGadget(uavGadget);
59 inline bool hasGadget()
const {
return m_view && (m_view->gadget() !=
nullptr); }
61 inline QSplitter *
splitter()
const {
return m_splitter; }
88 void onSplitterMoved(
int pos,
int index);
91 void unsplitAll_helper();
95 QPointer<UAVGadgetManager> m_uavGadgetManager;
98 QPointer<QStackedLayout> m_layout;
101 QPointer<UAVGadgetView> m_view;
104 QPointer<QSplitter> m_splitter;
112 #endif // SPLITTERORVIEW_H
void split(Qt::Orientation orientation, bool restoring=false)
QSize minimumSizeHint() const
UAVGadgetView * takeView()
QList< Core::IUAVGadget * > gadgets()
QSplitter * takeSplitter()
SplitterOrView * findSplitter(Core::IUAVGadget *uavGadget)
SplitterOrView(UAVGadgetManager *uavGadgetManager, Core::IUAVGadget *uavGadget=nullptr, bool restoring=false)
void saveState(QSettings *) const
Core::IUAVGadget * gadget() const
UAVGadgetView * view() const
void unsplitAll(IUAVGadget *currentGadget)
bool hasGadget(Core::IUAVGadget *uavGadget) const
SplitterOrView * findView(Core::IUAVGadget *uavGadget)
void restoreState(QSettings *)
QSplitter * splitter() const
SplitterOrView * findNextView(SplitterOrView *view)
void mousePressEvent(QMouseEvent *e)
SplitterOrView * findFirstView()