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

Would it be feasible to modify the Qt widget system to reduce dependency on internal private classes such as QPrivateWidget?

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.12.4
    • Widgets: Layout
    • None
    • All

    Description

      Thanks as ever for Qt, which is excellent. Further to the Qt6 blog post and request for broad-brush suggestions:

      When attempting to modify Qt widgets for specific situations, it is often very hard to proceed into complex territory because the code depends on special private classes. For example, my attempt to write a new QScrollArea failed as follows:

      • one can rewrite QScrollArea and QScrollAreaPrivate;
      • and then QAbstractScrollArea and QAbstractScrollAreaPrivate;
      • but QAbstractScrollAreaPrivate notes that it has "friend class QWidgetPrivate;" and in qwidget.cpp we see that QWidgetPrivate has special handling for QAbstractScrollArea.

      Therefore, it sometimes becomes impossible to make modified versions of parts of the widget/layout system because they are tightly integrated with private classes.

      I quite understand if the private class system is necessary (e.g. for speed, binary compatibility, or some other library-related reason) – but is it? Could these sorts of private classes, in a future Qt6, be integrated into the public versions, so that developers can extend them more easily and have the Qt framework talk to them via their virtual functions?

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            rudolf@pobox.com Rudolf Cardinal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes