LibrePCB Developers Documentation
Loading...
Searching...
No Matches
LibraryEditor Class Referencefinal

The LibraryEditor class. More...

#include <libraryeditor.h>

+ Inheritance diagram for LibraryEditor:
+ Collaboration diagram for LibraryEditor:

Public Member Functions

 LibraryEditor ()=delete
 
 LibraryEditor (const LibraryEditor &other)=delete
 
 LibraryEditor (Workspace &ws, const FilePath &libFp, bool readOnly)
 
 ~LibraryEditor () noexcept
 
std::shared_ptr< GraphicsLayergetLayer (const QString &name) const noexcept override
 
QList< std::shared_ptr< GraphicsLayer > > getAllLayers () const noexcept override
 
bool closeAndDestroy (bool askForSave) noexcept
 Close the library editor (this will destroy this object!)
 
LibraryEditoroperator= (const LibraryEditor &rhs)=delete
 
- Public Member Functions inherited from IF_GraphicsLayerProvider
virtual ~IF_GraphicsLayerProvider () noexcept
 
std::shared_ptr< GraphicsLayergetLayer (const Layer &layer) const noexcept
 
std::shared_ptr< GraphicsLayergetGrabAreaLayer (const Layer &outlineLayer) const noexcept
 

Private Member Functions

void newComponentCategoryTriggered () noexcept
 
void newPackageCategoryTriggered () noexcept
 
void newSymbolTriggered () noexcept
 
void newPackageTriggered () noexcept
 
void newComponentTriggered () noexcept
 
void newDeviceTriggered () noexcept
 
void editComponentCategoryTriggered (const FilePath &fp) noexcept
 
void editPackageCategoryTriggered (const FilePath &fp) noexcept
 
void editSymbolTriggered (const FilePath &fp) noexcept
 
void editPackageTriggered (const FilePath &fp) noexcept
 
void editComponentTriggered (const FilePath &fp) noexcept
 
void editDeviceTriggered (const FilePath &fp) noexcept
 
void duplicateComponentCategoryTriggered (const FilePath &fp) noexcept
 
void duplicatePackageCategoryTriggered (const FilePath &fp) noexcept
 
void duplicateSymbolTriggered (const FilePath &fp) noexcept
 
void duplicatePackageTriggered (const FilePath &fp) noexcept
 
void duplicateComponentTriggered (const FilePath &fp) noexcept
 
void duplicateDeviceTriggered (const FilePath &fp) noexcept
 
void closeTabIfOpen (const FilePath &fp) noexcept
 
template<typename EditWidgetType >
void editLibraryElementTriggered (const FilePath &fp, bool isNewElement) noexcept
 
void currentTabChanged (int index) noexcept
 
void tabCloseRequested (int index) noexcept
 
bool closeTab (int index) noexcept
 
void createActions () noexcept
 
void createToolBars () noexcept
 
void createMenus () noexcept
 
EditorWidgetBase::Context createContext (bool isNewElement) noexcept
 
void setAvailableFeatures (const QSet< EditorWidgetBase::Feature > &features) noexcept
 
void setActiveEditorWidget (EditorWidgetBase *widget)
 
void newLibraryElement (NewElementWizardContext::ElementType type)
 
void duplicateLibraryElement (NewElementWizardContext::ElementType type, const FilePath &fp)
 
void editNewLibraryElement (NewElementWizardContext::ElementType type, const FilePath &fp)
 
void updateTabTitles () noexcept
 
void tabCountChanged () noexcept
 
void keyPressEvent (QKeyEvent *event) noexcept override
 
void closeEvent (QCloseEvent *event) noexcept override
 
bool closeAllTabs (bool withNonClosable, bool askForSave) noexcept
 
void addLayer (const QString &name) noexcept
 

Private Attributes

WorkspacemWorkspace
 
bool mIsOpenedReadOnly
 
QScopedPointer< Ui::LibraryEditor > mUi
 
QScopedPointer< StandardEditorCommandHandlermStandardCommandHandler
 
QList< std::shared_ptr< GraphicsLayer > > mLayers
 
EditorWidgetBasemCurrentEditorWidget
 
LibrarymLibrary
 
QScopedPointer< QAction > mActionAboutLibrePcb
 
QScopedPointer< QAction > mActionAboutQt
 
QScopedPointer< QAction > mActionOnlineDocumentation
 
QScopedPointer< QAction > mActionKeyboardShortcutsReference
 
QScopedPointer< QAction > mActionWebsite
 
QScopedPointer< QAction > mActionSave
 
QScopedPointer< QAction > mActionSaveAll
 
QScopedPointer< QAction > mActionCloseTab
 
QScopedPointer< QAction > mActionCloseAllTabs
 
QScopedPointer< QAction > mActionCloseWindow
 
QScopedPointer< QAction > mActionQuit
 
QScopedPointer< QAction > mActionFileManager
 
QScopedPointer< QAction > mActionRescanLibraries
 
QScopedPointer< QAction > mActionImportDxf
 
QScopedPointer< QAction > mActionImportEagleLibrary
 
QScopedPointer< QAction > mActionImportKiCadLibrary
 
QScopedPointer< QAction > mActionExportImage
 
QScopedPointer< QAction > mActionExportPdf
 
QScopedPointer< QAction > mActionPrint
 
QScopedPointer< QAction > mActionNewElement
 
QScopedPointer< QAction > mActionNextPage
 
QScopedPointer< QAction > mActionPreviousPage
 
QScopedPointer< QAction > mActionFind
 
QScopedPointer< QAction > mActionSelectAll
 
QScopedPointer< QAction > mActionGridProperties
 
QScopedPointer< QAction > mActionGridIncrease
 
QScopedPointer< QAction > mActionGridDecrease
 
QScopedPointer< QAction > mActionToggleBgImage
 
QScopedPointer< QAction > mActionZoomFit
 
QScopedPointer< QAction > mActionZoomIn
 
QScopedPointer< QAction > mActionZoomOut
 
QScopedPointer< QAction > mActionToggle3D
 
QScopedPointer< QAction > mActionUndo
 
QScopedPointer< QAction > mActionRedo
 
QScopedPointer< QAction > mActionCut
 
QScopedPointer< QAction > mActionCopy
 
QScopedPointer< QAction > mActionPaste
 
QScopedPointer< QAction > mActionMoveLeft
 
QScopedPointer< QAction > mActionMoveRight
 
QScopedPointer< QAction > mActionMoveUp
 
QScopedPointer< QAction > mActionMoveDown
 
QScopedPointer< QAction > mActionRotateCcw
 
QScopedPointer< QAction > mActionRotateCw
 
QScopedPointer< QAction > mActionMirrorHorizontal
 
QScopedPointer< QAction > mActionMirrorVertical
 
QScopedPointer< QAction > mActionFlipHorizontal
 
QScopedPointer< QAction > mActionFlipVertical
 
QScopedPointer< QAction > mActionMoveAlign
 
QScopedPointer< QAction > mActionSnapToGrid
 
QScopedPointer< QAction > mActionProperties
 
QScopedPointer< QAction > mActionRemove
 
QScopedPointer< QAction > mActionHelperTools
 
QScopedPointer< QAction > mActionGenerateOutline
 
QScopedPointer< QAction > mActionGenerateCourtyard
 
QScopedPointer< QAction > mActionAbort
 
QScopedPointer< QAction > mActionToolSelect
 
QScopedPointer< QAction > mActionToolLine
 
QScopedPointer< QAction > mActionToolRect
 
QScopedPointer< QAction > mActionToolPolygon
 
QScopedPointer< QAction > mActionToolCircle
 
QScopedPointer< QAction > mActionToolArc
 
QScopedPointer< QAction > mActionToolText
 
QScopedPointer< QAction > mActionToolName
 
QScopedPointer< QAction > mActionToolValue
 
QScopedPointer< QAction > mActionToolPin
 
QScopedPointer< QAction > mActionToolSmtPadStandard
 
QScopedPointer< QAction > mActionToolThtPad
 
QScopedPointer< QAction > mActionToolSpecialPadThermal
 
QScopedPointer< QAction > mActionToolSpecialPadBga
 
QScopedPointer< QAction > mActionToolSpecialPadEdgeConnector
 
QScopedPointer< QAction > mActionToolSpecialPadTest
 
QScopedPointer< QAction > mActionToolSpecialPadLocalFiducial
 
QScopedPointer< QAction > mActionToolSpecialPadGlobalFiducial
 
QScopedPointer< QAction > mActionToolZone
 
QScopedPointer< QAction > mActionToolHole
 
QScopedPointer< QAction > mActionToolMeasure
 
QScopedPointer< QAction > mActionReNumberPads
 
QScopedPointer< UndoStackActionGroupmUndoStackActionGroup
 
QScopedPointer< ExclusiveActionGroupmToolsActionGroup
 
QScopedPointer< QToolBar > mToolBarFile
 
QScopedPointer< QToolBar > mToolBarEdit
 
