2 #include "ui_linepatternmanager.h"
14 ui->lpView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
44 QItemSelectionModel* select =
ui->lpView->selectionModel();
45 if(!select->hasSelection()) {
49 auto row = select->selectedRows().first().row();
50 auto linePattern = std::dynamic_pointer_cast<
const lc::DxfLinePatternByValue>(
_model->
linePatternAt(row));
51 if(linePattern ==
nullptr) {
65 if(!index.isValid()) {
69 auto linePattern = std::dynamic_pointer_cast<
const lc::DxfLinePatternByValue>(
_model->
linePatternAt(index.row()));
lc::Document_SPtr _document
void on_editButton_pressed()
Create update dialog. This function is called when "Edit" button is pressed. It create a new dialog p...
LinePatternManager(lc::Document_SPtr document, QWidget *parent=0)
Create window.
void on_removeLinePatternEvent(const lc::RemoveLinePatternEvent &)
void on_newButton_pressed()
Create new line pattern dialog. It create a new dialog to create a line pattern. This function is cal...
void on_lpView_doubleClicked(const QModelIndex &index)
Create update dialog. It create a new dialog pre-filled with the line pattern information. This function is called when an element of the list is double clicked.
Ui::LinePatternManager * ui
void setLinePatterns(std::vector< lc::DxfLinePatternByValue_CSPtr > linePatterns)
Set the new list of line patterns.
Model to display a list of DxfLinePatterns in a QTableView. Show preview, name and description...
Create a new window which shows a list of line patterns.
Create a dialog with all required fields to create a new line pattern.
void on_addLinePatternEvent(const lc::AddLinePatternEvent &)
lc::DxfLinePattern_CSPtr linePatternAt(const int index) const
Return line pattern at specific row.
void setDocument(lc::Document_SPtr document)
Set a new document and update the list of line patterns. Document can be set to nullptr to clear the ...
LinePatternModel * _model
void on_replaceLinePatternEvent(const lc::ReplaceLinePatternEvent &)
void updateModel()
Refresh line patterns list.