Skip to content

Qt: move dependencies into Window_p.h#4

Open
ahigerd wants to merge 1 commit into
alh/refactor-popups-part-2from
alh/refactor-popups-part-3
Open

Qt: move dependencies into Window_p.h#4
ahigerd wants to merge 1 commit into
alh/refactor-popups-part-2from
alh/refactor-popups-part-3

Conversation

@ahigerd

@ahigerd ahigerd commented Aug 9, 2025

Copy link
Copy Markdown
Owner

This is the third of a series of patches that intend to refactor the way mGBA handles popup windows.

First PR: mgba-emu#3549
Second PR: #3
Fourth PR: #5

Description

Moves as many #include statements as possible out of Window.h into a private header file.

Motivation

src/platform/qt/Window.h is included by 8 .cpp files and itself includes quite a few other header files. This slows down incremental builds because the surface area for changes that will trigger recompilation is so large. Using the pimpl pattern is standard C++ practice to avoid this problem.

void Window::scriptingOpen() {
ensureScripting();
ScriptingView* view = new ScriptingView(m_scripting.get(), m_config);
ScriptingView* view = new ScriptingView(d->scripting.get(), m_config);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth observing that I did not deduplicate the scripting view. It wouldn't have been difficult to do so but it's one that someone might reasonably WANT two of.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant