Results 1 to 2 of 2

Thread: 2 images qt-qml app

  1. #1
    Join Date
    Jan 2013
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Post 2 images qt-qml app

    Hi All,

    I am totally new in Qt development. Even not enough familiar with c++ language too

    I am trying to develop an Qt GUI Application which have mainly two images (“Im1” & “Im2”). The main purpose of this application is to slide Im1 on Im2 based of different values of a variable (Lets say, name of variable is “Vl”)

    Since i was not able to attached the exact images which am using for my application, i mentioned an illustration below:

    0========================================== position at Vl=0;

    =========0================================= position at Vl=2;

    ===================0======================= position at Vl=3;

    ====================================0====== position at Vl=9;

    -- So basically Im1(0) has to be move on Im2(====) depending upon different values of ‘Vl’.
    -- I have some changing values (ranging from 0 to 10) which i am reading from a file and i want to assign these value “Vl” variable.
    -- Based on that the point(Im1) will slide on static slider(Im2)
    -- The program should run continuously as i keep changing the values inside the file and thus Vl will update.
    -- Here is the complete flow
    a) Continuously reading values from a file —>
    b) Reads one value at a time -->
    c) Read value will be assigned to Vl variable -->
    d) Moving Im1 based on current Vl value -->
    e) This Im will move/slide horizontally every-time depending on Vl values

    I went through some QML element such as Transition, translate, signal connection etc but do not have enough knowledge about using them.
    Hence could anyone please suggest sample code for this. Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: 2 images qt-qml app

    javascript Code:
    1. import QtQuick 2.0
    2.  
    3. Item {
    4. id: root
    5. width: 800
    6. height: 800
    7.  
    8. Rectangle {
    9. id: im2
    10. width: 600
    11. height: 50
    12. anchors.centerIn: parent
    13.  
    14. Rectangle {
    15. id: im1
    16. property int vi: 0
    17.  
    18. width: 80; height: 80; radius: width/2
    19. anchors.verticalCenter: parent.verticalCenter
    20. x: im2.width*vi/10
    21. PropertyAnimation on vi {
    22. from: 0
    23. to: 10
    24. duration: 3000
    25. loops: Animation.Infinite
    26. running: true
    27. }
    28. }
    29. }
    30. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 20th January 2011, 10:26
  2. Replies: 1
    Last Post: 16th November 2010, 17:45
  3. Images
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2009, 15:22
  4. help: about images
    By miguel_mark in forum Qt Programming
    Replies: 2
    Last Post: 8th December 2009, 07:10
  5. Replies: 4
    Last Post: 27th July 2009, 15:45

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.