HelperPanelDelegate.hpp
1 #pragma once
2 #include <score/plugins/panel/PanelDelegate.hpp>
3 
4 #include <QLabel>
5 #include <QVBoxLayout>
6 
7 namespace score
8 {
9 
11 {
12 public:
14  : PanelDelegate{ctx}
15  {
16  widg = new QWidget;
17  widg->setContentsMargins(3, 2, 3, 2);
18  widg->setMinimumHeight(100);
19  widg->setMaximumHeight(100);
20  widg->setMinimumWidth(180);
21 
22  auto l = new QVBoxLayout{widg};
23 
24  struct FasterLabel : QLabel
25  {
26  QSize sizeHint() const override { return {180, 100}; }
27  QSize minimumSizeHint() const override { return {180, 100}; }
28  int heightForWidth(int) const override { return 100; }
29  };
30 
31  status = new FasterLabel;
32  status->setTextFormat(Qt::RichText);
33  status->setText("<i>Remember those quiet evenings</i>");
34  status->setWordWrap(true);
35 
36  l->addWidget(status);
37  l->addStretch(12);
38  }
39 
40  QWidget* widget() override { return widg; }
41 
42  const PanelStatus& defaultPanelStatus() const override
43  {
44  static const PanelStatus stat{true, true, Qt::RightDockWidgetArea, -100000,
45  "Info", "info", QKeySequence::HelpContents};
46  return stat;
47  }
48  QWidget* widg{};
49  QLabel* status{};
50 };
51 }
Definition: HelperPanelDelegate.hpp:11
const PanelStatus & defaultPanelStatus() const override
defaultPanelStatus Metadata of the panel.
Definition: HelperPanelDelegate.hpp:42
QWidget * widget() override
widget The widget of the panel.
Definition: HelperPanelDelegate.hpp:40
The PanelDelegate class.
Definition: PanelDelegate.hpp:50
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Specializes ApplicationContext with the QMainWindow.
Definition: GUIApplicationContext.hpp:15
The PanelStatus struct.
Definition: PanelDelegate.hpp:24