OpenMS
Loading...
Searching...
No Matches
EnhancedTabBar.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11// OpenMS_GUI config
12#include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
13
14//QT
15#include <QTabBar>
16class QMouseEvent;
17class QMimeData;
18
19namespace OpenMS
20{
21
33 class OPENMS_GUI_DLLAPI EnhancedTabBar :
34 public QTabBar
35 {
36 Q_OBJECT
37public:
39 EnhancedTabBar(QWidget * parent = nullptr);
40
42 ~EnhancedTabBar() override;
43
45 void setTabText(const QString& text);
46
48 int addTab(const std::string & text, int id);
49
51 void show(int id);
52
53public slots:
55 void removeId(int id);
56
57signals:
59 void currentIdChanged(int id);
60
62 void closeRequested(int id);
63
65 void dropOnTab(const QMimeData * data, QWidget * source, int id);
66
68 void dropOnWidget(const QMimeData * data, QWidget * source);
69
70protected:
72
73 void mouseDoubleClickEvent(QMouseEvent * e) override;
74 void contextMenuEvent(QContextMenuEvent * e) override;
75 void dragEnterEvent(QDragEnterEvent * e) override;
76 void dropEvent(QDropEvent * e) override;
78
80 int tabAt_(const QPoint & pos);
81
82protected slots:
84 void currentChanged_(int id);
85 };
86
87}
Convenience tab bar implementation.
Definition EnhancedTabBar.h:35
void closeRequested(int id)
Signal that indicates that the tab with identifier id is requested to be removed (double click or con...
void setTabText(const QString &text)
sets the text of the current tab
void dropEvent(QDropEvent *e) override
int tabAt_(const QPoint &pos)
Returns the QTabBar index of the tab at position pos. If there is no tab at that position -1 is retur...
void removeId(int id)
Remove the tab with identifier id.
void dragEnterEvent(QDragEnterEvent *e) override
void show(int id)
Selects the tab with identifier id.
void currentIdChanged(int id)
Signal that indicates that the current tab changed, giving the id of the Tab.
int addTab(const std::string &text, int id)
Adds a new tab with the name text and the identifier id.
void contextMenuEvent(QContextMenuEvent *e) override
~EnhancedTabBar() override
Destructor.
EnhancedTabBar(QWidget *parent=nullptr)
Constructor.
void mouseDoubleClickEvent(QMouseEvent *e) override
void dropOnWidget(const QMimeData *data, QWidget *source)
Signal that is emitted, when a drag-and-drop action ends on the unused space on the right side of the...
void dropOnTab(const QMimeData *data, QWidget *source, int id)
Signal that is emitted, when a drag-and-drop action ends on a tab.
void currentChanged_(int id)
Slot that translates the currentChanged(int) signal to currentIdChanged(int)
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19