##// END OF EJS Templates
The binary is build into the dist dir instead of the dist/build_type dir because the build itself make already the diffence bewteen the build type...
The binary is build into the dist dir instead of the dist/build_type dir because the build itself make already the diffence bewteen the build type The coverage inclusion depends now of the build_test inclusion

File last commit:

r35:d11a38d78b7b
r50:f3ae97a0dd83
Show More
DataSourceItem.cpp
50 lines | 1.2 KiB | text/x-c | CppLexer
Alexandre Leroux
Define a data source item
r35 #include <DataSource/DataSourceItem.h>
#include <QVector>
struct DataSourceItem::DataSourceItemPrivate {
explicit DataSourceItemPrivate(QVector<QVariant> data)
: m_Parent{nullptr}, m_Children{}, m_Data{std::move(data)}
{
}
DataSourceItem *m_Parent;
std::vector<std::unique_ptr<DataSourceItem> > m_Children;
QVector<QVariant> m_Data;
};
DataSourceItem::DataSourceItem(QVector<QVariant> data)
: impl{spimpl::make_unique_impl<DataSourceItemPrivate>(data)}
{
}
void DataSourceItem::appendChild(std::unique_ptr<DataSourceItem> child) noexcept
{
child->impl->m_Parent = this;
impl->m_Children.push_back(std::move(child));
}
DataSourceItem *DataSourceItem::child(int childIndex) const noexcept
{
if (childIndex < 0 || childIndex >= childCount()) {
return nullptr;
}
else {
return impl->m_Children.at(childIndex).get();
}
}
int DataSourceItem::childCount() const noexcept
{
return impl->m_Children.size();
}
QVariant DataSourceItem::data(int dataIndex) const noexcept
{
return impl->m_Data.value(dataIndex);
}
DataSourceItem *DataSourceItem::parentItem() const noexcept
{
return impl->m_Parent;
}