21 #include <QGridLayout>
35 std::vector<int> result;
36 auto layout = flat_view.findChild<QGridLayout*>();
37 for (
int row = 0; row < layout->rowCount(); ++row)
38 for (
int col = 0; col < layout->columnCount(); ++col)
40 static_cast<int>(layout->itemAtPosition(row, col)->widget()->isEnabled()));
55 auto layout = flat_view.findChild<QGridLayout*>();
56 ASSERT_TRUE(layout !=
nullptr);
58 EXPECT_EQ(layout->rowCount(), 3);
59 EXPECT_EQ(layout->columnCount(), 2);
60 std::vector<int> expected_enabled = {1, 1, 1, 1, 1, 1};
74 auto layout = flat_view.findChild<QGridLayout*>();
75 ASSERT_TRUE(layout !=
nullptr);
77 EXPECT_EQ(layout->rowCount(), 3);
78 EXPECT_EQ(layout->columnCount(), 2);
79 std::vector<int> expected_enabled = {0, 0, 1, 1, 1, 1};
80 EXPECT_EQ(enable_status(flat_view), expected_enabled);
84 expected_enabled = {1, 1, 1, 1, 1, 1};
85 EXPECT_EQ(enable_status(flat_view), expected_enabled);
Widget holding grid layout with editors and intended for displaying all properties of given SessionIt...
void setItem(SessionItem *item)
SessionItem * setEnabled(bool value)
Sets enabled flag to given value (fluent interface).
SessionItem * getItem(const std::string &tag, int row=0) const
Returns item at given row of given tag.
Main class to hold hierarchy of SessionItem objects.
T * insertItem(SessionItem *parent=nullptr, const TagRow &tagrow={})
Inserts item into given parent under given tagrow.
Vector item with three x,y,z property items.
static const std::string P_X
Tests of PropertyFlatView class.
std::vector< int > enable_status(PropertyFlatView &flat_view)
Returns vector representing enable status of widgets in layout.
materialitems.h Collection of materials to populate MaterialModel.
TEST_F(PropertyFlatViewTest, layoutForVector)