LibrePCB Developers Documentation
EditorToolbox Class Referencefinal

The EditorToolbox class provides some useful general purpose methods for editors (i.e. GUI stuff) More...

#include <editortoolbox.h>

+ Collaboration diagram for EditorToolbox:

Public Member Functions

 EditorToolbox ()=delete
 
 EditorToolbox (const EditorToolbox &other)=delete
 
 ~EditorToolbox ()=delete
 
EditorToolboxoperator= (const EditorToolbox &rhs)=delete
 

Static Public Member Functions

static bool isWindowBackgroundDark () noexcept
 Detect if the default (theme dependent) window background is dark. More...
 
static void removeFormLayoutRow (QLabel &label) noexcept
 Remove (hide) a whole row in a QFormLayout. More...
 
static void deleteLayoutItemRecursively (QLayoutItem *item) noexcept
 Delete a QLayout item with all its children. More...
 
static bool startToolBarTabFocusCycle (QToolBar &toolBar, QWidget &returnFocusToWidget) noexcept
 Set the focus to the first widget of a toolbar and iterate through. More...
 

Static Private Member Functions

static bool removeFormLayoutRow (QLayout &layout, QLabel &label) noexcept
 Helper for removeFormLayoutRow(QLabel&) More...
 
static void hideLayoutItem (QLayoutItem &item) noexcept
 Helper for removeFormLayoutRow() More...
 

Detailed Description

The EditorToolbox class provides some useful general purpose methods for editors (i.e. GUI stuff)

Constructor & Destructor Documentation

◆ EditorToolbox() [1/2]

EditorToolbox ( )
delete

◆ EditorToolbox() [2/2]

EditorToolbox ( const EditorToolbox other)
delete

◆ ~EditorToolbox()

~EditorToolbox ( )
delete

Member Function Documentation

◆ operator=()

EditorToolbox& operator= ( const EditorToolbox rhs)
delete

◆ isWindowBackgroundDark()

bool isWindowBackgroundDark ( )
staticnoexcept

Detect if the default (theme dependent) window background is dark.

Return values
trueBackground is considered dark
falseBackground is considered light or could not be determined
+ Here is the caller graph for this function:

◆ removeFormLayoutRow() [1/2]

void removeFormLayoutRow ( QLabel &  label)
staticnoexcept

Remove (hide) a whole row in a QFormLayout.

Parameters
labelThe label of the row to remove.
+ Here is the caller graph for this function:

◆ deleteLayoutItemRecursively()

void deleteLayoutItemRecursively ( QLayoutItem *  item)
staticnoexcept

Delete a QLayout item with all its children.

Parameters
itemThe item to delete. Must not be nullptr!
+ Here is the caller graph for this function:

◆ startToolBarTabFocusCycle()

bool startToolBarTabFocusCycle ( QToolBar &  toolBar,
QWidget &  returnFocusToWidget 
)
staticnoexcept

Set the focus to the first widget of a toolbar and iterate through.

  • The tab order of all widgets of the passed toolbar will be configured from left to right resp. top to bottom.
  • After the last widget, the tab order is followed by a custom widget.
  • The first widget of the passed toolbar will get the focus.

Intended for the command toolbar to enter focus from the graphics view, navigate though all the toolbar widgets, and then return the focus back to the graphics view.

Parameters
toolBarThe toolbar to set the focus.
returnFocusToWidgetWidget which shall have the focus after the last widget of the toolbar.
Returns
True if there was at least one widget and the focus has been set. False if there was no widget and the focus was not set.
+ Here is the caller graph for this function:

◆ removeFormLayoutRow() [2/2]

bool removeFormLayoutRow ( QLayout &  layout,
QLabel &  label 
)
staticprivatenoexcept

Helper for removeFormLayoutRow(QLabel&)

Parameters
layoutThe layout to look for the label.
labelThe label to remove from the layout.
Return values
trueon success.
falseif the label was not found in a form layout.
+ Here is the call graph for this function:

◆ hideLayoutItem()

void hideLayoutItem ( QLayoutItem &  item)
staticprivatenoexcept

Helper for removeFormLayoutRow()

Parameters
itemThe item to hide.
+ Here is the caller graph for this function:

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