Results 1 to 7 of 7

Thread: Moving left and right on the screen

  1. #1
    Join Date
    Dec 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Moving left and right on the screen

    Hi all,

    I have a pixmap that is 1000 pixels wide and the screen that is 220 pixels wide. What I am trying to do is to write some stuff on this 1000 pixels wide pixmap and move left and right to see that data. So I would initially write all data on this 1000 pixels wide pixmap but I don't exactly know how to implement this left/right scrolling over this pixmap. Does anyone has any idea? I have attached a picture with a description.


    Thank youm
    Benjamin
    Attached Images Attached Images

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

    Default Re: Moving left and right on the screen

    How about using QScrollArea with a QLabel holding the image?
    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.


  3. #3
    Join Date
    Dec 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Moving left and right on the screen

    Quote Originally Posted by wysota View Post
    How about using QScrollArea with a QLabel holding the image?
    I am not quite sure how to do that.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Moving left and right on the screen

    Quote Originally Posted by Benjamin View Post
    I am not quite sure how to do that.
    Have you had a look at the packages? Don't think so, because in the Detailed Description of QScrollArea there is exactly an example, which you need...

  5. #5
    Join Date
    Dec 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Moving left and right on the screen

    Quote Originally Posted by Lykurg View Post
    Have you had a look at the packages? Don't think so, because in the Detailed Description of QScrollArea there is exactly an example, which you need...
    As I can see QScroollArea uses a QLabel that has an image loaded in it. But in my case I have a file with some graphic data. I need to write these data on a pixmap and than scroll over that pixmap as I have presented on attached picture.

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Moving left and right on the screen

    Quote Originally Posted by Benjamin View Post
    As I can see QScroollArea uses a QLabel that has an image loaded in it. But in my case I have a file with some graphic data. I need to write these data on a pixmap and than scroll over that pixmap as I have presented on attached picture.
    Yeah, and a QLabel is not a picture, but you can set a picture/image what ever (=QPixmap) on it, so how they do at the example. QPixmap in the QLabel. QLabel in the QScrollArea.


    And beside in the example they transform the QImage in a QPixmap before setting it at the QLabel...

  7. #7
    Join Date
    Dec 2007
    Posts
    36
    Thanks
    2
    Qt products
    Qt3 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Moving left and right on the screen

    Quote Originally Posted by Lykurg View Post
    Yeah, and a QLabel is not a picture, but you can set a picture/image what ever (=QPixmap) on it, so how they do at the example. QPixmap in the QLabel. QLabel in the QScrollArea.


    And beside in the example they transform the QImage in a QPixmap before setting it at the QLabel...
    Ah, that makes sense. I have not seen that. I will give it a try.

    Thank you!!!

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.