[TD] remove Py2 code from TD

This commit is contained in:
luz paz
2021-04-21 22:06:59 -04:00
committed by wwmayer
parent 819e15a0a4
commit 1d60dbdc85
11 changed files with 0 additions and 91 deletions

View File

@@ -1082,11 +1082,7 @@ void CmdTechDrawSymbol::activated(int iMsg)
std::string FeatName = getUniqueObjectName("Symbol");
filename = Base::Tools::escapeEncodeFilename(filename);
openCommand(QT_TRANSLATE_NOOP("Command", "Create Symbol"));
#if PY_MAJOR_VERSION < 3
doCommand(Doc,"f = open(unicode(\"%s\",'utf-8'),'r')",(const char*)filename.toUtf8());
#else
doCommand(Doc,"f = open(\"%s\",'r')",(const char*)filename.toUtf8());
#endif
doCommand(Doc,"svg = f.read()");
doCommand(Doc,"f.close()");
doCommand(Doc,"App.activeDocument().addObject('TechDraw::DrawViewSymbol','%s')",FeatName.c_str());

View File

@@ -86,11 +86,7 @@ QGITile::QGITile(TechDraw::DrawTileWeld* dtw) :
m_fontName = prefTextFont();
m_font = QFont(m_fontName);
#if PY_MAJOR_VERSION < 3
setHandlesChildEvents(true); //qt4 deprecated in qt5
#else
setFiltersChildEvents(true); //qt5
#endif
setAcceptHoverEvents(true);
setFlag(QGraphicsItem::ItemIsSelectable, false);
setFlag(QGraphicsItem::ItemIsMovable, false);

View File

@@ -86,11 +86,7 @@ QGIWeldSymbol::QGIWeldSymbol(QGILeaderLine* myParent) :
m_qgLead(myParent),
m_blockDraw(false)
{
#if PY_MAJOR_VERSION < 3
setHandlesChildEvents(true); //qt4 deprecated in qt5
#else
setFiltersChildEvents(true); //qt5
#endif
setFlag(QGraphicsItem::ItemIsMovable, false);
setCacheMode(QGraphicsItem::NoCache);

View File

@@ -151,11 +151,7 @@ TechDraw::DrawViewSymbol* TaskActiveView::createActiveView(void)
ui->qsbWeight->rawValue(),
ui->qsbBorder->rawValue(),
ui->cbMode->currentIndex());
#if PY_MAJOR_VERSION < 3
Command::doCommand(Command::Doc,"f = open(unicode(\"%s\",'utf-8'),'r')",(const char*)fileSpec.c_str());
#else
Command::doCommand(Command::Doc,"f = open(\"%s\",'r')",(const char*)fileSpec.c_str());
#endif
Command::doCommand(Command::Doc,"svg = f.read()");
// Command::doCommand(Command::Doc,"print('length of svg: {}'.format(len(svg)))");