QScopedPointer< QToolBar > mToolBarView
 
QScopedPointer< SearchToolBarmToolBarSearch
 
QScopedPointer< QToolBar > mToolBarCommand
 
QScopedPointer< QToolBar > mToolBarTools
 

Detailed Description

The LibraryEditor class.

Constructor & Destructor Documentation

◆ LibraryEditor() [1/3]

LibraryEditor ( )
delete

◆ LibraryEditor() [2/3]

LibraryEditor ( const LibraryEditor other)
delete

◆ LibraryEditor() [3/3]

LibraryEditor ( Workspace ws,
const FilePath libFp,
bool  readOnly 
)
+ Here is the call graph for this function:

◆ ~LibraryEditor()

~LibraryEditor ( )
noexcept
+ Here is the call graph for this function:

Member Function Documentation

◆ getLayer()

std::shared_ptr< GraphicsLayer > getLayer ( const QString &  name) const
inlineoverridevirtualnoexcept

◆ getAllLayers()

QList< std::shared_ptr< GraphicsLayer > > getAllLayers ( ) const
inlineoverridevirtualnoexcept

◆ closeAndDestroy()

bool closeAndDestroy ( bool  askForSave)
noexcept

Close the library editor (this will destroy this object!)

If there are unsaved changes to the library, this method will ask the user whether the changes should be saved or not. If the user clicks on "cancel" or the library could not be saved successfully, this method will return false. If there was no such error, this method will call QObject::deleteLater() which means that this object will be deleted in the Qt's event loop.

Warning
This method can be called both from within this class and from outside this class (for example from the control panel). But if you call this method from outside this class, you may have to delete the object yourself afterwards! In special cases, the deleteLater() mechanism could lead in fatal errors otherwise!
Parameters
askForSaveIf true and there are unsaved changes, this method shows a message box to ask whether the library should be saved or not. If false, the library will NOT be saved.
Returns
true on success (editor closed), false on failure (editor stays open)
+ Here is the caller graph for this function:

◆ operator=()

LibraryEditor & operator= ( const LibraryEditor rhs)
delete

◆ newComponentCategoryTriggered()

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

◆ newPackageCategoryTriggered()

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

◆ newSymbolTriggered()

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

◆ newPackageTriggered()

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

◆ newComponentTriggered()

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

◆ newDeviceTriggered()

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

◆ editComponentCategoryTriggered()

void editComponentCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editPackageCategoryTriggered()

void editPackageCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editSymbolTriggered()

void editSymbolTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editPackageTriggered()

void editPackageTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editComponentTriggered()

void editComponentTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ editDeviceTriggered()

void editDeviceTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicateComponentCategoryTriggered()

void duplicateComponentCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicatePackageCategoryTriggered()

void duplicatePackageCategoryTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicateSymbolTriggered()

void duplicateSymbolTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicatePackageTriggered()

void duplicatePackageTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicateComponentTriggered()

void duplicateComponentTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ duplicateDeviceTriggered()

void duplicateDeviceTriggered ( const FilePath fp)
privatenoexcept
+ Here is the caller graph for this function:

◆ closeTabIfOpen()

void closeTabIfOpen ( const FilePath fp)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editLibraryElementTriggered()

template<typename EditWidgetType >
void editLibraryElementTriggered ( const FilePath fp,
bool  isNewElement 
)
privatenoexcept
+ Here is the call graph for this function:

◆ currentTabChanged()

void currentTabChanged ( int  index)
privatenoexcept
+ Here is the caller graph for this function:

◆ tabCloseRequested()

void tabCloseRequested ( int  index)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ closeTab()

bool closeTab ( int  index)
privatenoexcept
+ Here is the call graph for this function:

◆ createActions()

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

◆ createToolBars()

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

◆ createMenus()

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

◆ createContext()

EditorWidgetBase::Context createContext ( bool  isNewElement)
privatenoexcept
+ Here is the caller graph for this function:

◆ setAvailableFeatures()

void setAvailableFeatures ( const QSet< EditorWidgetBase::Feature > &  features)
privatenoexcept

◆ setActiveEditorWidget()

void setActiveEditorWidget ( EditorWidgetBase widget)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ newLibraryElement()

void newLibraryElement ( NewElementWizardContext::ElementType  type)
private
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ duplicateLibraryElement()

void duplicateLibraryElement ( NewElementWizardContext::ElementType  type,
const FilePath fp 
)
private
+ Here is the call graph for this function:

◆ editNewLibraryElement()

void editNewLibraryElement ( NewElementWizardContext::ElementType  type,
const FilePath fp 
)
private

