50 EXPECT_FALSE(multiLayer->data<QVariant>().isValid());
63 EXPECT_EQ(viewModel.rowCount(), 1);
64 EXPECT_EQ(viewModel.columnCount(), 2);
67 QModelIndex mlIndex = viewModel.index(0, 0);
70 auto viewItem =
dynamic_cast<ViewLabelItem*
>(viewModel.itemFromIndex(mlIndex));
71 EXPECT_TRUE(viewItem !=
nullptr);
72 EXPECT_EQ(viewItem->item(), multiLayerItem);
76 EXPECT_EQ(viewModel.rowCount(mlIndex), 1);
77 EXPECT_EQ(viewModel.columnCount(mlIndex), 2);
89 auto views = viewModel.findViews(multiLayerItem);
90 EXPECT_EQ(views.size(), 2);
91 EXPECT_EQ(views.at(0)->item(), multiLayerItem);
103 EXPECT_EQ(labelItem.data(Qt::DisplayRole).toString().toStdString(),
TEST_F(ToyMultilayerItemTest, initialState)
Initial state.
View model to show content of SessionModel in Qt widgets: two column tree with label/data.
T * insertItem(SessionItem *parent=nullptr, const TagRow &tagrow={})
Inserts item into given parent under given tagrow.
Represents display name of SessionItem in any cell of Qt's trees and tables.
Represents a layer, with thickness and color, and possibly populated with particles.
Represents multilayer with collection of layers.
static const std::string T_LAYERS
Tests of toy MultiLayer in the context of model and viewmodel.
MVVM_MODEL_EXPORT bool IsSinglePropertyTag(const SessionItem &item, const std::string &tag)
Returns true if given item has registered tag, and it belongs to single property.
materialitems.h Collection of materials to populate MaterialModel.
const ModelView::model_type MultiLayerItemType