Skip to content

Vendored KDDockWidgets: DockWidgetBase.cpp missing #include <QAction> #274

Description

@astrojuanlu

I've been trying to build Audacity 4 against KDE's Qt 6.11 and had to include a series of patches to make it work. What follows is an AI-generated report of one of such issues. I see no contributing or AI guidelines so I hope this is acceptable.


The muse framework vendors KDDockWidgets 1.4.95 (circa 2021). This version's DockWidgetBase.cpp uses QAction methods without including <QAction>, relying on transitive includes that vary between Qt distributions. The code compiles only when <QAction> happens to be transitively included through other QtGui headers — a dependency that is not guaranteed across Qt distributions and is being actively removed.

Environment

  • muse framework commit: 3c5512eb8ee1a863a6123e62bd75a6ab55045752
  • Vendored KDDockWidgets version: 1.4.95 (in muse/framework/dockwindow/thirdparty/KDDockWidgets/)
  • Qt: Built from the KDE Qt fork (the source of the kde-qt6-core24-sdk snap), version 6.11.1

Error

DockWidgetBase.cpp:611:20: error: invalid use of incomplete type 'class QAction'
DockWidgetBase.cpp:612:20: error: invalid use of incomplete type 'class QAction'

The forward declaration comes from QtGui/qevent.h (which forward-declares QAction), but the full definition in <QAction> is never included.

Root cause

DockWidgetBase.cpp includes <QTimer> but not <QAction>. It calls methods on QAction objects via pointers (e.g. floatAction->setEnabled(true)), which requires the complete type. With upstream Qt, <QAction> is transitively included; with the KDE Qt fork (which has cleaner transitive include paths), it is not.

Suggested fix

Add #include <QAction> to the vendored DockWidgetBase.cpp:

 #include <QTimer>
+#include <QAction>
 #include <QScopedValueRollback>

Note on upstream

This issue is already fixed in upstream KDDockWidgets 2.x (github.com/KDAB/KDDockWidgets), which completely restructured the codebase and no longer has DockWidgetBase.cpp. However, upgrading the vendored snapshot from 1.4.95 to 2.x could be a disruptive change for the muse framework. The one-line #include patch above is the minimal fix for the vendored 1.4.95 snapshot.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions