#!/usr/bin/env python

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from structData.room import Room

class RoomList(QWidget):

    def __init__(self, parent=None, list_of_image=list()):

        super(RoomList, self).__init__(parent)
        self.list_of_image = list_of_image
        for img in self.list_of_image:
            self.addImage(img)

    def addImage(self, (name, path_image)):
        self.list_of_image.append((name, path_image))
        self.update()

    def paintEvent(self, event):
        print "entro"
        vertical = QVBoxLayout(self)
        for image in self.list_of_image:
            self.scroll_area = QScrollArea(self)
            self.scroll_area.setMinimumSize(260, 260)
            self.scroll_area.setSizePolicy(QSizePolicy.Fixed,
                                           QSizePolicy.Fixed)
            #self.scroll_area.setBackgroundRole(QPalette.Dark)
            self.scroll_area.setAlignment(Qt.AlignCenter)
            self.image_label = QLabel()
            image = QImage(image[1]).scaled(250, 250)
            self.image_label.setPixmap(QPixmap.fromImage(image))
            self.scroll_area.setWidget(self.image_label)
            vertical.addWidget(self.scroll_area, Qt.AlignCenter)


class RoomManager(QWidget):

    def __init__(self, parent=None, rooms=list()):
        super(RoomManager, self).__init__(parent)
        self.setMinimumSize(300, 1000)
        self.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,
                                       QSizePolicy.Fixed))
        self.vertical_scroll = QScrollArea(self)
        self.vertical_scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        self.vertical_scroll.setWidgetResizable(False)
        self.vertical_scroll.setMinimumSize(300, 1000)
        self.vertical_scroll.setAlignment(Qt.AlignVCenter)
        self.room_list = RoomList(self, rooms)
        #vertical_scroll.setAlignment(Qt.Vertical)
        self.vertical_scroll.setWidget(self.room_list)


@@ -107,1140 +107,8 @@
 om%0A%0A
-class RoomList(QWidget):%0A%0A    def __init__(self, parent=None, list_of_image=list()):%0A%0A        super(RoomList, self).__init__(parent)%0A        self.list_of_image = list_of_image%0A        for img in self.list_of_image:%0A            self.addImage(img)%0A%0A    def addImage(self, (name, path_image)):%0A        self.list_of_image.append((name, path_image))%0A        self.update()%0A%0A    def paintEvent(self, event):%0A        print %22entro%22%0A        vertical = QVBoxLayout(self)%0A        for image in self.list_of_image:%0A            self.scroll_area = QScrollArea(self)%0A            self.scroll_area.setMinimumSize(260, 260)%0A            self.scroll_area.setSizePolicy(QSizePolicy.Fixed,%0A                                           QSizePolicy.Fixed)%0A            #self.scroll_area.setBackgroundRole(QPalette.Dark)%0A            self.scroll_area.setAlignment(Qt.AlignCenter)%0A            self.image_label = QLabel()%0A            image = QImage(image%5B1%5D).scaled(250, 250)%0A            self.image_label.setPixmap(QPixmap.fromImage(image))%0A            self.scroll_area.setWidget(self.image_label)%0A            vertical.addWidget(self.scroll_area, Qt.AlignCenter)%0A%0A%0A
 clas
@@ -131,16 +131,16 @@
 idget):%0A
+
 %0A    def
@@ -697,45 +697,298 @@
     
-self.
+rooms_list = QListWidget(self)%0A        
 room
+s
 _list
- = RoomList(self, rooms
+.setIconSize(QSize(150, 150))%0A        for room in rooms:%0A            print room%5B0%5D%0A            image = QImage(room%5B1%5D)%0A            room_item = QListWidgetItem(QIcon(QPixmap.fromImage(image)), room%5B0%5D)%0A            rooms_list.addItem(room_item
 )%0A  
@@ -1079,17 +1079,13 @@
 get(
-self.
 room
+s
 _lis

Change rooms visualization