git-svn-id: svn://db.shs.com.ru/libs@381 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-05-22 14:22:49 +00:00
parent 7a8dd9efba
commit 4a081c1914
2 changed files with 13 additions and 1 deletions

View File

@@ -104,6 +104,15 @@ Graphic * CDGraphics::viewportGraphic(QObject * o) const {
}
GDockWidget * CDGraphics::graphicDock(Graphic * o) const {
if (!o) return 0;
foreach (GDockWidget * d, docks)
if (d->widget() == o)
return d;
return 0;
}
void CDGraphics::addGraphic() {
Graphic * g = new Graphic();
g->setGraphicsCount(0);
@@ -133,7 +142,8 @@ void CDGraphics::removeGraphic() {
void CDGraphics::addXToGraphic(const QString & xp, Graphic * g) {
qDebug() << "addGraphic" << xp << g;
if (xp.isEmpty() || !g) return;
GDockWidget * d = graphicDock(g);
if (xp.isEmpty() || !g || !d) return;
CDType & t(X[CDCore::stringToPath(Q2PIString(xp))]);
int gind = g->graphicsCount();
g->setGraphicsCount(gind + 1);