[PyKDE] newbie question about dealing with Images in pyQt
Gordon Tyler
gordon at doxxx.net
Tue Jun 3 18:02:01 BST 2003
Adam Shimali wrote:
> I assume I need to create a QImage object from each
> image file name. Can I then place each image in a
> QGridLayout or do I need to put the image on a panel
> and then stick each panel into the grid?
A QGridLayout is a layout manager. It has to be used in combination with
a container widget to do actually anything. So you would use a panel
(e.g. QFrame or QWidget) which uses a QGridLayout for it's layout
manager and then you would add QImages to the panel with the appropriate
layout constraints that would place them in the correct grid location.
> Also would it make sense to place the grid directly
> into a QFrame?
If this grid of images is a logical self-contained component, then it
might be better to use a QWidget which can then be embedded in some
other container widget like QFrame or QDialog depending on where you
need to use it.
Ciao,
Gordon
More information about the PyQt
mailing list