[SOLVED] Images Slider in GUI
-
Bismillahirrahmanirrahim,
How to create a simple image slider? An absolute example, that inspires me intensely, is Ubiquity in Ubuntu. If you install Ubuntu, you will face an installer which is show you images slider after all configuration. It is awesome, and pretty beautiful. I want to create a simple application (just as simple as Qt default example program) that can do images sliding. In my imagination, just like this:
This is Ubiquity
!http://www.omgubuntu.co.uk/wp-content/uploads/2010/09/UbiquitySlideshowwithWebkit_018.png(This is Ubiquity)!
This is what I want, simpler
!http://i.imgur.com/ml3MrYj.jpg(This is what I want)!
When I click Satu, picture1.png appears. And when I click Dua, picture2.png appear replacing picture1.png. Similiar with Ubiquity or normal web images slider as we can find in many websites.
How to do that (my mean, the codes)? Is there any example before me? Any tutorial for that? What GUI element I should use? A QLabel? Thank you for your answer :)
-
I think you may consider to look at qml side
-
there are about thousand of possible ways to implement what you want. ;)
But in almost every way you may use "QPropertyAnimation":http://qt-project.org/doc/qt-4.8/qpropertyanimation.html class.You may want to read this "article":http://qt-project.org/doc/qt-4.8/animation-overview.html.
And check out the Qt examples, chapter "Animation Framework". This should give you alot of ideas how to accomplish what you want... -
If you consider using QML and Qt Quick, then in Qt 5.1 you can use QtQuick's "StackView":http://doc-snapshot.qt-project.org/qt5-stable/qtquickcontrols/qml-qtquick-controls1-stackview.html and implement proper transitions between the items (pages of stack).
-
Hello, I come again now to inform you all that my problem was solved. Apparently it is easy even I have wrote the solution in a post in Indonesian at http://malsasa.wordpress.com/2013/06/05/qt-creator-pemrograman-aplikasi-gui-di-linux/. The main point here, I don't want to be persistent and as beautiful as Ubiquity. No, I don't want it, just wanna simple. This is my solution.
Create new GUI app project then add two Push Button and one Label.
Give the button a slot in clicked() signal.
Add code below.
Add same code into second button but cgane the picture into another.
Run it! Done!
Code:
@QImage frame;
frame.load(":/new/prefix/desktopfungsional-3a.jpg");
ui->PictureContainer->setPixmap(QPixmap::fromImage(frame));
//when PictureContainer is object name for Label and you already import some pictures into project.@Here is the program I have built: http://otodidak.freeserver.me/tarball/proyek_qt_creator/. Thank you, Qt Project Community!