◆ updateTabTitles()

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

◆ tabCountChanged()

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

◆ keyPressEvent()

void keyPressEvent ( QKeyEvent *  event)
overrideprivatenoexcept

◆ closeEvent()

void closeEvent ( QCloseEvent *  event)
overrideprivatenoexcept

◆ closeAllTabs()

bool closeAllTabs ( bool  withNonClosable,
bool  askForSave 
)
privatenoexcept
+ Here is the caller graph for this function:

◆ addLayer()

void addLayer ( const QString &  name)
privatenoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ mWorkspace

Workspace& mWorkspace
private

◆ mIsOpenedReadOnly

bool mIsOpenedReadOnly
private

◆ mUi

QScopedPointer<Ui::LibraryEditor> mUi
private

◆ mStandardCommandHandler

QScopedPointer<StandardEditorCommandHandler> mStandardCommandHandler
private

◆ mLayers

QList<std::shared_ptr<GraphicsLayer> > mLayers
private

◆ mCurrentEditorWidget

EditorWidgetBase* mCurrentEditorWidget
private

◆ mLibrary

Library* mLibrary
private

◆ mActionAboutLibrePcb

QScopedPointer<QAction> mActionAboutLibrePcb
private

◆ mActionAboutQt

QScopedPointer<QAction> mActionAboutQt
private

◆ mActionOnlineDocumentation

QScopedPointer<QAction> mActionOnlineDocumentation
private

◆ mActionKeyboardShortcutsReference

QScopedPointer<QAction> mActionKeyboardShortcutsReference
private

◆ mActionWebsite

QScopedPointer<QAction> mActionWebsite
private

◆ mActionSave

QScopedPointer<QAction> mActionSave
private

◆ mActionSaveAll

QScopedPointer<QAction> mActionSaveAll
private

◆ mActionCloseTab

QScopedPointer<QAction> mActionCloseTab
private

◆ mActionCloseAllTabs

QScopedPointer<QAction> mActionCloseAllTabs
private

◆ mActionCloseWindow

QScopedPointer<QAction> mActionCloseWindow
private

◆ mActionQuit

QScopedPointer<QAction> mActionQuit
private

◆ mActionFileManager

QScopedPointer<QAction> mActionFileManager
private

◆ mActionRescanLibraries

QScopedPointer<QAction> mActionRescanLibraries
private

◆ mActionImportDxf

QScopedPointer<QAction> mActionImportDxf
private

◆ mActionImportEagleLibrary

QScopedPointer<QAction> mActionImportEagleLibrary
private

◆ mActionImportKiCadLibrary

QScopedPointer<QAction> mActionImportKiCadLibrary
private

◆ mActionExportImage

QScopedPointer<QAction> mActionExportImage
private

◆ mActionExportPdf

QScopedPointer<QAction> mActionExportPdf
private

◆ mActionPrint

QScopedPointer<QAction> mActionPrint
private

◆ mActionNewElement

QScopedPointer<QAction> mActionNewElement
private

◆ mActionNextPage

QScopedPointer<QAction> mActionNextPage
private

◆ mActionPreviousPage

QScopedPointer<QAction> mActionPreviousPage
private

◆ mActionFind

QScopedPointer<QAction> mActionFind
private

◆ mActionSelectAll

QScopedPointer<QAction> mActionSelectAll
private

◆ mActionGridProperties

QScopedPointer<QAction> mActionGridProperties
private

◆ mActionGridIncrease

QScopedPointer<QAction> mActionGridIncrease
private

◆ mActionGridDecrease

QScopedPointer<QAction> mActionGridDecrease
private

◆ mActionToggleBgImage

QScopedPointer<QAction> mActionToggleBgImage
private

◆ mActionZoomFit

QScopedPointer<QAction> mActionZoomFit
private

◆ mActionZoomIn

QScopedPointer<QAction> mActionZoomIn
private

◆ mActionZoomOut

QScopedPointer<QAction> mActionZoomOut
private

◆ mActionToggle3D

QScopedPointer<QAction> mActionToggle3D
private

◆ mActionUndo

QScopedPointer<QAction> mActionUndo
private

◆ mActionRedo

QScopedPointer<QAction> mActionRedo
private

◆ mActionCut

QScopedPointer<QAction> mActionCut
private

◆ mActionCopy

QScopedPointer<QAction> mActionCopy
private

◆ mActionPaste

QScopedPointer<QAction> mActionPaste
private

◆ mActionMoveLeft

QScopedPointer<QAction> mActionMoveLeft
private

