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

Documentation improvement for QVBoxLayout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.13
    • 5.13.0
    • Documentation
    • None

    Description

      Received via feedback@qt.io:

      In the URL https://doc.qt.io/qtforpython/tutorials/basictutorial/dialog.html, Under https://doc.qt.io/qtforpython/tutorials/basictutorial/dialog.html#create-a-layout-to-organize-the-widgets anchor - "Qt comes with layout-support that helps you organize the widgets in your application. In this case, let’s use QVBoxLayout to lay out the widgets vertically. Add the following code to the init() method, after creating the widgets:", while showing the following code:

      # Create layout and add widgets
      layout = QVBoxLayout()
      layout.addWidget(self.edit)
      layout.addWidget(self.button)
      # Set dialog layout
      self.setLayout(layout)
      

      This will instantly end up in error, even after following the previous instructions perfectly. The reason is QVBoxLayout is not yet imported within the code snippets.

      For a beginner - it might be confusing, so maybe this part can be rewritten with instructions to import the necessary libraries?

      Attachments

        Activity

          People

            vertries Nico Vertriest (Inactive)
            e0101981 Janne Anttila
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: