LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EditableTableWidget Class Reference

A QTableView subclass which adds buttons to edit the underlying model. More...

#include <editabletablewidget.h>

Inherits QTableView.

+ Collaboration diagram for EditableTableWidget:

Signals

void currentRowChanged (int row)
 
void btnAddClicked (const QVariant &data)
 
void btnRemoveClicked (const QVariant &data)
 
void btnCopyClicked (const QVariant &data)
 
void btnEditClicked (const QVariant &data)
 
void btnMoveUpClicked (const QVariant &data)
 
void btnMoveDownClicked (const QVariant &data)
 
void btnBrowseClicked (const QVariant &data)
 

Public Member Functions

 EditableTableWidget (QWidget *parent=nullptr) noexcept
 
 EditableTableWidget (const EditableTableWidget &other)=delete
 
virtual ~EditableTableWidget () noexcept
 
void setShowCopyButton (bool show) noexcept
 
void setShowEditButton (bool show) noexcept
 
void setShowMoveButtons (bool show) noexcept
 
void setBrowseButtonColumn (int col) noexcept
 
virtual void reset () override
 
EditableTableWidgetoperator= (const EditableTableWidget &rhs)=delete
 

Protected Member Functions

virtual void currentChanged (const QModelIndex &current, const QModelIndex &previous) override
 
virtual void rowsInserted (const QModelIndex &parent, int start, int end) override
 

Private Types

typedef void(EditableTableWidget::* Signal )(const QVariant &data)
 

Private Member Functions

void installButtons (int row) noexcept
 
QToolButton * createButton (const QString &objectName, const QIcon &icon, const QString &text, const QString &toolTip, int width, int height, Signal clickedSignal, const QPersistentModelIndex &index) noexcept
 
void buttonClickedHandler (Signal clickedSignal, const QPersistentModelIndex &index) noexcept
 

Private Attributes

bool mShowCopyButton
 
bool mShowEditButton
 
bool mShowMoveButtons
 
int mBrowseButtonColumn
 

Detailed Description

A QTableView subclass which adds buttons to edit the underlying model.

Member Typedef Documentation

typedef void(EditableTableWidget::* Signal)(const QVariant &data)
private

Constructor & Destructor Documentation

EditableTableWidget ( QWidget *  parent = nullptr)
explicitnoexcept
EditableTableWidget ( const EditableTableWidget other)
delete
~EditableTableWidget ( )
virtualnoexcept

Member Function Documentation

void setShowCopyButton ( bool  show)
inlinenoexcept
void setShowEditButton ( bool  show)
inlinenoexcept
void setShowMoveButtons ( bool  show)
inlinenoexcept
void setBrowseButtonColumn ( int  col)
inlinenoexcept
void reset ( )
overridevirtual

+ Here is the call graph for this function:

EditableTableWidget& operator= ( const EditableTableWidget rhs)
delete
void currentChanged ( const QModelIndex &  current,
const QModelIndex &  previous 
)
overrideprotectedvirtual
void rowsInserted ( const QModelIndex &  parent,
int  start,
int  end 
)
overrideprotectedvirtual

+ Here is the call graph for this function:

void currentRowChanged ( int  row)
signal

+ Here is the caller graph for this function:

void btnAddClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void btnRemoveClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void btnCopyClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void btnEditClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void btnMoveUpClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void btnMoveDownClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void btnBrowseClicked ( const QVariant &  data)
signal

+ Here is the caller graph for this function:

void installButtons ( int  row)
privatenoexcept

+ Here is the caller graph for this function:

QToolButton * createButton ( const QString &  objectName,
const QIcon &  icon,
const QString &  text,
const QString &  toolTip,
int  width,
int  height,
Signal  clickedSignal,
const QPersistentModelIndex &  index 
)
privatenoexcept
void buttonClickedHandler ( Signal  clickedSignal,
const QPersistentModelIndex &  index 
)
privatenoexcept

Member Data Documentation

bool mShowCopyButton
private
bool mShowEditButton
private
bool mShowMoveButtons
private
int mBrowseButtonColumn
private

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