def _add_package_tab(self, package_name): package_widget = QtWidgets.QWidget() package_layout = QtWidgets.QVBoxLayout() package_layout.setContentsMargins(2, 2, 2, 2) package_layout.setSpacing(2) package_widget.setLayout(package_layout) package_scroll = QtWidgets.QScrollArea() package_scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) package_scroll.setWidgetResizable(True) package_scroll.setWidget(package_widget) self._package_tabs.addTab(package_widget, package_name) return package_layout
def setup_ui(self): super(DownloadSplashDialog, self).setup_ui() main_widget = QtWidgets.QWidget() main_layout = QtWidgets.QVBoxLayout() main_widget.setLayout(main_layout) self._stack.addWidget(main_widget) download_widget = QtWidgets.QWidget() download_layout = QtWidgets.QVBoxLayout() download_widget.setLayout(download_layout) content_area = QtWidgets.QScrollArea(parent=self) content_area.setMinimumHeight(qtutils.dpi_scale(150)) content_area.setWidgetResizable(True) content_area.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) # content_area.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) content_area.setWidget(download_widget) content_area.setStyleSheet( 'background-color: transparent; border: none;') self._download_layout = QtWidgets.QVBoxLayout() download_layout.addLayout(self._download_layout) main_layout.addStretch() main_layout.addWidget(content_area)