LibrePCB Developers Documentation
Loading...
Searching...
No Matches
CategoryTreeModel Class Reference

The CategoryTreeModel class. More...

#include <categorytreemodel.h>

Inherits QObject, and Model< ui::TreeViewItemData >.

+ Collaboration diagram for CategoryTreeModel:

Public Types

enum class  Filter
 

Public Member Functions

 CategoryTreeModel ()=delete
 
 CategoryTreeModel (const CategoryTreeModel &other)=delete
 
 CategoryTreeModel (const WorkspaceLibraryDb &db, const WorkspaceSettings &ws, Filters filters, const std::optional< Uuid > &hiddenCategory=std::nullopt, QObject *parent=nullptr) noexcept
 
virtual ~CategoryTreeModel () noexcept
 
std::size_t row_count () const override
 
std::optional< ui::TreeViewItemData > row_data (std::size_t i) const override
 
CategoryTreeModeloperator= (const CategoryTreeModel &rhs)=delete
 

Private Member Functions

void refresh () noexcept
 
template<typename T >
void loadChilds (const std::optional< Uuid > &parent, int level)
 

Private Attributes

const WorkspaceLibraryDbmDb
 
const WorkspaceSettingsmSettings
 
const Filters mFilters
 
const std::optional< UuidmHiddenCategory
 
const slint::Image mIcon
 
std::vector< ui::TreeViewItemData > mItems
 

Detailed Description

The CategoryTreeModel class.

Member Enumeration Documentation

◆ Filter

enum class Filter
strong
Enumerator
CmpCat 

Show all component categories, even empty ones.

PkgCat 

Show all package categories, even empty ones.

Constructor & Destructor Documentation

◆ CategoryTreeModel() [1/3]

CategoryTreeModel ( )
delete

◆ CategoryTreeModel() [2/3]

CategoryTreeModel ( const CategoryTreeModel other)
delete

◆ CategoryTreeModel() [3/3]

CategoryTreeModel ( const WorkspaceLibraryDb db,
const WorkspaceSettings ws,
Filters  filters,
const std::optional< Uuid > &  hiddenCategory = std::nullopt,
QObject *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~CategoryTreeModel()

~CategoryTreeModel ( )
virtualnoexcept

Member Function Documentation

◆ row_count()

std::size_t row_count ( ) const
override

◆ row_data()

std::optional< ui::TreeViewItemData > row_data ( std::size_t  i) const
override

◆ operator=()

CategoryTreeModel & operator= ( const CategoryTreeModel rhs)
delete

◆ refresh()

void refresh ( )
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadChilds()

template<typename T >
void loadChilds ( const std::optional< Uuid > &  parent,
int  level 
)
private
+ Here is the call graph for this function:

Member Data Documentation

◆ mDb

const WorkspaceLibraryDb& mDb
private

◆ mSettings

const WorkspaceSettings& mSettings
private

◆ mFilters

const Filters mFilters
private

◆ mHiddenCategory

const std::optional<Uuid> mHiddenCategory
private

◆ mIcon

const slint::Image mIcon
private

◆ mItems

std::vector<ui::TreeViewItemData> mItems
private

The documentation for this class was generated from the following files: