Loading...
Searching...
No Matches
lib/score/widgets/Layout.hpp
1#pragma once
2#include <QFormLayout>
3#include <QGridLayout>
4#include <QLabel>
5#include <QVBoxLayout>
6
7namespace score
8{
9// Custom form layout due to
10// https://stackoverflow.com/questions/41715124/qformlayout-does-not-expand-widget-full-height-to-maximum-widget-height
11
12class FormLayout : public QGridLayout
13{
14public:
15 void addRow(QString&& text, QWidget* widg)
16 {
17 const auto nextRow = rowCount();
18 addWidget(
19 new QLabel{std::move(text)}, nextRow, 0, 1, 1, Qt::AlignHCenter | Qt::AlignTop);
20 addWidget(widg, nextRow, 1, 1, 1);
21 }
22};
23}
24
25// REFACTORME - find a better name
26namespace Inspector
27{
28class Layout final : public QFormLayout
29{
30public:
31 Layout(QWidget* widg = nullptr)
32 : QFormLayout{widg}
33 {
34 this->setContentsMargins(0, 0, 0, 0);
35 this->setSpacing(3);
36 // this->setLabelAlignment(Qt::AlignRight);
37 }
38};
39
40class VBoxLayout final : public QVBoxLayout
41{
42public:
43 VBoxLayout(QWidget* widg = nullptr)
44 : QVBoxLayout{widg}
45 {
46 this->setContentsMargins(0, 0, 0, 0);
47 this->setSpacing(3);
48 }
49};
50}
Definition lib/score/widgets/Layout.hpp:29
Definition lib/score/widgets/Layout.hpp:41
Definition lib/score/widgets/Layout.hpp:13
Classes used for making and extending the inspector (default right panel).
Definition lib/score/widgets/Layout.hpp:27
Base toolkit upon which the software is built.
Definition Application.cpp:90