GIF not Displayed in QT 5.15
-
V
Vivek_autometers about a minute agoHi All,
I am using QT 5.15 for Development on Embedded Board.
Rendering is done using Wayland.
Following is the sample code I am using.
***#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDialog>
#include <QMovie>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
QMovie *movie = new QMovie("doorClosel.gif");
ui->label->show();ui->label->setMovie(movie);
movie->start();
}
MainWindow::~MainWindow()
{
delete ui;
}***
The GIF File is in the local folder.
Pro File Content:• QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
deprecated before Qt 6.0.0
SOURCES +=
main.cpp
mainwindow.cpp
HEADERS +=
mainwindow.h
FORMS +=
mainwindow.ui
Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target******
It is working fine on the desktop
but not showing in Embedded System.
Can please someone explain how to do that on Embedded Board.
Regards
Vivek -
V
Vivek_autometers about a minute agoHi All,
I am using QT 5.15 for Development on Embedded Board.
Rendering is done using Wayland.
Following is the sample code I am using.
***#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDialog>
#include <QMovie>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
QMovie *movie = new QMovie("doorClosel.gif");
ui->label->show();ui->label->setMovie(movie);
movie->start();
}
MainWindow::~MainWindow()
{
delete ui;
}***
The GIF File is in the local folder.
Pro File Content:• QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
deprecated before Qt 6.0.0
SOURCES +=
main.cpp
mainwindow.cpp
HEADERS +=
mainwindow.h
FORMS +=
mainwindow.ui
Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target******
It is working fine on the desktop
but not showing in Embedded System.
Can please someone explain how to do that on Embedded Board.
Regards
Vivek@Vivek_autometers said in GIF not Displayed in QT 5.15:
QMovie *movie = new QMovie("doorClosel.gif");
The GIF File is in the local folder.
What "local folder", and what evidence do you have that using this relative path picks that up? Could you at least verify (in your code) that the file exists and has been picked up by this line of code?
-
C Christian Ehrlicher moved this topic from C++ Gurus on
-
@Vivek_autometers said in GIF not Displayed in QT 5.15:
QMovie *movie = new QMovie("doorClosel.gif");
The GIF File is in the local folder.
What "local folder", and what evidence do you have that using this relative path picks that up? Could you at least verify (in your code) that the file exists and has been picked up by this line of code?
Hi @JonB
I have verified it in 2 systems.
Desktop and Target.
Working on Desktop and not on target board.Regards
-
Hi @JonB
I have verified it in 2 systems.
Desktop and Target.
Working on Desktop and not on target board.Regards
- Make sure the file really exists where you expect it as @JonB already told you by using e.g. QFile::exists() and/or moving it to a Qt resource.
- Make sure the Qt gif imageformat plugin is available and check if it gets correctly loaded.
-
Hi @JonB
I have verified it in 2 systems.
Desktop and Target.
Working on Desktop and not on target board.Regards
@Vivek_autometers said in GIF not Displayed in QT 5.15:
I have verified it in 2 systems.
How does that verify that the file can be found? Do you understand where a relative path is sought from your running Qt application? Maybe it's different on target board from desktop (it may at least depend on how you invoked your application, for example from Creator or not, though there are other influencers.). Please put in code as I suggested and @Christian-Ehrlicher reiterated so that both you & we know for sure this is not an issue.
-
@Vivek_autometers said in GIF not Displayed in QT 5.15:
I have verified it in 2 systems.
How does that verify that the file can be found? Do you understand where a relative path is sought from your running Qt application? Maybe it's different on target board from desktop (it may at least depend on how you invoked your application, for example from Creator or not, though there are other influencers.). Please put in code as I suggested and @Christian-Ehrlicher reiterated so that both you & we know for sure this is not an issue.
Hi @JonB
Thanks for replying, but I have changed the file path to fix path
*QMovie movie = new QMovie("/home/root/doorClosel.gif");still the same issue.
My Query
1: Does QT Wayland Support GIF Format
2: If yes, is there any package missing that I should installRegards
-
Hi @JonB
Thanks for replying, but I have changed the file path to fix path
*QMovie movie = new QMovie("/home/root/doorClosel.gif");still the same issue.
My Query
1: Does QT Wayland Support GIF Format
2: If yes, is there any package missing that I should installRegards
Hi @JonB,
I just added Debug prints on Embedded Devices.
Here is the out come*root@colibri-imx6-10923511:~# ./gif_flv_test
File ExistsNot a valid File*
I am not sure why this is showing an invalid File.
Regards
-
Hi @JonB
Thanks for replying, but I have changed the file path to fix path
*QMovie movie = new QMovie("/home/root/doorClosel.gif");still the same issue.
My Query
1: Does QT Wayland Support GIF Format
2: If yes, is there any package missing that I should installRegards
@Vivek_autometers said in GIF not Displayed in QT 5.15:
1: Does QT Wayland Support GIF Format
Make sure the Qt gif imageformat plugin is available and check if it gets correctly loaded.
Reading would certainly help...
-
@Vivek_autometers said in GIF not Displayed in QT 5.15:
1: Does QT Wayland Support GIF Format
Make sure the Qt gif imageformat plugin is available and check if it gets correctly loaded.
Reading would certainly help...
@Christian-Ehrlicher
I am cross checking for it.
I have the sample code that is working in Desktop but not on other system.
Surely reading and checking for the sameRegards
-
@Christian-Ehrlicher
I am cross checking for it.
I have the sample code that is working in Desktop but not on other system.
Surely reading and checking for the sameRegards
@Vivek_autometers Why do you think just because it works on another machine means that the plugin is there on your target system and is loaded correctly??
Do whatever you want, I'm out.
-
@Vivek_autometers Why do you think just because it works on another machine means that the plugin is there on your target system and is loaded correctly??
Do whatever you want, I'm out.
@Christian-Ehrlicher
That's what I wanted to figure out
I was just curious how to do it. -
@Christian-Ehrlicher
That's what I wanted to figure out
I was just curious how to do it.@Vivek_autometers said in GIF not Displayed in QT 5.15:
I was just curious how to do it.
Following my links would be a start...
-
@Christian-Ehrlicher
That's what I wanted to figure out
I was just curious how to do it.1: Does QT Wayland Support GIF Format
Of course, if the GIF file is found and the Qt GIF image format plugin is present in the correct place on the running system. Which is why reading this...
Make sure the Qt gif imageformat plugin is available and check if it gets correctly loaded.
was important.
Well, have you deployed the Qt GIF image format plugin (
.../imageformats/libqgif.so
) on to the running system?
Have you checked that it has been found and loaded successfully?export QT_DEBUG_PLUGINS=1 ./gif_flv_test
Once you get it working, for the safety of all, do not run this as root.
-
This post is deleted!
-
Hi All,
Thank you for posting.
The issue is resolved.
Installed the missing plugin.Regards
Vivek -