Remove Surplus VP properties
- color, size and font info are embedded in the rich text
This commit is contained in:
@@ -224,15 +224,6 @@ void QGIRichAnno::setTextItem()
|
||||
{
|
||||
// Base::Console().Message("QGIRA::setTextItem() - %s\n",getViewName());
|
||||
TechDraw::DrawRichAnno* annoFeat = getFeature();
|
||||
auto vp = static_cast<ViewProviderRichAnno*>(getViewProvider(annoFeat));
|
||||
if ( vp == nullptr ) {
|
||||
Base::Console().Log("QGIRA::setTextItem - no ViewProvider\n");
|
||||
return;
|
||||
}
|
||||
QFont font = m_text->font();
|
||||
font.setPointSizeF(Rez::guiX(vp->Fontsize.getValue()));
|
||||
font.setFamily(QString::fromLatin1(vp->Font.getValue()));
|
||||
m_text->setFont(font);
|
||||
|
||||
//convert point font sizes to (Rez,mm) font sizes
|
||||
QRegExp rxFontSize(QString::fromUtf8("font-size:([0-9]*)pt;"));
|
||||
|
||||
@@ -229,12 +229,6 @@ void TaskRichAnno::setUiEdit()
|
||||
ui->dsbMaxWidth->setValue(m_annoFeat->MaxWidth.getValue());
|
||||
ui->cbShowFrame->setChecked(m_annoFeat->ShowFrame.getValue());
|
||||
}
|
||||
|
||||
if (m_annoVP != nullptr) {
|
||||
// ui->cpLineColor->setColor(m_annoVP->Color.getValue().asValue<QColor>());
|
||||
// ui->dsbWeight->setValue(m_annoVP->LineWidth.getValue());
|
||||
// ui->cboxStyle->setCurrentIndex(m_annoVP->LineStyle.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
void TaskRichAnno::onEditorClicked(bool b)
|
||||
@@ -250,14 +244,6 @@ void TaskRichAnno::onEditorClicked(bool b)
|
||||
m_textDialog->setWindowTitle(QObject::tr("Rich text editor"));
|
||||
m_textDialog->setMinimumWidth (400);
|
||||
m_textDialog->setMinimumHeight(400);
|
||||
if (m_annoVP != nullptr) {
|
||||
double mmToPts = 2.83;
|
||||
m_rte->setDefFontSize(round(m_annoVP->Fontsize.getValue() * mmToPts ));
|
||||
m_rte->setDefFont(Base::Tools::fromStdString(m_annoVP->Font.getValue()));
|
||||
} else { //no VP yet, use defs
|
||||
m_rte->setDefFontSize(getDefFontSize());
|
||||
m_rte->setDefFont(getDefFont());
|
||||
}
|
||||
|
||||
connect(m_rte, SIGNAL(saveText(QString)),
|
||||
this, SLOT(onSaveAndExit(QString)));
|
||||
@@ -311,7 +297,6 @@ void TaskRichAnno::createAnnoFeature()
|
||||
commonFeatureUpdate();
|
||||
QPointF qTemp = calcTextStartPos(m_annoFeat->getScale());
|
||||
Base::Vector3d vTemp(qTemp.x(), qTemp.y());
|
||||
// m_annoFeat->TextPosition.setValue(Rez::appX(vTemp));
|
||||
m_annoFeat->X.setValue(Rez::appX(vTemp.x));
|
||||
m_annoFeat->Y.setValue(Rez::appX(vTemp.y));
|
||||
}
|
||||
@@ -326,9 +311,6 @@ void TaskRichAnno::updateAnnoFeature()
|
||||
// Base::Console().Message("TRA::updateAnnoFeature()\n");
|
||||
Gui::Command::openCommand("Edit Leader");
|
||||
commonFeatureUpdate();
|
||||
// App::Color ac;
|
||||
// ac.setValue<QColor>(ui->cpLineColor->color());
|
||||
// m_annoVP->Color.setValue(ac);
|
||||
|
||||
Gui::Command::commitCommand();
|
||||
m_annoFeat->requestPaint();
|
||||
@@ -382,19 +364,9 @@ QPointF TaskRichAnno::calcTextStartPos(double scale)
|
||||
double tPosX(0.0);
|
||||
double tPosY(0.0);
|
||||
|
||||
Gui::ViewProvider* vp = QGIView::getViewProvider(m_annoFeat);
|
||||
|
||||
if (vp != nullptr) {
|
||||
ViewProviderRichAnno* vpra = dynamic_cast<ViewProviderRichAnno*>(vp);
|
||||
if (vpra != nullptr) {
|
||||
double adjust = 2.0;
|
||||
double fsize = vpra->Fontsize.getValue();
|
||||
textHeight = fsize * adjust;
|
||||
double width = m_annoFeat->MaxWidth.getValue();
|
||||
if (width > 0 ) {
|
||||
textWidth = width;
|
||||
}
|
||||
}
|
||||
double width = m_annoFeat->MaxWidth.getValue();
|
||||
if (width > 0 ) {
|
||||
textWidth = width;
|
||||
}
|
||||
|
||||
std::vector<Base::Vector3d> points;
|
||||
|
||||
@@ -65,15 +65,6 @@ ViewProviderRichAnno::ViewProviderRichAnno()
|
||||
{
|
||||
sPixmap = "actions/techdraw-textleader";
|
||||
|
||||
static const char *group = "Text Format";
|
||||
|
||||
ADD_PROPERTY_TYPE(Color,(getDefLineColor()),group,App::Prop_None,"The color of the Markup");
|
||||
ADD_PROPERTY_TYPE(Font ,(getDefFont().c_str()),group,App::Prop_None, "The name of the font to use");
|
||||
ADD_PROPERTY_TYPE(Fontsize,(getDefFontSize()) ,group,(App::PropertyType)(App::Prop_None),
|
||||
"Text size in internal units");
|
||||
Color.setStatus(App::Property::ReadOnly,true);
|
||||
Font.setStatus(App::Property::ReadOnly,true);
|
||||
Fontsize.setStatus(App::Property::ReadOnly,true);
|
||||
}
|
||||
|
||||
ViewProviderRichAnno::~ViewProviderRichAnno()
|
||||
@@ -127,14 +118,6 @@ void ViewProviderRichAnno::updateData(const App::Property* p)
|
||||
|
||||
void ViewProviderRichAnno::onChanged(const App::Property* p)
|
||||
{
|
||||
// if ((p == &Font) ||
|
||||
// (p == &Fontsize) ||
|
||||
// (p == &Color)) {
|
||||
// QGIView* qgiv = getQView();
|
||||
// if (qgiv) {
|
||||
// qgiv->updateView(true);
|
||||
// }
|
||||
// }
|
||||
ViewProviderDrawingView::onChanged(p);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,14 +47,9 @@ public:
|
||||
/// destructor
|
||||
virtual ~ViewProviderRichAnno();
|
||||
|
||||
App::PropertyFont Font;
|
||||
App::PropertyLength Fontsize;
|
||||
App::PropertyColor Color;
|
||||
|
||||
virtual void attach(App::DocumentObject *);
|
||||
/* virtual void setDisplayMode(const char* ModeName);*/
|
||||
virtual bool useNewSelectionModel(void) const {return false;}
|
||||
/* virtual std::vector<std::string> getDisplayModes(void) const;*/
|
||||
virtual void updateData(const App::Property*);
|
||||
virtual void onChanged(const App::Property* p);
|
||||
virtual bool setEdit(int ModNum);
|
||||
|
||||
Reference in New Issue
Block a user