PDA

View Full Version : QImage::scaled() error in Qt4/e



Neo
6th April 2006, 05:07
In Qt/e 4.0.0 b2 open source version, I employ QImage::scaled() to scale the image to the specified width and height, but the complier tell me this:
no matching function for call to 'QImage::scaledToHeight(int &, Qt::TransformationMode)'

When I use scaled() and other scaledToWidth(), it also give the error.

whether this version Qt will not provide the image function?

Dark_Tower
6th April 2006, 08:26
Seems like the integer parameter that you're passing is not valid. Could it be because you are passing a reference to an int not strictly an int?
From the docs:

QImage scaledToHeight ( int height, Qt::TransformationMode mode = Qt::FastTransformation ) const
look at the int parameter...


Could you post some code to see where and how you call the function?

Neo
7th April 2006, 06:15
Yes, in this version, the QImage class declare as below:
#ifndef QT_NO_IMAGE_TRANSFORMATION
inline QImage scale( ........)
QImage scale(const QSize,......)
.........
#endif

this function is not here by default, and the embedded version include some macro for compiling, and some capbilities should be switch on by compiling macros.