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
Re: Replacing One image with another
Use a signal-slot connection and replace the pixmap with another one.
Re: Replacing One image with another
Thanx 4 ur reply But is there any other alternative .
Re: Replacing One image with another
Any alternative to what? You can always just... do nothing :)
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:o
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?
Re: Replacing One image with another
Sorry , Yaa Its My fault that I wont explained you properly what i want.