BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Represents data role of SessionItem in any cell of Qt's trees and tables. More...
Public Member Functions | |
ViewDataItem (SessionItem *item) | |
void | appendRow (std::vector< std::unique_ptr< ViewItem >> items) |
Appends a row containing items. More... | |
ViewItem * | child (int row, int column) const |
std::vector< ViewItem * > | children () const |
void | clear () |
int | column () const |
Returns the column where the item is located in its parent's child table, or -1 if the item has no parent. More... | |
int | columnCount () const |
Returns the number of child item columns that the item has. More... | |
QVariant | data (int role) const override |
Returns the data for given role according to Qt::ItemDataRole namespace definitions. More... | |
Qt::ItemFlags | flags () const override |
Returns Qt's item flags. More... | |
void | insertRow (int row, std::vector< std::unique_ptr< ViewItem >> items) |
Insert a row of items at index 'row'. More... | |
SessionItem * | item () const |
int | item_role () const |
ViewItem * | parent () const |
void | removeRow (int row) |
Removes row of items at given 'row'. Items will be deleted. More... | |
int | row () const |
Returns the row where the item is located in its parent's child table, or -1 if the item has no parent. More... | |
int | rowCount () const |
Returns the number of child item rows that the item has. More... | |
virtual bool | setData (const QVariant &value, int qt_role) |
Sets the data to underlying SessionItem. More... | |
Protected Member Functions | |
void | setParent (ViewItem *parent) |
Private Attributes | |
std::unique_ptr< ViewItemImpl > | p_impl |
Represents data role of SessionItem in any cell of Qt's trees and tables.
Definition at line 50 of file standardviewitems.h.
|
explicit |
|
inherited |
Appends a row containing items.
Number of items should be the same as columnCount() (if there are already some rows). If it is a first row, then items can be of any size.
Definition at line 128 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
|
inherited |
Definition at line 163 of file viewitem.cpp.
References ModelView::ViewItem::column(), ModelView::ViewItem::p_impl, and ModelView::ViewItem::row().
|
inherited |
Definition at line 237 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
Referenced by ModelView::ViewModelController::ViewModelControllerImpl::remove_children_of_view().
|
inherited |
Definition at line 151 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
|
inherited |
Returns the column where the item is located in its parent's child table, or -1 if the item has no parent.
Definition at line 190 of file viewitem.cpp.
References ModelView::ViewItem::p_impl, and ModelView::ViewItem::parent().
Referenced by ModelView::ViewItem::ViewItemImpl::child(), ModelView::ViewItem::child(), and ModelView::ViewModelBase::indexFromItem().
|
inherited |
Returns the number of child item columns that the item has.
Definition at line 120 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
Referenced by ModelView::ViewModelBase::columnCount().
|
overridevirtual |
Returns the data for given role according to Qt::ItemDataRole namespace definitions.
Converts data and roles from underlying SessionItem to what Qt expects.
Reimplemented from ModelView::ViewItem.
Definition at line 52 of file standardviewitems.cpp.
References SessionItemUtils::CheckStateRole(), ModelView::Utils::CheckStateRole(), ModelView::ViewItem::data(), SessionItemUtils::DecorationRole(), ModelView::Utils::DecorationRole(), and ModelView::ViewItem::item().
Referenced by TEST_F().
|
overridevirtual |
Returns Qt's item flags.
Converts internal SessionItem's status enable/disabled/readonly to what Qt expects.
Reimplemented from ModelView::ViewItem.
Definition at line 43 of file standardviewitems.cpp.
References ModelView::ViewItem::flags(), and ModelView::ViewItem::item().
Referenced by TEST_F().
|
inherited |
Insert a row of items at index 'row'.
Definition at line 137 of file viewitem.cpp.
References ModelView::ViewItem::p_impl, and ModelView::ViewItem::row().
|
inherited |
Definition at line 168 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
Referenced by ModelView::PropertyFlatView::PropertyFlatViewImpl::create_label(), ModelView::ViewLabelItem::data(), data(), ModelView::ViewModelController::ViewModelControllerImpl::findViews(), flags(), ModelView::ViewModel::sessionItemFromIndex(), and TEST_F().
|
inherited |
Definition at line 173 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
Referenced by TEST_F().
|
inherited |
Definition at line 158 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
Referenced by ModelView::ViewItem::column(), ModelView::ViewModelBase::indexFromItem(), ModelView::ViewModelController::ViewModelControllerImpl::remove_row_of_views(), ModelView::ViewItem::row(), and ModelView::ViewItem::setParent().
|
inherited |
Removes row of items at given 'row'. Items will be deleted.
Definition at line 146 of file viewitem.cpp.
References ModelView::ViewItem::p_impl, and ModelView::ViewItem::row().
|
inherited |
Returns the row where the item is located in its parent's child table, or -1 if the item has no parent.
Definition at line 181 of file viewitem.cpp.
References ModelView::ViewItem::p_impl, and ModelView::ViewItem::parent().
Referenced by ModelView::ViewItem::ViewItemImpl::child(), ModelView::ViewItem::child(), ModelView::ViewModelBase::indexFromItem(), ModelView::ViewItem::ViewItemImpl::insertRow(), ModelView::ViewItem::insertRow(), ModelView::ViewModelController::ViewModelControllerImpl::remove_row_of_views(), ModelView::ViewItem::ViewItemImpl::removeRow(), and ModelView::ViewItem::removeRow().
|
inherited |
Returns the number of child item rows that the item has.
Definition at line 113 of file viewitem.cpp.
References ModelView::ViewItem::p_impl.
Referenced by ModelView::ViewModelBase::rowCount().
|
virtualinherited |
Sets the data to underlying SessionItem.
Converts data and roles from Qt definitions to what SessionItem expects.
Definition at line 221 of file viewitem.cpp.
References ModelView::ViewItem::p_impl, and ModelView::Utils::toCustomVariant().
Referenced by TEST_F().
|
protectedinherited |
Definition at line 242 of file viewitem.cpp.
References ModelView::ViewItem::p_impl, and ModelView::ViewItem::parent().
|
privateinherited |
Definition at line 71 of file viewitem.h.
Referenced by ModelView::ViewItem::appendRow(), ModelView::ViewItem::child(), ModelView::ViewItem::children(), ModelView::ViewItem::clear(), ModelView::ViewItem::column(), ModelView::ViewItem::columnCount(), ModelView::ViewItem::data(), ModelView::ViewItem::insertRow(), ModelView::ViewItem::item(), ModelView::ViewItem::item_role(), ModelView::ViewItem::parent(), ModelView::ViewItem::removeRow(), ModelView::ViewItem::row(), ModelView::ViewItem::rowCount(), ModelView::ViewItem::setData(), and ModelView::ViewItem::setParent().