Gui::DlgObjectSelection Class Reference

Dialog for object dependency selection. More...

#include <DlgObjectSelection.h>

Public Types

enum class  SelectionOptions { Invert = 1 , Sort = 2 , InvertSort = 3 }
 Options for getSelections() More...
 

Public Member Functions

void accept ()
 
void addCheckBox (QCheckBox *box)
 Add a user defined checkbox at the bottom of the dialog. More...
 
 DlgObjectSelection (const std::vector< App::DocumentObject * > &objs, const std::vector< App::DocumentObject * > &excludes, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
 Constructor. More...
 
 DlgObjectSelection (const std::vector< App::DocumentObject * > &objs, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
 Constructor. More...
 
std::vector< App::DocumentObject * > getSelections (SelectionOptions options=SelectionOptions()) const
 Get the selected objects. More...
 
void reject ()
 
void setMessage (const QString &)
 Override the prompt message. More...
 
 ~DlgObjectSelection ()
 Destructor. More...
 

Detailed Description

Dialog for object dependency selection.

Member Enumeration Documentation

◆ SelectionOptions

Options for getSelections()

Enumerator
Invert 

Invert the selection, i.e. return the unselected objects.

Sort 

Sort the returned object in depending order.

InvertSort 

Return the unselected objects sorted in depending order.

Constructor & Destructor Documentation

◆ DlgObjectSelection() [1/2]

DlgObjectSelection::DlgObjectSelection ( const std::vector< App::DocumentObject * > &  objs,
QWidget parent = nullptr,
Qt::WindowFlags  fl = Qt::WindowFlags() 
)

Constructor.

Creates a dialog for selecting the given objects and their dependent objects

Parameters
objsinitial objects
parentoptional parent widget
floptional window flags

◆ DlgObjectSelection() [2/2]

DlgObjectSelection::DlgObjectSelection ( const std::vector< App::DocumentObject * > &  objs,
const std::vector< App::DocumentObject * > &  excludes,
QWidget parent = nullptr,
Qt::WindowFlags  fl = Qt::WindowFlags() 
)

Constructor.

Creates a dialog for selecting the given objects and their dependent objects with exclusions

Parameters
objsinitial objects
excludesexcluded objects. The objects and their dependents will still be in the list but unchecked.
parentoptional parent widget
floptional window flags

◆ ~DlgObjectSelection()

DlgObjectSelection::~DlgObjectSelection ( )

Destructor.

Destroys the object and frees any allocated resources.

Member Function Documentation

◆ accept()

◆ addCheckBox()

void DlgObjectSelection::addCheckBox ( QCheckBox box)

Add a user defined checkbox at the bottom of the dialog.

References Gui::Ui_DlgObjectSelection::horizontalLayout.

◆ getSelections()

std::vector< App::DocumentObject * > DlgObjectSelection::getSelections ( SelectionOptions  options = SelectionOptions()) const

Get the selected objects.

References Invert, and Sort.

Referenced by StdCmdDuplicateSelection::activated(), and Gui::MainWindow::createMimeDataFromSelection().

◆ reject()

◆ setMessage()

void DlgObjectSelection::setMessage ( const QString &  msg)

Override the prompt message.

References Gui::Ui_DlgObjectSelection::label.

Referenced by Gui::ViewProviderLink::setupContextMenu().


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