Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger: Redesign UI based on docking system #12241

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

chaoticgd
Copy link
Contributor

@chaoticgd chaoticgd commented Jan 27, 2025

Description of Changes

I have redesigned the debugger's UI based on the KDDockWidgets docking system library. Work in progress!

Screenshot_20250127_130921

Some issues:

  • KDDockWidgets uses exceptions and RTTI (dynamic_cast).
  • I made a prototype version using Qt Advanced Docking System which featured a fancy stylesheet. It would be possible to implement such a theme using KDDW too, although the developer recommends against using stylesheets so I think it would be better left for a future PR.

Rationale behind Changes

I feel like the current design has been limiting the kind of improvements I can make to the debugger.

As for the choice of library, there were three to pick from: Qt's own QDockWidget class, Qt Advanced Docking System and KDDockWidgets.

QDockWidget isn't really appropriate since the dock widgets behave more like oversized toolbars surrounding an unmoving central widget rather than a tree of splitters.

I evaluated Qt Advanced Docking System but dropped it due to poor Linux compatibility and extremely poor Wayland compatibility.

KDDockWidgets seems like the overall best pick. Best feature set, best platform compatibility, and it's backed up by KDAB.

Suggested Testing Steps

This is not yet ready for testing.

@TellowKrinkle
Copy link
Member

BTW for the final version, you should link to kddockwidgets as a system library and add it to the dependency build scripts instead of including the source here. This should also allow you to not enable rtti/exceptions on the rest of PCSX2.

@chaoticgd
Copy link
Contributor Author

BTW for the final version, you should link to kddockwidgets as a system library and add it to the dependency build scripts instead of including the source here. This should also allow you to not enable rtti/exceptions on the rest of PCSX2.

This is a good idea.

@chaoticgd chaoticgd force-pushed the debugger_docking branch 2 times, most recently from de69dba to cdc89aa Compare January 29, 2025 15:45
@chaoticgd
Copy link
Contributor Author

chaoticgd commented Jan 29, 2025

I've switched to pulling in KDDockWidgets in the build-dependencies scripts, and I agree that regardless it's better, but it doesn't seem to be solving the problem with exceptions/RTTI. Whenever it enters a dynamic_cast in KDDW it just aborts with RTTI disabled. Does anyone have experience with this? Note that while I'm not currently doing this, it may be necessary to inherit from some of the KDDW types to customize some of the docking widgets in the future. If it's not feasible I could just develop a patch.

@TheLastRar
Copy link
Contributor

A google search found this stackoverflow answer,
Based on the above, any PCSX2 classes that inherit from KDDW would lack the RTTI information, but KDDW might expect it as the base classes would have RTTI info.

You are inheriting a KDDW class from within PCSX2 (DebuggerWindow inherits from KDDockWidgets::QtWidgets::MainWindow)
Is KDDW using RTTI functions on this class?

@chaoticgd
Copy link
Contributor Author

chaoticgd commented Jan 29, 2025

You are inheriting a KDDW class from within PCSX2 (DebuggerWindow inherits from KDDockWidgets::QtWidgets::MainWindow) Is KDDW using RTTI functions on this class?

Ah yes, I forgot about that. It does.

@chaoticgd
Copy link
Contributor Author

It seems we have two options: Either I develop a patch for KDDockWidgets to remove the uses of dynamic_cast, or we enable RTTI for pcsx2-qt. What would you all prefer I do?

@chaoticgd chaoticgd force-pushed the debugger_docking branch 11 times, most recently from dbee3aa to f4790f9 Compare February 5, 2025 18:53
@chaoticgd chaoticgd force-pushed the debugger_docking branch 5 times, most recently from ef51360 to 44d7331 Compare February 13, 2025 02:12
@chaoticgd chaoticgd force-pushed the debugger_docking branch 3 times, most recently from cddbf69 to c60fd14 Compare February 17, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants