C++ (Qt)void ProjectProperties::setCoordinateSystem(const CoordinateSystem *newCoordinateSystem){ curCoordinateSystem = const_cast<CoordinateSystem*>(newCoordinateSystem);}
C++ (Qt)...void ProjectProperties::setCoordinateSystem(const CoordinateSystem *newCoordinateSystem){ curCoordinateSystem = const_cast<CoordinateSystem*>(newCoordinateSystem); curCoordinateSystem->setName("newName");}...CoordinateSystem cs;cs.setName("oldName");qDebug() << cs.name();//oldNameProjectProperties pp;pp.setCoordinateSystem(&cs);qDebug() << cs.name();//newName...
C++ (Qt)...public slots: const CoordinateSystem* coordinateSystem() const {return curCoordinateSystem;} void setCoordinateSystem(const CoordinateSystem *newCoordinateSystem) { curCoordinateSystem = newCoordinateSystem; } private: const CoordinateSystem* curCoordinateSystem;...
C++ (Qt)void ProjectProperties::setCoordinateSystem(const CoordinateSystem *newCoordinateSystem){ if (newCoordinateSystem){ curCoordinateSystem = const_cast<CoordinateSystem*>(newCoordinateSystem); //так нельзя! };}
C++ (Qt)...QPointer<CoordinateSystem> curCoordinateSystem;...
C++ (Qt)...if (!curCoordinateSystem) return;...