P
P
Pascaller2016-03-20 20:52:26
Python
Pascaller, 2016-03-20 20:52:26

How to make a widget to display images in PyQt?

There is a very simple task - to count all the photos from a given directory and display their previews in a grid for users. It seems that everything is very simple, but it is not possible to make the width of the widget change dynamically.
Those. if the user expanded the program window, I would like the number of columns to increase, say, from 3 to 5. It is desirable without additional intervention in the code. All thumbnails will be the same size, but I would like to be able to change this size for the visually impaired. In general, the usual gallery. How to do it easier?
Python 2.7, Qt4
63947c2e97d84f479f13bf7b16b5e8ed.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
J
Jacob E, 2016-03-20
@Zifix

I see here also an android with a touch screen, definitely QML. There's Grid out of the box that does what you need.

Z
zaswed, 2016-03-23
@zaswed

'It is desirable without additional intervention in the code' - how is that? the window in the designer is made?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question