LibrePCB Developers Documentation
MenuBuilder Class Referencefinal

Helper to easily create a QMenu. More...

#include <menubuilder.h>

+ Collaboration diagram for MenuBuilder:

Public Types

enum  Flag
 
typedef QMenu *(* MenuFactory) (QWidget *)
 

Public Member Functions

 MenuBuilder ()=delete
 
 MenuBuilder (const MenuBuilder &other)=delete
 
 MenuBuilder (QMenuBar *menuBar) noexcept
 
 MenuBuilder (QMenu *menu) noexcept
 
 ~MenuBuilder () noexcept
 
QMenu * newMenu (MenuFactory factory) noexcept
 
QMenu * addSubMenu (MenuFactory factory) noexcept
 
QMenu * addSubMenu (const QString &objectName, const QString &title, const QIcon &icon=QIcon()) noexcept
 
void addAction (QAction *action, Flags flags=Flags()) noexcept
 
void addAction (const QScopedPointer< QAction > &action, Flags flags=Flags()) noexcept
 
void addSection (const QString &text, const QIcon &icon=QIcon()) noexcept
 
void addSeparator () noexcept
 
MenuBuilderoperator= (const MenuBuilder &rhs)=delete
 

Static Public Member Functions

static QMenu * createFileMenu (QWidget *parent) noexcept
 
static QMenu * createEditMenu (QWidget *parent) noexcept
 
static QMenu * createViewMenu (QWidget *parent) noexcept
 
static QMenu * createSchematicMenu (QWidget *parent) noexcept
 
static QMenu * createBoardMenu (QWidget *parent) noexcept
 
static QMenu * createProjectMenu (QWidget *parent) noexcept
 
static QMenu * createToolsMenu (QWidget *parent) noexcept
 
static QMenu * createExtrasMenu (QWidget *parent) noexcept
 
static QMenu * createHelpMenu (QWidget *parent) noexcept
 
static QMenu * createGoToDockMenu (QWidget *parent) noexcept
 
static QMenu * createDocksVisibilityMenu (QWidget *parent) noexcept
 
static QMenu * createImportMenu (QWidget *parent) noexcept
 
static QMenu * createExportMenu (QWidget *parent) noexcept
 
static QMenu * createProductionDataMenu (QWidget *parent) noexcept
 
static QMenu * createLineWidthMenu (QWidget *parent) noexcept
 
static QMenu * createChangeDeviceMenu (QWidget *parent) noexcept
 
static QMenu * createChangeFootprintMenu (QWidget *parent) noexcept
 
static QMenu * createChangeModelMenu (QWidget *parent) noexcept
 
static QMenu * createMoveToOtherLibraryMenu (QWidget *parent) noexcept
 

Static Private Member Functions

static QMenu * createMenu (const QString &objectName, const QString &text, const QIcon &icon, QWidget *parent) noexcept
 

Private Attributes

QMenuBar * mMenuBar
 
QPointer< QMenu > mMenu
 

Detailed Description

Helper to easily create a QMenu.

Member Typedef Documentation

◆ MenuFactory

typedef QMenu*(* MenuFactory) (QWidget *)

Member Enumeration Documentation

◆ Flag

enum Flag
strong
Enumerator
DefaultAction 

Set action as default.

Constructor & Destructor Documentation

◆ MenuBuilder() [1/4]

MenuBuilder ( )
delete

◆ MenuBuilder() [2/4]

MenuBuilder ( const MenuBuilder other)
delete

◆ MenuBuilder() [3/4]

MenuBuilder ( QMenuBar *  menuBar)
explicitnoexcept

◆ MenuBuilder() [4/4]

MenuBuilder ( QMenu *  menu)
explicitnoexcept

◆ ~MenuBuilder()

~MenuBuilder ( )
noexcept

Member Function Documentation

◆ newMenu()

QMenu * newMenu ( MenuFactory  factory)
noexcept
+ Here is the caller graph for this function:

◆ addSubMenu() [1/2]

QMenu * addSubMenu ( MenuFactory  factory)
noexcept
+ Here is the caller graph for this function:

◆ addSubMenu() [2/2]

QMenu * addSubMenu ( const QString &  objectName,
const QString &  title,
const QIcon &  icon = QIcon() 
)
noexcept

◆ addAction() [1/2]

void addAction ( QAction *  action,
Flags  flags = Flags() 
)
noexcept
+ Here is the caller graph for this function:

◆ addAction() [2/2]

void addAction ( const QScopedPointer< QAction > &  action,
Flags  flags = Flags() 
)
noexcept
+ Here is the call graph for this function:

◆ addSection()

void addSection ( const QString &  text,
const QIcon &  icon = QIcon() 
)
noexcept
+ Here is the caller graph for this function:

◆ addSeparator()

void addSeparator ( )
noexcept
+ Here is the caller graph for this function:

◆ operator=()

MenuBuilder& operator= ( const MenuBuilder rhs)
delete

◆ createFileMenu()

QMenu * createFileMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createEditMenu()

QMenu * createEditMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createViewMenu()

QMenu * createViewMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createSchematicMenu()

QMenu * createSchematicMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createBoardMenu()

QMenu * createBoardMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createProjectMenu()

QMenu * createProjectMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createToolsMenu()

QMenu * createToolsMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createExtrasMenu()

QMenu * createExtrasMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createHelpMenu()

QMenu * createHelpMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createGoToDockMenu()

QMenu * createGoToDockMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createDocksVisibilityMenu()

QMenu * createDocksVisibilityMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createImportMenu()

QMenu * createImportMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createExportMenu()

QMenu * createExportMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createProductionDataMenu()

QMenu * createProductionDataMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createLineWidthMenu()

QMenu * createLineWidthMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createChangeDeviceMenu()

QMenu * createChangeDeviceMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createChangeFootprintMenu()

QMenu * createChangeFootprintMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createChangeModelMenu()

QMenu * createChangeModelMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMoveToOtherLibraryMenu()

QMenu * createMoveToOtherLibraryMenu ( QWidget *  parent)
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createMenu()

QMenu * createMenu ( const QString &  objectName,
const QString &  text,
const QIcon &  icon,
QWidget *  parent 
)
staticprivatenoexcept
+ Here is the caller graph for this function:

Member Data Documentation

◆ mMenuBar

QMenuBar* mMenuBar
private

◆ mMenu

QPointer<QMenu> mMenu
private

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