CAM: apply precommit
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <QRegularExpression>
|
||||
#include <QRegularExpression>
|
||||
#endif
|
||||
|
||||
#include <App/Document.h>
|
||||
@@ -45,8 +45,9 @@ using namespace Gui;
|
||||
// TaskWidget
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TaskWidgetPathCompound::TaskWidgetPathCompound(ViewProviderPathCompound *CompoundView,QWidget *parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("CAM_Compound"),tr("Compound paths"),true, parent)
|
||||
TaskWidgetPathCompound::TaskWidgetPathCompound(ViewProviderPathCompound* CompoundView,
|
||||
QWidget* parent)
|
||||
: TaskBox(Gui::BitmapFactory().pixmap("CAM_Compound"), tr("Compound paths"), true, parent)
|
||||
{
|
||||
// we need a separate container widget to add all controls to
|
||||
proxy = new QWidget(this);
|
||||
@@ -56,9 +57,11 @@ TaskWidgetPathCompound::TaskWidgetPathCompound(ViewProviderPathCompound *Compoun
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
Path::FeatureCompound* pcCompound = static_cast<Path::FeatureCompound*>(CompoundView->getObject());
|
||||
const std::vector<App::DocumentObject*> &Paths = pcCompound->Group.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it= Paths.begin();it!=Paths.end();++it) {
|
||||
Path::FeatureCompound* pcCompound =
|
||||
static_cast<Path::FeatureCompound*>(CompoundView->getObject());
|
||||
const std::vector<App::DocumentObject*>& Paths = pcCompound->Group.getValues();
|
||||
for (std::vector<App::DocumentObject*>::const_iterator it = Paths.begin(); it != Paths.end();
|
||||
++it) {
|
||||
QString name = QString::fromLatin1((*it)->getNameInDocument());
|
||||
name += QString::fromLatin1(" (");
|
||||
name += QString::fromUtf8((*it)->Label.getValue());
|
||||
@@ -72,10 +75,10 @@ TaskWidgetPathCompound::~TaskWidgetPathCompound()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
std::vector<std::string> TaskWidgetPathCompound::getList() const {
|
||||
std::vector<std::string> TaskWidgetPathCompound::getList() const
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
for(int i = 0; i < ui->PathsList->count(); i++)
|
||||
{
|
||||
for (int i = 0; i < ui->PathsList->count(); i++) {
|
||||
QListWidgetItem* item = ui->PathsList->item(i);
|
||||
QString name = item->text();
|
||||
QStringList result;
|
||||
@@ -86,7 +89,7 @@ std::vector<std::string> TaskWidgetPathCompound::getList() const {
|
||||
return names;
|
||||
}
|
||||
|
||||
void TaskWidgetPathCompound::changeEvent(QEvent *e)
|
||||
void TaskWidgetPathCompound::changeEvent(QEvent* e)
|
||||
{
|
||||
TaskBox::changeEvent(e);
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
@@ -98,25 +101,24 @@ void TaskWidgetPathCompound::changeEvent(QEvent *e)
|
||||
// TaskDialog
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
TaskDlgPathCompound::TaskDlgPathCompound(PathGui::ViewProviderPathCompound *obj)
|
||||
: TaskDialog(),CompoundView(obj)
|
||||
TaskDlgPathCompound::TaskDlgPathCompound(PathGui::ViewProviderPathCompound* obj)
|
||||
: TaskDialog()
|
||||
, CompoundView(obj)
|
||||
{
|
||||
assert(CompoundView);
|
||||
(void)CompoundView; // fix clang warning
|
||||
parameter = new TaskWidgetPathCompound(CompoundView);
|
||||
(void)CompoundView; // fix clang warning
|
||||
parameter = new TaskWidgetPathCompound(CompoundView);
|
||||
Content.push_back(parameter);
|
||||
}
|
||||
|
||||
TaskDlgPathCompound::~TaskDlgPathCompound()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
//==== calls from the TaskView ===============================================================
|
||||
|
||||
|
||||
void TaskDlgPathCompound::open()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
void TaskDlgPathCompound::clicked(int button)
|
||||
{
|
||||
@@ -126,12 +128,13 @@ void TaskDlgPathCompound::clicked(int button)
|
||||
bool TaskDlgPathCompound::accept()
|
||||
{
|
||||
std::vector<App::DocumentObject*> paths;
|
||||
Path::FeatureCompound* pcCompound = static_cast<Path::FeatureCompound*>(CompoundView->getObject());
|
||||
Path::FeatureCompound* pcCompound =
|
||||
static_cast<Path::FeatureCompound*>(CompoundView->getObject());
|
||||
App::Document* pcDoc = static_cast<App::Document*>(pcCompound->getDocument());
|
||||
std::vector<std::string> names = parameter->getList();
|
||||
for(std::size_t i = 0; i < names.size(); i++)
|
||||
{
|
||||
App::DocumentObject* pcPath = static_cast<App::DocumentObject*>(pcDoc->getObject(names[i].c_str()));
|
||||
for (std::size_t i = 0; i < names.size(); i++) {
|
||||
App::DocumentObject* pcPath =
|
||||
static_cast<App::DocumentObject*>(pcDoc->getObject(names[i].c_str()));
|
||||
paths.push_back(pcPath);
|
||||
}
|
||||
pcCompound->Group.setValues(paths);
|
||||
@@ -146,8 +149,7 @@ bool TaskDlgPathCompound::reject()
|
||||
}
|
||||
|
||||
void TaskDlgPathCompound::helpRequested()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
#include "moc_TaskDlgPathCompound.cpp"
|
||||
|
||||
Reference in New Issue
Block a user