Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2
Accepted Solution

Invalid scaling method

We extended ImageView in C++. It doesn't let us set the scaling method to none. We always get the log message "Invalid scaling method"

 

Either if we set it to none in C++ it does not work.

 

setScalingMethod(ScalingMethod::None);

 Or if we set it to none in QML it does not work.

scalingMethod: ScalingMethod.None

 All the other scaling methods work fine.

 

How do we make the ImageView not to scale the image?

 

The only solution we see is to implement the ImageView in QML which is not our preferred solution.

Developer
Posts: 216
Registered: ‎09-18-2009
My Device: Z10
My Carrier: O2

Re: Invalid scaling method

Okay, I found a really dirty workaround.

 

Assume we have a QByteArray containing the image data:

 

setScalingMethod(ScalingMethod::AspectFit);
QImage qImage = QImage::fromData(imageData);
setPreferredWidth(qImage.width());
setPreferredHeight(qImage.height());
setMinWidth(qImage.width());
setMinHeight(qImage.height());

 

BlackBerry Development Advisor
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Invalid scaling method

Hi oliver.kranz, thanks for logging this issue to the developer issue tracker. It is actually a known issue that's currently under investigation.

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker