How can I achieve a layout similar to searching for Google images in QT (PyQT)?

I am new to QT. I am using PyQT to develop a graphical interface in my project. I want to achieve this layout in my application. This application searches for images from the image database. Google Image Search Image is perfect for my purpose.

alt text http://img821.imageshack.us/img821/8379/window2.png

I follow the book "Quick GUI Programming with Python and Qt" and I am familiar with the layouts. I think I need to use a grid layout with each image result in each grid cell. and use the vertical layout for (image, Qlabel, Qlabel) inside each grid square.

Here are some issues that I am facing.

  • It is important to note that I cannot display the image. What control / widget do I need? I can not find anything similar to PictureBox.NET.

  • How to separate the result of this image from a fixed gap, as in the image? I use horizontal and vertical spacers, but this does not work?

  • How to install QLabel as clickable (for example, a hyperlink). I do not want to open the url. Just the text should be accessible clickable. This way when the user clicks on the link. I can show more information (for example, the next set of results when he clicks on the next page number or a new window with the full size of the image when the user clicks “view”). Do we have any new kind of control for this?

  • . ( ) , . page ? , page QT?

  • . GUI. http://google.com ( ). . . . ?

, , . , .

+3
2

1/2. QListWidget , QListView:: IconMode. , , QListWidget/QListWidgetItem api, QAbstractListModel QListView . Qt primer /.

, .

KDE Dolphin: Dolphin's icon mode

3. QLabel, href.

:

edit: , PyQt, - ++, , python.

  QLabel *linkLabel = new QLabel;
  linkLabel->setTextFormat( Qt::RichText )
  linkLabel->setText( "<a href=\"someurl\"> Click me! </a>" );
  connect( linkLabel, SIGNAL( linkActivated ( const QString & link ) ), .... )

4. , /, ? , . , , , , M/V!

, , . , " " " ". , linkActivated(), . , /. " " QListView , , , ? .

5. QStackedWidget, addWidget() "", call setCurrentIndex/Widget() .

: , , Google, , Google Image Search - -, , (, , .). , -, , , -, , API . , , , .

, -, javascript HTML QWebView?

+13

QListWidget viewMode, IconMode. . , , QListView /

+3

Source: https://habr.com/ru/post/1752625/


All Articles