◆ mActionMoveRight

QScopedPointer<QAction> mActionMoveRight
private

◆ mActionMoveUp

QScopedPointer<QAction> mActionMoveUp
private

◆ mActionMoveDown

QScopedPointer<QAction> mActionMoveDown
private

◆ mActionRotateCcw

QScopedPointer<QAction> mActionRotateCcw
private

◆ mActionRotateCw

QScopedPointer<QAction> mActionRotateCw
private

◆ mActionMirrorHorizontal

QScopedPointer<QAction> mActionMirrorHorizontal
private

◆ mActionMirrorVertical

QScopedPointer<QAction> mActionMirrorVertical
private

◆ mActionFlipHorizontal

QScopedPointer<QAction> mActionFlipHorizontal
private

◆ mActionFlipVertical

QScopedPointer<QAction> mActionFlipVertical
private

◆ mActionMoveAlign

QScopedPointer<QAction> mActionMoveAlign
private

◆ mActionSnapToGrid

QScopedPointer<QAction> mActionSnapToGrid
private

◆ mActionProperties

QScopedPointer<QAction> mActionProperties
private

◆ mActionRemove

QScopedPointer<QAction> mActionRemove
private

◆ mActionHelperTools

QScopedPointer<QAction> mActionHelperTools
private

◆ mActionGenerateOutline

QScopedPointer<QAction> mActionGenerateOutline
private

◆ mActionGenerateCourtyard

QScopedPointer<QAction> mActionGenerateCourtyard
private

◆ mActionAbort

QScopedPointer<QAction> mActionAbort
private

◆ mActionToolSelect

QScopedPointer<QAction> mActionToolSelect
private

◆ mActionToolLine

QScopedPointer<QAction> mActionToolLine
private

◆ mActionToolRect

QScopedPointer<QAction> mActionToolRect
private

◆ mActionToolPolygon

QScopedPointer<QAction> mActionToolPolygon
private

◆ mActionToolCircle

QScopedPointer<QAction> mActionToolCircle
private

◆ mActionToolArc

QScopedPointer<QAction> mActionToolArc
private

◆ mActionToolText

QScopedPointer<QAction> mActionToolText
private

◆ mActionToolName

QScopedPointer<QAction> mActionToolName
private

◆ mActionToolValue

QScopedPointer<QAction> mActionToolValue
private

◆ mActionToolPin

QScopedPointer<QAction> mActionToolPin
private

◆ mActionToolSmtPadStandard

QScopedPointer<QAction> mActionToolSmtPadStandard
private

◆ mActionToolThtPad

QScopedPointer<QAction> mActionToolThtPad
private

◆ mActionToolSpecialPadThermal

QScopedPointer<QAction> mActionToolSpecialPadThermal
private

◆ mActionToolSpecialPadBga

QScopedPointer<QAction> mActionToolSpecialPadBga
private

◆ mActionToolSpecialPadEdgeConnector

QScopedPointer<QAction> mActionToolSpecialPadEdgeConnector
private

◆ mActionToolSpecialPadTest

QScopedPointer<QAction> mActionToolSpecialPadTest
private

◆ mActionToolSpecialPadLocalFiducial

QScopedPointer<QAction> mActionToolSpecialPadLocalFiducial
private

◆ mActionToolSpecialPadGlobalFiducial

QScopedPointer<QAction> mActionToolSpecialPadGlobalFiducial
private

◆ mActionToolZone

QScopedPointer<QAction> mActionToolZone
private

◆ mActionToolHole

QScopedPointer<QAction> mActionToolHole
private

◆ mActionToolMeasure

QScopedPointer<QAction> mActionToolMeasure
private

◆ mActionReNumberPads

QScopedPointer<QAction> mActionReNumberPads
private

◆ mUndoStackActionGroup

QScopedPointer<UndoStackActionGroup> mUndoStackActionGroup
private

◆ mToolsActionGroup

QScopedPointer<ExclusiveActionGroup> mToolsActionGroup
private

◆ mToolBarFile

QScopedPointer<QToolBar> mToolBarFile
private

◆ mToolBarEdit

QScopedPointer<QToolBar> mToolBarEdit
private

◆ mToolBarView

QScopedPointer<QToolBar> mToolBarView
private

◆ mToolBarSearch

QScopedPointer<SearchToolBar> mToolBarSearch
private

◆ mToolBarCommand

QScopedPointer<QToolBar> mToolBarCommand
private

◆ mToolBarTools

QScopedPointer<QToolBar> mToolBarTools
private

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