20 #include "qcustomplot.h"
43 QCustomPlot custom_plot;
48 EXPECT_EQ(custom_plot.xAxis->range().lower, 1.0);
49 EXPECT_EQ(custom_plot.xAxis->range().upper, 2.0);
54 EXPECT_FALSE(stack->canRedo());
55 EXPECT_FALSE(stack->canUndo());
56 EXPECT_EQ(stack->index(), 0);
57 EXPECT_EQ(stack->count(), 0);
61 EXPECT_FALSE(stack->canRedo());
62 EXPECT_TRUE(stack->canUndo());
63 EXPECT_EQ(stack->index(), 1);
64 EXPECT_EQ(stack->count(), 1);
65 EXPECT_EQ(custom_plot.xAxis->range().lower, 1.0);
66 EXPECT_EQ(custom_plot.xAxis->range().upper, 20.0);
70 EXPECT_TRUE(stack->canRedo());
71 EXPECT_FALSE(stack->canUndo());
72 EXPECT_EQ(stack->index(), 0);
73 EXPECT_EQ(stack->count(), 1);
74 EXPECT_EQ(custom_plot.xAxis->range().lower, 1.0);
75 EXPECT_EQ(custom_plot.xAxis->range().upper, 2.0);
79 EXPECT_FALSE(stack->canRedo());
80 EXPECT_TRUE(stack->canUndo());
81 EXPECT_EQ(stack->index(), 1);
82 EXPECT_EQ(stack->count(), 1);
83 EXPECT_EQ(custom_plot.xAxis->range().lower, 1.0);
84 EXPECT_EQ(custom_plot.xAxis->range().upper, 20.0);
static const std::string P_MAX
static const std::string P_MIN
void setItem(SessionItem *item)
void setProperty(const std::string &tag, const T &value)
Sets value to property item.
Main class to hold hierarchy of SessionItem objects.
void setUndoRedoEnabled(bool value)
Sets undo/redo either enabled or disabled. By default undo/redo is disabled.
T * insertItem(SessionItem *parent=nullptr, const TagRow &tagrow={})
Inserts item into given parent under given tagrow.
UndoStackInterface * undoStack() const
Returns command stack to perform undo/redo.
Item to represent viewport axis.
Establishes communication between QCPAxis and ViewportAxisItem.
Testing various undo/redo scenario.
materialitems.h Collection of materials to populate MaterialModel.
TEST_F(UndoScenarioTest, undoViewportSetRange)
Check undo/redo of ViewportAxisItem range, when it is listened by the controller.