Пример #1
0
    def initUI(self):
        container = QtGui.QWidget()
        layout = FlowLayout(spacing=0)
        container.setLayout(layout)

        images = assets.getFileList('animals')
        random.shuffle(images)
        for imageName in images:
            image = assets.getQImage('animals/%s' % imageName).scaled(200, 175)

            w = IconLayout(image, imageName)
            layout.addWidget(w)

        container.setLayout(layout)
        self.setWidget(container)
        self.setWindowTitle('Images')
Пример #2
0
    def initUI(self):
        container = QtGui.QWidget()
        layout = FlowLayout(spacing=0)

        image = assets.getQImage('folder.png').scaled(200, 200)
        folderNames = [
            '.1,1', '.1,2', '.1,3', 'Cats', '.2,1', 'Cows', '.2,3', '.2,4',
            '.3,1', '.3,2', 'Dogs', '.3,4', 'Pigs', '.4,2', '.4,3', '.4,4'
        ]
        #folderNames = sorted(folderNames)
        for i in range(len(folderNames)):
            w = FolderIcon(image, folderNames[i])
            layout.addWidget(w)

        container.setLayout(layout)
        self.setWidget(container)
        self.setWindowTitle('Folders')
Пример #3
0
    def __init__(self, input_file_widget, execute_widget):
        QtGui.QWidget.__init__(self)
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.input_file_widget = input_file_widget
        self.execute_widget = execute_widget

        self.current_file = None
        self.getFileName()

        self.input_file_widget.input_file_opened.connect(self.inputFileOpened)

        #Create the post processor list view
        self.post_processor_list_view = QtGui.QListView()
        self.post_processor_list_model = QtGui.QStandardItemModel()
        self.post_processor_list_view.setModel(self.post_processor_list_model)
        self.postProcessorModelFill()

        # adds a scroll layout to the main widget so all of the plots don't take up too much space
        # scroll area widget contents - layout
        scroll = ResizeScrollArea()
        wrapper = QtGui.QWidget()
        self.flow_layout = FlowLayout()
        wrapper.setLayout(self.flow_layout)
        scroll.setWidget(wrapper)
        scroll.setWidgetResizable(True)
        pal = QtGui.QPalette(scroll.palette())
        pal.setColor(QtGui.QPalette.Window, QtGui.QColor('lightgray'))
        scroll.setPalette(pal)

        # adds a button to the widget that will be used to clear plot selections
        self.clear_button = QtGui.QPushButton("Clear")
        self.clear_button.setToolTip('Clear current plots')
        self.clear_button.resize(self.clear_button.sizeHint())
        self.clear_button.clicked.connect(self.clearClick)

        # adds an open box to the widget
        self.open_button = QtGui.QPushButton("Open")
        self.open_button.setToolTip(
            'Select an existing CSV file to read so the postprocessor values can be plotted'
        )
        self.open_button.resize(self.clear_button.sizeHint())
        self.open_button.clicked.connect(self.openClick)

        #assemble the bottom layout
        self.button_layout = QtGui.QHBoxLayout()
        self.button_layout.addWidget(self.open_button)
        self.button_layout.addWidget(self.clear_button)

        #assemble the top layout
        self.left_widget = QtGui.QWidget()
        self.left_layout = QtGui.QVBoxLayout()
        self.left_widget.setLayout(self.left_layout)

        self.left_layout.addWidget(self.post_processor_list_view)
        self.left_layout.addLayout(self.button_layout)

        self.top_layout = QtGui.QSplitter()
        self.top_layout.addWidget(self.left_widget)
        self.top_layout.addWidget(scroll)

        self.top_layout.setStretchFactor(0, 0.1)
        self.top_layout.setStretchFactor(1, 0.9)

        self.top_layout.setSizes([100, 500])

        #assemble the overall layout
        self.main_layout = QtGui.QVBoxLayout()
        self.main_layout.addWidget(self.top_layout)
        self.setLayout(self.main_layout)

        self.timerSetUp()

        self.executeSignalLinking()

        self.modifyUI()
        ''' This will be called after the interface is completely setup to allow an application to modify this tab '''