Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Images Slider in GUI
Qt 6.11 is out! See what's new in the release blog

[SOLVED] Images Slider in GUI

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 5.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ade Malsasa Akbar
    wrote on last edited by
    #1

    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 :)

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vladstelmahovsky
      wrote on last edited by
      #2

      I think you may consider to look at qml side

      1 Reply Last reply
      0
      • raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        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...

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Alek Śmierciak
          wrote on last edited by
          #4

          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).

          1 Reply Last reply
          0
          • A Offline
            A Offline
            Ade Malsasa Akbar
            wrote on last edited by
            #5

            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!

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved