LibrePCB Developers Documentation
MenuBuilder Class Referencefinal

Helper to easily create a QMenu. More...

#include <menubuilder.h>

+ Collaboration diagram for MenuBuilder:

Public Types

enum class  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 QMenu * createMoreResourcesMenu (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 class 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

◆ 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

◆ createEditMenu()

QMenu * createEditMenu ( QWidget *  parent)
staticnoexcept

◆ createViewMenu()

QMenu * createViewMenu ( QWidget *  parent)
staticnoexcept

◆ createSchematicMenu()

QMenu * createSchematicMenu ( QWidget *  parent)
staticnoexcept

◆ createBoardMenu()

QMenu * createBoardMenu ( QWidget *  parent)
staticnoexcept

◆ createProjectMenu()

QMenu * createProjectMenu ( QWidget *  parent)
staticnoexcept

◆ createToolsMenu()

QMenu * createToolsMenu ( QWidget *  parent)
staticnoexcept

◆ createExtrasMenu()

QMenu * createExtrasMenu ( QWidget *  parent)
staticnoexcept

◆ createHelpMenu()

QMenu * createHelpMenu ( QWidget *  parent)
staticnoexcept

◆ createGoToDockMenu()

QMenu * createGoToDockMenu ( QWidget *  parent)
staticnoexcept

◆ createDocksVisibilityMenu()

QMenu * createDocksVisibilityMenu ( QWidget *  parent)
staticnoexcept

◆ createImportMenu()

QMenu * createImportMenu ( QWidget *  parent)
staticnoexcept

◆ createExportMenu()

QMenu * createExportMenu ( QWidget *  parent)
staticnoexcept

◆ createProductionDataMenu()

QMenu * createProductionDataMenu ( QWidget *  parent)
staticnoexcept

◆ createLineWidthMenu()

QMenu * createLineWidthMenu ( QWidget *  parent)
staticnoexcept

◆ createChangeDeviceMenu()

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

◆ createChangeFootprintMenu()

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

◆ createChangeModelMenu()

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

◆ createMoveToOtherLibraryMenu()

QMenu * createMoveToOtherLibraryMenu ( QWidget *  parent)
staticnoexcept

◆ createMoreResourcesMenu()

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

◆ createMenu()

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

Member Data Documentation

◆ mMenuBar

QMenuBar* mMenuBar
private

◆ mMenu

QPointer<QMenu> mMenu
private

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