##// END OF EJS Templates
push method of worker return the id of the nextRange which is canceled
push method of worker return the id of the nextRange which is canceled

File last commit:

r520:b0a7e1650d9f
r584:d6648352006d
Show More
DataSourceItem.h
102 lines | 3.0 KiB | text/x-c | CLexer
Alexandre Leroux
Define a data source item
r35 #ifndef SCIQLOP_DATASOURCEITEM_H
#define SCIQLOP_DATASOURCEITEM_H
Alexandre Leroux
Exports core module as a shared library...
r425 #include "CoreGlobal.h"
Alexandre Leroux
Define a data source item
r35 #include <Common/spimpl.h>
#include <QVariant>
#include <QVector>
Alexandre Leroux
Defines actions for a data source items...
r135 class DataSourceItemAction;
Alexandre Leroux
Adds type for a data source item...
r78 /**
* Possible types of an item
*/
Alexandre Leroux
Changes data source item icons (1)...
r317 enum class DataSourceItemType { NODE, PRODUCT, COMPONENT };
Alexandre Leroux
Adds type for a data source item...
r78
Alexandre Leroux
Define a data source item
r35 /**
* @brief The DataSourceItem class aims to represent a structure element of a data source.
* A data source has a tree structure that is made up of a main DataSourceItem object (root)
* containing other DataSourceItem objects (children).
* For each DataSourceItem can be associated a set of data representing it.
*/
Alexandre Leroux
Exports core module as a shared library...
r425 class SCIQLOP_CORE_EXPORT DataSourceItem {
Alexandre Leroux
Define a data source item
r35 public:
Alexandre Leroux
Changes structure of data hold by the item...
r315 /// Key associated with the name of the item
static const QString NAME_DATA_KEY;
explicit DataSourceItem(DataSourceItemType type, const QString &name);
Alexandre Leroux
(Minor) Uses QVariantHash alias in DataSourceItem
r374 explicit DataSourceItem(DataSourceItemType type, QVariantHash data = {});
Alexandre Leroux
Define a data source item
r35
Alexandre Leroux
Defines actions for a data source items...
r135 /// @return the actions of the item as a vector
QVector<DataSourceItemAction *> actions() const noexcept;
/**
* Adds an action to the item. The item takes ownership of the action, and the action is
* automatically associated to the item
* @param action the action to add
*/
void addAction(std::unique_ptr<DataSourceItemAction> action) noexcept;
Alexandre Leroux
Define a data source item
r35 /**
* Adds a child to the item. The item takes ownership of the child.
* @param child the child to add
*/
void appendChild(std::unique_ptr<DataSourceItem> child) noexcept;
/**
* Returns the item's child associated to an index
* @param childIndex the index to search
* @return a pointer to the child if index is valid, nullptr otherwise
*/
DataSourceItem *child(int childIndex) const noexcept;
int childCount() const noexcept;
/**
Alexandre Leroux
Changes structure of data hold by the item...
r315 * Get the data associated to a key
* @param key the key to search
* @return the data found if key is valid, default QVariant otherwise
Alexandre Leroux
Define a data source item
r35 */
Alexandre Leroux
Changes structure of data hold by the item...
r315 QVariant data(const QString &key) const noexcept;
Alexandre Leroux
Define a data source item
r35
Alexandre Leroux
Handles tooltip for a data source item
r319 /// Gets all data
Alexandre Leroux
(Minor) Uses QVariantHash alias in DataSourceItem
r374 QVariantHash data() const noexcept;
Alexandre Leroux
Handles tooltip for a data source item
r319
Alexandre Leroux
Changes data source item icons (2)...
r318 bool isRoot() const noexcept;
Alexandre Leroux
Adds action in the mock plugin to load products
r137 QString name() const noexcept;
Alexandre Leroux
Define a data source item
r35 /**
* Get the item's parent
* @return a pointer to the parent if it exists, nullptr if the item is a root
*/
DataSourceItem *parentItem() const noexcept;
Alexandre Leroux
Adds plugin column to variable widget...
r520 /**
* Gets the item's root
* @return the top parent, the item itself if it's the root item
*/
const DataSourceItem &rootItem() const noexcept;
Alexandre Leroux
Implements DataSourceItem::setData() method...
r320 /**
* Sets or appends a value to a key
* @param key the key
* @param value the value
* @param append if true, the value is added to the values already existing for the key,
* otherwise it replaces the existing values
*/
void setData(const QString &key, const QVariant &value, bool append = false) noexcept;
Alexandre Leroux
Adds type for a data source item...
r78 DataSourceItemType type() const noexcept;
Alexandre Leroux
Adds operators for DataSourceItem
r321 bool operator==(const DataSourceItem &other);
bool operator!=(const DataSourceItem &other);
Alexandre Leroux
Define a data source item
r35 private:
class DataSourceItemPrivate;
spimpl::unique_impl_ptr<DataSourceItemPrivate> impl;
};
#endif // SCIQLOP_DATASOURCEITEMMODEL_H