Debian Codegraph @

src/Gui/StatusBarLabel.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 /****************************************************************************
3 * *
4 * Copyright (c) 2025 Benjamin Nauck <[email protected]> *
5 * *
6 * This file is part of FreeCAD. *
7 * *
8 * FreeCAD is free software: you can redistribute it and/or modify it *
9 * under the terms of the GNU Lesser General Public License as *
10 * published by the Free Software Foundation, either version 2.1 of the *
11 * License, or (at your option) any later version. *
12 * *
13 * FreeCAD is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with FreeCAD. If not, see *
20 * <https://www.gnu.org/licenses/>. *
21 * *
22 ***************************************************************************/
23
24 #ifndef STATUSBARLABEL_H
25 #define STATUSBARLABEL_H
26
27 #include <string>
28
29 #include <QAction>
30 #include <QApplication>
31 #include <QClipboard>
32 #include <QContextMenuEvent>
33 #include <QLabel>
34 #include <QStatusBar>
35 #include <QMenu>
36
37 #include <FCGlobal.h>
38
39 #include <Base/Parameter.h>
40
41 namespace Gui
42 {
43 /**
44 * @brief Label for displaying information in the status bar
45 *
46 * A QLabel subclass that provides a context menu with additional actions
47 * similar to the standard status bar widgets.
48 */
49 class GuiExport StatusBarLabel: public QLabel
50 {
51 Q_OBJECT
52 public:
53 explicit StatusBarLabel(QWidget* parent, const std::string& parameterName = {});
54
55 protected:
56 void contextMenuEvent(QContextMenuEvent* event) override;
57 void setVisible(bool visible) override;
58
59 private:
60 ParameterGrp::handle hGrp;
61 std::string parameterName;
62 };
63
64 } // Namespace Gui
65 #endif // STATUSBARLABEL_H