Trying to populate values on my calendar widget
-
Hi,
Please enclose your code with coding tags (one @ a the beginning and one at the end) otherwise is very difficult to read it
-
Hi,
I solved it by myself :) thanks a lot for your reply :)
Had another issue.
Can gif images work on Qt GUI application ?
I am actually trying to make animated image work but it isn't working, but it works when I use Qt quick application.
Is it even possible to make it work in Qt GUI ??thanks a lot in advance,
Mansi -
Do you mean an animated gif ? IIRC you can use QMovie for that
-
@
#include "guianimation.h"#include <QApplication>
#include <QMovie>
#include <qmovie.h>
#include <QtWidgets>
#include <QLabel>int main(int argc, char *argv[])
{QApplication a(argc, argv);
QLabel *label= new QLabel;
QMovie *movie = new QMovie;movie->setFileName("movie1.gif"); // label->setFixedSize(100,100); label->setMovie(movie); movie->start(); label->show();
guianimation w;
w.show();return a.exec();
}
@ -
Is there any problem with the code ?
-
no problem with the code. It builds fine but when i run it .. animation doesnt work on my tab.
I used this extra line in my main program Q_IMPORT_PLUGIN(qgif)
and some changes in .pro file. This is how my .pro file looks
@#-------------------------------------------------Project created by QtCreator 2013-08-28T16:04:07
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = guianimation
TEMPLATE = app
QTPLUGIN += qgifSOURCES += main.cpp
guianimation.cppHEADERS += guianimation.h
FORMS += guianimation.ui
CONFIG += mobility
MOBILITY =
RESOURCES +=
movie2.qrc#CONFIG += static
#QTPLUGIN += qgif
OTHER_FILES +=
android/version.xml
android/res/values-id/strings.xml
android/res/values-nl/strings.xml
android/res/values-ru/strings.xml
android/res/values-zh-rCN/strings.xml
android/res/values-nb/strings.xml
android/res/values-rs/strings.xml
android/res/values-zh-rTW/strings.xml
android/res/values-fa/strings.xml
android/res/values-ja/strings.xml
android/res/values-pl/strings.xml
android/res/values-ms/strings.xml
android/res/values-fr/strings.xml
android/res/values-ro/strings.xml
android/res/values-de/strings.xml
android/res/layout/splash.xml
android/res/values-it/strings.xml
android/res/values-es/strings.xml
android/res/values/libs.xml
android/res/values/strings.xml
android/res/values-el/strings.xml
android/res/values-et/strings.xml
android/res/values-pt-rBR/strings.xml
android/AndroidManifest.xml
android/src/org/qtproject/qt5/android/bindings/QtActivity.java
android/src/org/qtproject/qt5/android/bindings/QtApplication.java
android/src/org/kde/necessitas/ministro/IMinistro.aidl
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidlwin32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../Qt5.1.0/5.1.0/android_armv7/plugins/imageformats/release/ -lqgif
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../Qt5.1.0/5.1.0/android_armv7/plugins/imageformats/debug/ -lqgif
else:unix: LIBS += -L$$PWD/../../../Qt5.1.0/5.1.0/android_armv7/plugins/imageformats/ -lqgifINCLUDEPATH += $$PWD/../../../Qt5.1.0/5.1.0/android_armv7/plugins/imageformats
DEPENDPATH += $$PWD/../../../Qt5.1.0/5.1.0/android_armv7/plugins/imageformats
@
when I build it.. I am getting these two errors " /home/manasi/workspace/guianimation/guianimation/main.cpp:18: error: undefined reference to 'qt_static_plugin_lqgif()' " and " :-1: error: collect2: error: ld returned 1 exit status " .
I assume there is a plugin "qgif" which is not found. I tried installing it but couldnt find it. The library file libqgif.so is there in the Qt directory.
Not sure how to debug it.. can you please help me ? :)Regards,
Mansi -
QTPLUGIN is used when you want to link against a static plugin which AFAIK is not what you are doing
-
you don't need to specify them in your PRO file using the QTPLUGIN variable.
Qt automatically reads them from the plugins directory.E.g. <QT>/plugins/imageformats/qgif.dll
(exact path is depending on your Qt version)Also you need to deploy the plugins with your application (in the correct sub-folder!
-
Hello,
I am actually confused here... I assume there is a difference between plugin and a library... there is something called as libqgif.so which is a library and a plugin qgif. I think the .so file has the plugin qgif.
And yes the library is there in the same path as you mentioned.My Qt is built dynamically and im trying to use a static plugin.. is that an issue ? Not able to figure out when you say deploy plugin with application.. what do you exactly mean by that ?? can you please elaborate....
Thanks a lot in advance,
Mansi -
[quote author="mansi" date="1377834213"]
My Qt is built dynamically and im trying to use a static plugin.. is that an issue ? [/quote]
yes it is! if you want to use Qt in a static manner you must have also built Qt itself statically.
Once you've built Qt statically read this about "static plugins":http://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins.[quote author="mansi" date="1377834213"]
Not able to figure out when you say deploy plugin with application.. what do you exactly mean by that ?? can you please elaborate....
[/quote]
This is only relevant when you deploy your application with dynamic linked libraries of course. For "deploying to windows":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html for example.