Skip to content

Commit c324895

Browse files
committedMar 28, 2014
Merge pull request #1275 from sebastic/arm
Support building QGIS on ARM (#9917)
2 parents a82aeb0 + 3d44c59 commit c324895

File tree

9 files changed

+38
-5
lines changed

9 files changed

+38
-5
lines changed
 

‎python/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ IF(NOT ANDROID)
5555
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ANDROID)
5656
ENDIF(NOT ANDROID)
5757

58+
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
59+
ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
60+
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} ARM)
61+
ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
62+
5863
IF(NOT WITH_TOUCH)
5964
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} HAVE_TOUCH)
6065
ENDIF(NOT WITH_TOUCH)

‎python/core/composer/qgscomposerscalebar.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class QgsComposerScaleBar: QgsComposerItem
109109
of the segment
110110
@note python bindings not available on android
111111
*/
112-
%If (!ANDROID)
112+
%If (!ARM)
113113
void segmentPositions( QList<QPair<double, double> >& posWidthList ) const;
114114
%End
115115

‎python/core/qgsclipper.sip

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
%Feature ARM
2+
13
class QgsClipper
24
{
35
%TypeHeaderCode
@@ -34,7 +36,7 @@ class QgsClipper
3436
// A handy way to refer to the four boundaries
3537
enum Boundary {XMax, XMin, YMax, YMin};
3638

37-
%If (!ANDROID)
39+
%If (!ARM)
3840
// Trims the given feature to a rectangular box. Returns the trimmed
3941
// feature in x and y. The shapeOpen parameter determines whether
4042
// the function treats the points as a closed shape (polygon), or as

‎src/app/gps/qwtpolar-1.0/qwt_polar_curve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ void QwtPolarCurve::drawLines( QPainter *painter,
433433

434434
if ( !clipRect.isEmpty() )
435435
{
436-
double off = qCeil( qMax( 1.0, painter->pen().widthF() ) );
436+
double off = qCeil( qMax((qreal)1.0,painter->pen().widthF() ) );
437437
clipRect = clipRect.toRect().adjusted( -off, -off, off, off );
438438
polyline = QwtClipper::clipPolygonF( clipRect, polyline );
439439
}

‎src/app/gps/qwtpolar-1.0/qwt_polar_layout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
278278
// We don't allow vertical legends to take more than
279279
// half of the available space.
280280

281-
dim = qMin( hint.width(), rect.width() * d_data->legendRatio );
281+
dim = qMin( hint.width(), (qreal)(rect.width() * d_data->legendRatio) );
282282

283283
if ( !( options & IgnoreScrollbars ) )
284284
{
@@ -293,7 +293,7 @@ QRectF QwtPolarLayout::layoutLegend( Options options, QRectF &rect ) const
293293
}
294294
else
295295
{
296-
dim = qMin( hint.height(), rect.height() * d_data->legendRatio );
296+
dim = qMin( hint.height(), (qreal)(rect.height() * d_data->legendRatio) );
297297
dim = qMax( dim, d_data->layoutData.legend.hScrollBarHeight );
298298
}
299299

‎src/core/qgscoordinatetransform.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,17 @@ void QgsCoordinateTransform::transformInPlace(
434434
}
435435
}
436436

437+
#ifdef QT_ARCH_ARM
438+
void QgsCoordinateTransform::transformInPlace( qreal& x, qreal& y, double& z,
439+
TransformDirection direction ) const
440+
{
441+
double xd = (double) x, yd = (double) y;
442+
transformInPlace(xd, yd, z, direction);
443+
x=xd;
444+
y=yd;
445+
}
446+
#endif
447+
437448
#ifdef ANDROID
438449
void QgsCoordinateTransform::transformInPlace( float& x, float& y, float& z,
439450
TransformDirection direction ) const

‎src/core/qgscoordinatetransform.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ class CORE_EXPORT QgsCoordinateTransform : public QObject
156156
// and y variables in place. The second one works with good old-fashioned
157157
// C style arrays.
158158
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform ) const;
159+
#ifdef QT_ARCH_ARM
160+
void transformInPlace( qreal& x, qreal& y, double &z, TransformDirection direction = ForwardTransform ) const;
161+
#endif
159162

160163
//! @note not available in python bindings
161164
void transformInPlace( QVector<double>& x, QVector<double>& y, QVector<double>& z,

‎src/core/qgsmaptopixel.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ void QgsMapToPixel::transformInPlace( double& x, double& y ) const
138138
y = yMax - ( y - yMin ) / mMapUnitsPerPixel;
139139
}
140140

141+
#ifdef QT_ARCH_ARM
142+
void QgsMapToPixel::transformInPlace( qreal& x, qreal& y ) const
143+
{
144+
x = ( x - xMin ) / mMapUnitsPerPixel;
145+
y = yMax - ( y - yMin ) / mMapUnitsPerPixel;
146+
}
147+
#endif
148+
141149
void QgsMapToPixel::transformInPlace( QVector<double>& x,
142150
QVector<double>& y ) const
143151
{
@@ -161,3 +169,4 @@ void QgsMapToPixel::transformInPlace( QVector<float>& x,
161169
transformInPlace( x[i], y[i] );
162170
}
163171
#endif
172+

‎src/core/qgsmaptopixel.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ class CORE_EXPORT QgsMapToPixel
6666
given coordinates in place. Intended as a fast way to do the
6767
transform. */
6868
void transformInPlace( double& x, double& y ) const;
69+
#ifdef QT_ARCH_ARM
70+
void transformInPlace( qreal& x, qreal& y ) const;
71+
#endif
6972

7073
/* Transform device coordinates to map coordinates. Modifies the
7174
given coordinates in place. Intended as a fast way to do the

0 commit comments

Comments
 (0)
Please sign in to comment.