SILICON
Toggle main menu visibility
Loading...
Searching...
No Matches
propertyPanel.hpp
Go to the documentation of this file.
1
/*
2
Copyright (c) 2026. Giulio Cocconi
3
4
This program is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
*/
9
10
#pragma once
11
12
#include <
ui/lifetime.hpp
>
13
14
#include <functional>
15
#include <optional>
16
17
#include <QObject>
18
#include <QSpinBox>
19
20
#include <
core/serialization/projectFile.hpp
>
21
22
class
QDockWidget;
23
class
QUndoStack;
24
25
namespace
SILICON::ui
{
26
27
class
DiagramScene
;
28
class
ProjectTree
;
29
31
class
PropertyPanel
:
public
QObject {
32
public
:
33
PropertyPanel
(QDockWidget* dock,
DiagramScene
* scene,
ProjectTree
* tree,
34
QUndoStack* history,
35
std::optional<SILICON::project::ProjectInfo>& projectInfo,
36
const
QString& fileName, std::function<
void
()> rebuildTree);
37
38
void
refresh
();
39
40
private
:
41
QDockWidget*
propertyDock
;
42
DiagramScene
*
diagramScene
;
43
ProjectTree
*
projectTree
;
44
QUndoStack*
undoStack
;
45
std::optional<SILICON::project::ProjectInfo>&
currentProjectInfo
;
46
const
QString&
currentFileName
;
47
std::function<void()>
rebuildProjectTree
;
48
CallbackScope
callbacks
;
49
};
50
51
class
PropertySpinBox
:
public
QSpinBox {
52
Q_OBJECT
53
54
public
:
55
explicit
PropertySpinBox
(QWidget* parent =
nullptr
);
56
void
setMixed
(
bool
mixed,
const
QString& placeholder = QString());
57
[[nodiscard]]
bool
isMixed
()
const
;
58
59
protected
:
60
[[nodiscard]] QString
textFromValue
(
int
val)
const override
;
61
62
private
:
63
bool
m_isMixed
=
false
;
64
};
65
66
}
// namespace SILICON::ui
SILICON::ui::CallbackScope
Definition
lifetime.hpp:34
SILICON::ui::DiagramScene
Graphics scene for the circuit diagram editor.
Definition
diagramScene.hpp:118
SILICON::ui::ProjectTree
Project document navigator used by the SILICON editor.
Definition
projectTree.hpp:40
SILICON::ui::PropertyPanel::currentProjectInfo
std::optional< SILICON::project::ProjectInfo > & currentProjectInfo
Definition
propertyPanel.hpp:45
SILICON::ui::PropertyPanel::PropertyPanel
PropertyPanel(QDockWidget *dock, DiagramScene *scene, ProjectTree *tree, QUndoStack *history, std::optional< SILICON::project::ProjectInfo > &projectInfo, const QString &fileName, std::function< void()> rebuildTree)
Definition
propertyPanel.cpp:83
SILICON::ui::PropertyPanel::propertyDock
QDockWidget * propertyDock
Definition
propertyPanel.hpp:41
SILICON::ui::PropertyPanel::callbacks
CallbackScope callbacks
Definition
propertyPanel.hpp:48
SILICON::ui::PropertyPanel::refresh
void refresh()
Definition
propertyPanel.cpp:101
SILICON::ui::PropertyPanel::projectTree
ProjectTree * projectTree
Definition
propertyPanel.hpp:43
SILICON::ui::PropertyPanel::diagramScene
DiagramScene * diagramScene
Definition
propertyPanel.hpp:42
SILICON::ui::PropertyPanel::undoStack
QUndoStack * undoStack
Definition
propertyPanel.hpp:44
SILICON::ui::PropertyPanel::currentFileName
const QString & currentFileName
Definition
propertyPanel.hpp:46
SILICON::ui::PropertyPanel::rebuildProjectTree
std::function< void()> rebuildProjectTree
Definition
propertyPanel.hpp:47
SILICON::ui::PropertySpinBox::m_isMixed
bool m_isMixed
Definition
propertyPanel.hpp:63
SILICON::ui::PropertySpinBox::setMixed
void setMixed(bool mixed, const QString &placeholder=QString())
Definition
propertyPanel.cpp:432
SILICON::ui::PropertySpinBox::textFromValue
QString textFromValue(int val) const override
Definition
propertyPanel.cpp:449
SILICON::ui::PropertySpinBox::PropertySpinBox
PropertySpinBox(QWidget *parent=nullptr)
Definition
propertyPanel.cpp:427
SILICON::ui::PropertySpinBox::isMixed
bool isMixed() const
Definition
propertyPanel.cpp:444
lifetime.hpp
SILICON::ui
Definition
actionGroups.hpp:14
projectFile.hpp
src
ui
circuit
editor
propertyPanel.hpp
Generated by
1.17.0