LibrePCB Developers Documentation
AddComponentDialog Class Referencefinal

The AddComponentDialog class. More...

#include <addcomponentdialog.h>

Inherits QDialog.

+ Collaboration diagram for AddComponentDialog:

Classes

struct  SearchResultComponent
 
struct  SearchResultDevice
 

Public Member Functions

 AddComponentDialog (workspace::Workspace &workspace, Project &project, QWidget *parent=nullptr)
 
 ~AddComponentDialog () noexcept
 
tl::optional< UuidgetSelectedComponentUuid () const noexcept
 
tl::optional< UuidgetSelectedSymbVarUuid () const noexcept
 
tl::optional< UuidgetSelectedDeviceUuid () const noexcept
 

Private Types

typedef QHash< FilePath, SearchResultComponentSearchResult
 

Private Slots

void searchEditTextChanged (const QString &text) noexcept
 
void treeCategories_currentItemChanged (const QModelIndex &current, const QModelIndex &previous) noexcept
 
void treeComponents_currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *previous) noexcept
 
void treeComponents_itemDoubleClicked (QTreeWidgetItem *item, int column) noexcept
 
void on_cbxSymbVar_currentIndexChanged (int index) noexcept
 

Private Member Functions

void searchComponents (const QString &input)
 
SearchResult searchComponentsAndDevices (const QString &input)
 
void setSelectedCategory (const tl::optional< Uuid > &categoryUuid)
 
void setSelectedComponent (const library::Component *cmp)
 
void setSelectedSymbVar (const library::ComponentSymbolVariant *symbVar)
 
void setSelectedDevice (const library::Device *dev)
 
void accept () noexcept
 

Private Attributes

workspace::WorkspacemWorkspace
 
ProjectmProject
 
Ui::AddComponentDialog * mUi
 
GraphicsScenemComponentPreviewScene
 
GraphicsScenemDevicePreviewScene
 
QScopedPointer< DefaultGraphicsLayerProvidermGraphicsLayerProvider
 
workspace::ComponentCategoryTreeModelmCategoryTreeModel
 
tl::optional< UuidmSelectedCategoryUuid
 
const library::ComponentmSelectedComponent
 
const library::ComponentSymbolVariantmSelectedSymbVar
 
const library::DevicemSelectedDevice
 
const library::PackagemSelectedPackage
 
QList< library::SymbolPreviewGraphicsItem * > mPreviewSymbolGraphicsItems
 
library::FootprintPreviewGraphicsItemmPreviewFootprintGraphicsItem
 

Detailed Description

The AddComponentDialog class.

Member Typedef Documentation

◆ SearchResult

typedef QHash<FilePath, SearchResultComponent> SearchResult
private

Constructor & Destructor Documentation

◆ AddComponentDialog()

AddComponentDialog ( workspace::Workspace workspace,
Project project,
QWidget *  parent = nullptr 
)
explicit
+ Here is the call graph for this function:

◆ ~AddComponentDialog()

~AddComponentDialog ( )
noexcept

Member Function Documentation

◆ getSelectedComponentUuid()

tl::optional< Uuid > getSelectedComponentUuid ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedSymbVarUuid()

tl::optional< Uuid > getSelectedSymbVarUuid ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectedDeviceUuid()

tl::optional< Uuid > getSelectedDeviceUuid ( ) const
noexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchEditTextChanged

void searchEditTextChanged ( const QString &  text)
privateslotnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ treeCategories_currentItemChanged

void treeCategories_currentItemChanged ( const QModelIndex &  current,
const QModelIndex &  previous 
)
privateslotnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ treeComponents_currentItemChanged

void treeComponents_currentItemChanged ( QTreeWidgetItem *  current,
QTreeWidgetItem *  previous 
)
privateslotnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ treeComponents_itemDoubleClicked

void treeComponents_itemDoubleClicked ( QTreeWidgetItem *  item,
int  column 
)
privateslotnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_cbxSymbVar_currentIndexChanged

void on_cbxSymbVar_currentIndexChanged ( int  index)
privateslotnoexcept
+ Here is the call graph for this function:

◆ searchComponents()

void searchComponents ( const QString &  input)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchComponentsAndDevices()

AddComponentDialog::SearchResult searchComponentsAndDevices ( const QString &  input)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelectedCategory()

void setSelectedCategory ( const tl::optional< Uuid > &  categoryUuid)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelectedComponent()

void setSelectedComponent ( const library::Component cmp)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelectedSymbVar()

void setSelectedSymbVar ( const library::ComponentSymbolVariant symbVar)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelectedDevice()

void setSelectedDevice ( const library::Device dev)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accept()

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

Member Data Documentation

◆ mWorkspace

workspace::Workspace& mWorkspace
private

◆ mProject

Project& mProject
private

◆ mUi

Ui::AddComponentDialog* mUi
private

◆ mComponentPreviewScene

GraphicsScene* mComponentPreviewScene
private

◆ mDevicePreviewScene

GraphicsScene* mDevicePreviewScene
private

◆ mGraphicsLayerProvider

QScopedPointer<DefaultGraphicsLayerProvider> mGraphicsLayerProvider
private

◆ mCategoryTreeModel

workspace::ComponentCategoryTreeModel* mCategoryTreeModel
private

◆ mSelectedCategoryUuid

tl::optional<Uuid> mSelectedCategoryUuid
private

◆ mSelectedComponent

const library::Component* mSelectedComponent
private

◆ mSelectedSymbVar

const library::ComponentSymbolVariant* mSelectedSymbVar
private

◆ mSelectedDevice

const library::Device* mSelectedDevice
private

◆ mSelectedPackage

const library::Package* mSelectedPackage
private

◆ mPreviewSymbolGraphicsItems

QList<library::SymbolPreviewGraphicsItem*> mPreviewSymbolGraphicsItems
private

◆ mPreviewFootprintGraphicsItem

library::FootprintPreviewGraphicsItem* mPreviewFootprintGraphicsItem
private

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