Skip to content

Commit a3969b9

Browse files
committed
Address AppleClang compiler warnings
1 parent 923e89b commit a3969b9

File tree

6 files changed

+5
-13
lines changed

6 files changed

+5
-13
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ target_compile_options(QtNodes
184184
PRIVATE
185185
$<$<CXX_COMPILER_ID:MSVC>:/W4 /wd4127 /EHsc>
186186
$<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra>
187+
$<$<CXX_COMPILER_ID:AppleClang>:-Wall -Wextra -Werror>
187188
)
188189
if(NOT "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
189190
# Clang-Cl on MSVC identifies as "Clang" but behaves more like MSVC:

include/QtNodes/internal/AbstractGraphModel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class NODE_EDITOR_PUBLIC AbstractGraphModel : public QObject
9191
/// Defines if detaching the connection is possible.
9292
virtual
9393
bool
94-
detachPossible(ConnectionId const connectionId) const { return true; }
94+
detachPossible(ConnectionId const) const { return true; }
9595

9696
/// Creates a new connection between two nodes.
9797
/**

src/DefaultHorizontalNodeGeometry.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "DefaultHorizontalNodeGeometry.hpp"
22

33
#include "AbstractGraphModel.hpp"
4-
#include "StyleCollection.hpp"
54
#include "NodeData.hpp"
65

76
#include <QRect>
@@ -79,8 +78,6 @@ portPosition(NodeId const nodeId,
7978
PortType const portType,
8079
PortIndex const portIndex) const
8180
{
82-
auto const& nodeStyle = StyleCollection::nodeStyle();
83-
8481
unsigned int const step = _portSize + _portSpasing;
8582

8683
QPointF result;
@@ -99,7 +96,6 @@ portPosition(NodeId const nodeId,
9996
{
10097
case PortType::In:
10198
{
102-
//double x = 0.0 - nodeStyle.ConnectionPointDiameter;
10399
double x = 0.0;
104100

105101
result = QPointF(x, totalHeight);
@@ -108,7 +104,6 @@ portPosition(NodeId const nodeId,
108104

109105
case PortType::Out:
110106
{
111-
//double x = size.width() + nodeStyle.ConnectionPointDiameter;
112107
double x = size.width();
113108

114109
result = QPointF(x, totalHeight);

src/DefaultNodePainter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ DefaultNodePainter::
2222
paint(QPainter * painter,
2323
NodeGraphicsObject & ngo) const
2424
{
25-
AbstractNodeGeometry & geometry = ngo.nodeScene()->nodeGeometry();
26-
2725
// TODO?
26+
//AbstractNodeGeometry & geometry = ngo.nodeScene()->nodeGeometry();
2827
//geometry.recomputeSizeIfFontChanged(painter->font());
2928

3029
drawNodeRect(painter, ngo);

src/DefaultVerticalNodeGeometry.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include "DefaultVerticalNodeGeometry.hpp"
22

33
#include "AbstractGraphModel.hpp"
4-
#include "StyleCollection.hpp"
54
#include "NodeData.hpp"
65

76
#include <QRect>
@@ -91,10 +90,6 @@ portPosition(NodeId const nodeId,
9190
PortType const portType,
9291
PortIndex const portIndex) const
9392
{
94-
auto const& nodeStyle = StyleCollection::nodeStyle();
95-
96-
unsigned int outPortWidth = maxPortsTextAdvance(nodeId, PortType::Out);
97-
9893
QPointF result;
9994

10095
QSize size = _graphModel.nodeData<QSize>(nodeId, NodeRole::Size);

src/NodeDelegateModel.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ portConnectionPolicy(PortType portType, PortIndex) const
4646
case PortType::Out:
4747
result = ConnectionPolicy::Many;
4848
break;
49+
case PortType::None:
50+
break;
4951
}
5052

5153
return result;

0 commit comments

Comments
 (0)