Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-32527

Resizing issue with the widgets wich inherites QAbstractScrollArea.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.0.2
    • Widgets: GraphicsView
    • None
    • Ubuntu Precise 12.04 64 bit
      Qt version: 5.0.2
      PyQt version: 5.0

    Description

      In the example below, if I don't set the maximum size for the viewer, I've a view with the size 524278 x 524278. The MainWindow.resize(x, y) has no effect.

      This example demonstrate the issue with QGraphicsView, QScrollArea, QPlainTextEdit, etc

      ----------------------------------------------------------------------------

      1. coding: utf-8

      from PyQt5 import QtCore, QtGui, QtWidgets

      class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
      MainWindow.resize(460, 430)
      self.centralwidget = QtWidgets.QWidget(MainWindow)
      self.grid = QtWidgets.QGridLayout(self.centralwidget)
      self.verticalLayout = QtWidgets.QVBoxLayout()
      self.view = QtWidgets.QGraphicsView(self.centralwidget)
      self.view.setMaximumSize(QtCore.QSize(1000, 600))
      self.grid.addWidget(self.view, 0, 0, 1, 1)
      MainWindow.setCentralWidget(self.centralwidget)

      if _name_ == "_main_":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      QtCore.QCoreApplication.processEvents()
      print('Viewer size:', ui.view.geometry())
      sys.exit(app.exec_())
      ----------------------------------------------------------------------------

      Comment the line self.view.setMaximumSize(QtCore.QSize(1000, 600))`to see the issue.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            vinss Vincent Vande Vyvre
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes