Results 1 to 7 of 7

Thread: Replacing One image with another

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Replacing One image with another

    Hi all

    I am working on Qt3.1(Red HAt Linux).I m having a Tree Structure of various Files and Folders.Files and Folders both are represented by different different images.
    Now what I want is That When I Click on a Particular File or Folder Having different images is being replaced by another images.

    Foreg.

    Files->representedby->image1
    Folders->representedby->image2

    Now when I select a Particular File
    i.e When I Click on FileItem then image1 Can be Replaced By any another image say image3.

    same for folders

    Now when I select a Particular Folder
    i.e When I Click on Folder then image2 Can be Replaced By any another image say image4

    Please do reply with example.

    Cheers
    Merry

  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: Replacing One image with another

    Use a signal-slot connection and replace the pixmap with another one.

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Replacing One image with another

    Thanx 4 ur reply But is there any other alternative .

  4. #4
    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: Replacing One image with another

    Any alternative to what? You can always just... do nothing

  5. The following user says thank you to wysota for this useful post:

    merry (8th February 2007)

  6. #5
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Replacing One image with another

    OhThanx for telling Me That i just do nothing and From now I wont ask for ur help Ok

  7. #6
    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: Replacing One image with another

    You asked for help, you were given help. I gave you the simplest solution possible and you didn't like it. Without more information I won't give you another solution as I don't know what is wrong with the first one I gave.

    Basically you do something by calling respective methods from classes handling the component you use and the way to change the image displayed is to call a method for... changing the image which is called setPixmap(). If you don't want to use it, then simply subclass and implement your own painting based on whatever you like.

    I take it that we're talking about QListViewItems, so you have a signal which is emitted when en entry is clicked and you have a method to call to set a new image. What more do you want?

  8. #7
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Replacing One image with another

    Sorry , Yaa Its My fault that I wont explained you properly what i want.

Similar Threads

  1. how i can add image in my toolbar
    By jyoti in forum Qt Tools
    Replies: 7
    Last Post: 19th December 2006, 14:39
  2. "sensitising" an image
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 28th June 2006, 07:21
  3. Fast image drawing/scaling in Qt 3.3
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 10:45
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

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.