Create a dialog with all required fields to create a new line pattern.
More...
#include <addlinepatterndialog.h>
|
| | AddLinePatternDialog (lc::Document_SPtr document, QWidget *parent=0) |
| | Create empty dialog. More...
|
| |
| | AddLinePatternDialog (lc::Document_SPtr document, lc::DxfLinePatternByValue_CSPtr linePattern, QWidget *parent=0) |
| | Create dialog pre-filled with existing line pattern information. More...
|
| |
Create a dialog with all required fields to create a new line pattern.
Definition at line 27 of file addlinepatterndialog.h.
| AddLinePatternDialog::AddLinePatternDialog |
( |
lc::Document_SPtr |
document, |
|
|
QWidget * |
parent = 0 |
|
) |
| |
Create empty dialog.
- Parameters
-
| document | Document which contains the DXFLinePatterns |
| parent | Parent widget |
Definition at line 4 of file addlinepatterndialog.cpp.
AddLinePatternDialog(lc::Document_SPtr document, QWidget *parent=0)
Create empty dialog.
| AddLinePatternDialog::AddLinePatternDialog |
( |
lc::Document_SPtr |
document, |
|
|
lc::DxfLinePatternByValue_CSPtr |
linePattern, |
|
|
QWidget * |
parent = 0 |
|
) |
| |
Create dialog pre-filled with existing line pattern information.
- Parameters
-
| document | Document which contains the DXFLinePatterns. |
| linePattern | Line pattern to edit |
| parent | Parent widget |
Definition at line 8 of file addlinepatterndialog.cpp.
10 ui(
new Ui::AddLinePatternDialog),
16 _layout =
static_cast<QVBoxLayout*
>(
ui->pathList->layout());
18 throw "Unable to cast AddLinePatternDialog pathList layout to QVBoxLayout";
21 if(linePattern !=
nullptr) {
22 ui->name->setText(linePattern->name().c_str());
23 ui->description->setText(linePattern->description().c_str());
25 for (
auto value : linePattern->path()) {
Model used to construct line pattern path.
void onEditButtonPressed()
Edit Replace the original line pattern with the new one and close the dialog.
void generatePreview()
Generate line pattern preview Create a new QPixmap with a preview of the line pattern and add it in t...
lc::DxfLinePatternByValue_CSPtr _oldLinePattern
lc::Document_SPtr _document
Ui::AddLinePatternDialog * ui
| void AddLinePatternDialog::generatePreview |
( |
| ) |
|
|
privateslot |
Generate line pattern preview Create a new QPixmap with a preview of the line pattern and add it in the dialog.
Definition at line 40 of file addlinepatterndialog.cpp.
41 std::string name =
ui->name->text().toStdString();
46 std::vector<double> path;
49 auto parts = findChildren<LinePatternPathPart*>();
51 for(
auto part : parts) {
52 auto type = part->type();
53 auto value = part->value();
61 path.push_back(value);
66 path.push_back(-value);
72 _linePattern = std::make_shared<lc::DxfLinePatternByValue>(
74 ui->description->text().toStdString(),
78 QPixmap previewPixmap(
ui->preview->frameSize());
81 painter.drawLinePattern();
83 ui->preview->setPixmap(previewPixmap);
lc::DxfLinePatternByValue_CSPtr _linePattern
Painting line patterns on a QPaintDevice.
Ui::AddLinePatternDialog * ui
| void AddLinePatternDialog::on_cancelButton_pressed |
( |
| ) |
|
|
privateslot |
| void AddLinePatternDialog::on_newValueButton_pressed |
( |
| ) |
|
|
privateslot |
Create a new entry for the pattern path.
Definition at line 87 of file addlinepatterndialog.cpp.
Model used to construct line pattern path.
void generatePreview()
Generate line pattern preview Create a new QPixmap with a preview of the line pattern and add it in t...
| void AddLinePatternDialog::on_saveButton_pressed |
( |
| ) |
|
|
privateslot |
Save Save the line pattern in the document and close the dialog.
Definition at line 98 of file addlinepatterndialog.cpp.
100 operation->execute();
lc::DxfLinePatternByValue_CSPtr _linePattern
lc::Document_SPtr _document
| void AddLinePatternDialog::onEditButtonPressed |
( |
| ) |
|
|
privateslot |
Edit Replace the original line pattern with the new one and close the dialog.
Definition at line 105 of file addlinepatterndialog.cpp.
107 operation->execute();
lc::DxfLinePatternByValue_CSPtr _linePattern
lc::DxfLinePatternByValue_CSPtr _oldLinePattern
lc::Document_SPtr _document
| lc::Document_SPtr AddLinePatternDialog::_document |
|
private |
| QVBoxLayout* AddLinePatternDialog::_layout |
|
protected |
| lc::DxfLinePatternByValue_CSPtr AddLinePatternDialog::_linePattern |
|
private |
| lc::DxfLinePatternByValue_CSPtr AddLinePatternDialog::_oldLinePattern |
|
private |
| QPushButton* AddLinePatternDialog::editButton |
|
protected |
| Ui::AddLinePatternDialog* AddLinePatternDialog::ui |
|
protected |
The documentation for this class was generated from the following files: