Use QImageReader to read the image, and QImageReader::supportsAnimation() and QImageReader::imageCount() to check if it's an animated image. Once you have only a QImage, that information will be lost, as QImage represents only one frame, i.e. a static image.
To display animated images, use QMovie. In QtQuick, the element AnimatedImage displays animated images.