Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
58 lines (40 loc) · 1.75 KB

File metadata and controls

58 lines (40 loc) · 1.75 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include "AbstractNodeGeometry.hpp"
#include <QtGui/QFontMetrics>
namespace QtNodes {
class AbstractGraphModel;
class BasicGraphicsScene;
class NODE_EDITOR_PUBLIC DefaultHorizontalNodeGeometry : public AbstractNodeGeometry
{
public:
DefaultHorizontalNodeGeometry(AbstractGraphModel &graphModel);
public:
QSize size(NodeId const nodeId) const override;
void recomputeSize(NodeId const nodeId) const override;
QPointF portPosition(NodeId const nodeId,
PortType const portType,
PortIndex const index) const override;
QPointF portTextPosition(NodeId const nodeId,
PortType const portType,
PortIndex const PortIndex) const override;
QPointF captionPosition(NodeId const nodeId) const override;
QRectF captionRect(NodeId const nodeId) const override;
QPointF widgetPosition(NodeId const nodeId) const override;
QRect resizeHandleRect(NodeId const nodeId) const override;
private:
QRectF portTextRect(NodeId const nodeId,
PortType const portType,
PortIndex const portIndex) const;
/// Finds max number of ports and multiplies by (a port height + interval)
unsigned int maxVerticalPortsExtent(NodeId const nodeId) const;
unsigned int maxPortsTextAdvance(NodeId const nodeId, PortType const portType) const;
private:
// Some variables are mutable because we need to change drawing
// metrics corresponding to fontMetrics but this doesn't change
// constness of the Node.
mutable unsigned int _portSize;
unsigned int _portSpasing;
mutable QFontMetrics _fontMetrics;
mutable QFontMetrics _boldFontMetrics;
};
} // namespace QtNodes
Morty Proxy This is a proxified and sanitized view of the page, visit original site.