Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. widgets and modules
Forum Updated to NodeBB v4.3 + New Features

widgets and modules

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 607 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MIckH
    wrote on last edited by
    #1

    HI,
    One of the biggest challanges I seem to face while developing my QT GUI is which module contains the widget I want to work with.

    Is there a graph or sheet somewhere that shows these relationships easily for QT6?

    TIA

    JonBJ 1 Reply Last reply
    0
    • M MIckH

      HI,
      One of the biggest challanges I seem to face while developing my QT GUI is which module contains the widget I want to work with.

      Is there a graph or sheet somewhere that shows these relationships easily for QT6?

      TIA

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @MIckH
      Not sure what your issue is. All QWidgets are in the ... widgets module. You look at the docs page to see what to include, e.g. https://doc.qt.io/qt-6/qspinbox.html tells you to #include <QSpinBox>. The various widget classes are listed on Widgets Classes.

      M 1 Reply Last reply
      1
      • JonBJ JonB

        @MIckH
        Not sure what your issue is. All QWidgets are in the ... widgets module. You look at the docs page to see what to include, e.g. https://doc.qt.io/qt-6/qspinbox.html tells you to #include <QSpinBox>. The various widget classes are listed on Widgets Classes.

        M Offline
        M Offline
        MIckH
        wrote on last edited by MIckH
        #3

        @JonB
        ok, i'll be more specific. while you are right about them all being in 'widgets' its not best practice to just call that module for everything

        Here is what Im talking about:

        from PyQt6.QtCore import Qt
        from PyQt6.QtGui import QStandardItemModel, QStandardItem, QFont, QBrush
        from PyQt6.QtWidgets import QApplication, QMainWindow, QTableView, QWidget
        from PyQt6.QtCore import Qt, QItemSelectionModel
        from PyQt6.QtWidgets import QComboBox, QPushButton, QCheckBox, QStyledItemDelegate
        from PyQt6.QtGui import QGuiApplication
        

        Im looking for a list, cheatsheet etc that details the heirachy of the widget classes so I know which module to import them from.
        (I know that example is messy)

        Also, does anyone know why Vscode gives the following warning when its clearly not true?

        No name 'QComboBox' in module 'PyQt6.QtWidgets'PylintE0611:no-name-in-module

        cheers

        C 1 Reply Last reply
        0
        • M MIckH

          @JonB
          ok, i'll be more specific. while you are right about them all being in 'widgets' its not best practice to just call that module for everything

          Here is what Im talking about:

          from PyQt6.QtCore import Qt
          from PyQt6.QtGui import QStandardItemModel, QStandardItem, QFont, QBrush
          from PyQt6.QtWidgets import QApplication, QMainWindow, QTableView, QWidget
          from PyQt6.QtCore import Qt, QItemSelectionModel
          from PyQt6.QtWidgets import QComboBox, QPushButton, QCheckBox, QStyledItemDelegate
          from PyQt6.QtGui import QGuiApplication
          

          Im looking for a list, cheatsheet etc that details the heirachy of the widget classes so I know which module to import them from.
          (I know that example is messy)

          Also, does anyone know why Vscode gives the following warning when its clearly not true?

          No name 'QComboBox' in module 'PyQt6.QtWidgets'PylintE0611:no-name-in-module

          cheers

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          Aside from the documentation page of any class telling you which module it is in,
          e98fb9e4-fa77-47fa-ad56-0175589488e8-image.png
          5f408c35-ae05-492e-a9ab-14b9fb2e92a5-image.png
          there is All Classes by Module and other views accessible from here

          As for why Pylint reports that, you'd have to look at the limits of that tool and the Python wrapper provided by Riverbank.

          M 1 Reply Last reply
          1
          • C ChrisW67

            Aside from the documentation page of any class telling you which module it is in,
            e98fb9e4-fa77-47fa-ad56-0175589488e8-image.png
            5f408c35-ae05-492e-a9ab-14b9fb2e92a5-image.png
            there is All Classes by Module and other views accessible from here

            As for why Pylint reports that, you'd have to look at the limits of that tool and the Python wrapper provided by Riverbank.

            M Offline
            M Offline
            MIckH
            wrote on last edited by
            #5

            @ChrisW67 thanks for that.
            Still seems very clunky and time consuming.

            I have written a short program that finds the correct module.

            I'll post this separately.

            cheers
            Mick

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved