fixed some errors on OS other than win

preferencesAboutTextFull
Claudio Valerio 14 years ago
parent 92b664b306
commit b485765eec
  1. 21
      src/adaptors/UBSvgSubsetAdaptor.cpp
  2. 1
      src/tools/UBAbstractDrawRuler.h
  3. 7
      src/tools/UBGraphicsProtractor.cpp
  4. 4
      src/tools/UBGraphicsProtractor.h

@ -2576,31 +2576,18 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
graphicsItemFromSvg(triangle);
//QStringRef angle = mXmlReader.attributes().value(mNamespaceUri, "angle");
//if (!angle.isNull())
//{
// protractor->setAngle(angle.toString().toFloat());
//}
//QStringRef markerAngle = mXmlReader.attributes().value(mNamespaceUri, "marker-angle");
//if (!markerAngle.isNull())
//{
// protractor->setMarkerAngle(markerAngle.toString().toFloat());
//}
QStringRef svgX = mXmlReader.attributes().value("x");
QStringRef svgY = mXmlReader.attributes().value("y");
QStringRef svgWidth = mXmlReader.attributes().value("width");
QStringRef svgHeight = mXmlReader.attributes().value("height");
UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation =
UBGraphicsTriangle::orientationFromStr((mXmlReader.attributes().value("orientation")));
QStringRef orientationStringRef = mXmlReader.attributes().value("orientation");
UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::orientationFromStr(orientationStringRef);
if (!svgX.isNull() && !svgY.isNull() && !svgWidth.isNull() && !svgHeight.isNull())
{
triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat()
, svgWidth.toString().toFloat(), svgHeight.toString().toFloat(),
orientation);
triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat(), svgWidth.toString().toFloat(), svgHeight.toString().toFloat(), orientation);
}
triangle->setVisible(true);

@ -18,6 +18,7 @@ class UBAbstractDrawRuler : public QObject
virtual void StartLine(const QPointF& position, qreal width);
virtual void DrawLine(const QPointF& position, qreal width);
virtual void EndLine();
protected:
void paint();

@ -13,6 +13,7 @@
#include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "core/memcheck.h"
@ -30,6 +31,8 @@ UBGraphicsProtractor::UBGraphicsProtractor()
, mResizeSvgItem(0)
, mMarkerSvgItem(0)
{
sFillTransparency = 127;
sDrawTransparency = 192;
create(*this);
@ -584,7 +587,9 @@ UBItem* UBGraphicsProtractor::deepCopy() const
void UBGraphicsProtractor::rotateAroundTopLeftOrigin(qreal angle)
{}
{
Q_UNUSED(angle);
}
QPointF UBGraphicsProtractor::topLeftOrigin() const
{

@ -58,6 +58,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual void hoverMoveEvent (QGraphicsSceneHoverEvent *event);
virtual QPainterPath shape() const;
QRectF boundingRect() const;
private:
// Helpers
void paintGraduations (QPainter *painter);
@ -94,6 +95,9 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
virtual void rotateAroundTopLeftOrigin(qreal angle);
virtual QPointF topLeftOrigin() const;
int sFillTransparency;
int sDrawTransparency;
};
#endif /* UBGRAPHICSPROTRACTOR_H_ */

Loading…
Cancel
Save