Skip to content

Commit f0006e3

Browse files
committed
coding style
1 parent e2b351b commit f0006e3

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

cppproperties/qt_widgets/factory.hpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,38 @@ namespace tct::properties::qt_widgets
1616
{
1717
private:
1818
template<typename T>
19-
[[nodiscard]] static bool is_type(property_base* pb)
19+
[[nodiscard]]
20+
static
21+
bool
22+
is_type(property_base* pb)
2023
{
2124
return dynamic_cast<property<T>*>(pb) != nullptr;
2225
}
2326

2427
template<typename T_raw, typename T_editor>
25-
[[nodiscard]] static std::unique_ptr<QWidget> build_widget(property_base* pb)
28+
[[nodiscard]]
29+
static
30+
std::unique_ptr<QWidget> build_widget(property_base* pb)
2631
{
2732
// Make sure the editor can handle this type
2833
static_assert(std::is_same_v<T_raw, typename T_editor::type>);
2934

3035
// Convert to property<T>*
3136
property<T_raw>* p = dynamic_cast<property<T_raw>*>(pb);
32-
if (not p)
37+
if (!p)
3338
return nullptr;
3439

3540
return std::make_unique<T_editor>(*p);
3641
}
3742

3843
public:
39-
[[nodiscard]] static std::unique_ptr<QWidget> build_widget(property_base* pb)
44+
[[nodiscard]]
45+
static
46+
std::unique_ptr<QWidget>
47+
build_widget(property_base* pb)
4048
{
4149
// Sanity check
42-
if (not pb)
50+
if (!pb)
4351
return nullptr;
4452

4553
// Get the appropriate widget
@@ -55,7 +63,9 @@ namespace tct::properties::qt_widgets
5563
return nullptr;
5664
}
5765

58-
[[nodiscard]] static std::unique_ptr<QWidget> build_form(tct::properties::properties& p)
66+
[[nodiscard]]
67+
static
68+
std::unique_ptr<QWidget> build_form(tct::properties::properties& p)
5969
{
6070
// Layout
6171
QFormLayout* layout = new QFormLayout;
@@ -64,15 +74,14 @@ namespace tct::properties::qt_widgets
6474
std::unique_ptr<QWidget> w;
6575
{
6676
// Nested?
67-
if (auto n = p.get_nested_properties(property_name); n) {
77+
if (auto n = p.get_nested_properties(property_name); n)
6878
w = std::make_unique<nested>();
69-
}
7079

7180
// Regular property
7281
else
7382
w = build_widget(property_value);
7483
}
75-
if (not w)
84+
if (!w)
7685
w = std::make_unique<QWidget>();
7786

7887
// Add to layout
@@ -88,4 +97,3 @@ namespace tct::properties::qt_widgets
8897
};
8998

9099
}
91-

0 commit comments

Comments
 (0)