Loading...
Searching...
No Matches
InspectorSectionWidget.hpp
1#pragma once
2#include <score/widgets/ArrowButton.hpp>
3#include <score/widgets/MarginLess.hpp>
4
5#include <QLineEdit>
6#include <QPushButton>
7#include <QString>
8#include <QToolButton>
9#include <QVBoxLayout>
10#include <QWidget>
11
12#include <score_lib_inspector_export.h>
13
14#include <verdigris>
15class QMenu;
16
17namespace Inspector
18{
19class SCORE_LIB_INSPECTOR_EXPORT MenuButton final : public QToolButton
20{
21public:
22 MenuButton(QWidget* parent);
23};
24
32class SCORE_LIB_INSPECTOR_EXPORT InspectorSectionWidget : public QWidget
33{
35public:
36 explicit InspectorSectionWidget(bool editable = false, QWidget* parent = nullptr);
38 QString name, bool nameEditable = false, QWidget* parent = nullptr);
40
41 QMenu* menu() const { return m_menu; }
42 QString name() const;
43
44 // Display tool
45 void expand(bool b);
46
47 // Manage section
49 void renameSection(QString newName);
50
52 void addContent(QWidget* newWidget);
53
55 void removeContent(QWidget* toRemove);
56
57 void removeAll();
58 void showMenu(bool b);
59
60public:
61 void nameChanged(QString newName)
62 E_SIGNAL(SCORE_LIB_INSPECTOR_EXPORT, nameChanged, newName)
63
64private:
65 score::MarginLess<QVBoxLayout> m_generalLayout;
67 QWidget m_title;
69
70 score::ArrowButton m_unfoldBtn;
72 QPushButton m_buttonTitle;
73 QLineEdit m_sectionTitle;
74 MenuButton m_menuBtn;
75 QMenu* m_menu{};
76
77 bool m_isUnfolded{};
78};
79}
InspectorSectionWidget is widget that can fold or unfold his content.
Definition InspectorSectionWidget.hpp:33
Definition InspectorSectionWidget.hpp:20
Definition ArrowButton.hpp:11
The MarginLess class.
Definition MarginLess.hpp:14
Classes used for making and extending the inspector (default right panel).
Definition lib/score/widgets/Layout.hpp:27