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

pythonqt_generator modified argument handling, make generate #124

Closed
wants to merge 7 commits into from
Closed

pythonqt_generator modified argument handling, make generate #124

wants to merge 7 commits into from

Conversation

jbowler
Copy link
Contributor

@jbowler jbowler commented Oct 9, 2023

This adds 'make generate' to generator/generator.pro using modified argument handling so that the Qt installed header directory can be used to build a new generated_cpp. This is created in generator/ to avoid overwriting an existing user generated_cpp at the top level.

It also adds setContext calls to ReportHandler to improve the warning messages and calls fflush(stdout) at appropriate moments to fix the confusing mis-ordering of the pythonqt_generator output when it is piped to a file.

This adds extra arguments to control precisely what gets built and to
enable use of the generator from within the makefile.

Signed-off-by: John Bowler <[email protected]>
Adds context to any ReportHandler::reportError messages by calling
ReportError::setContext at appropriate points in main.cpp.  Also adds a
missing fflush before the actual generate.

Signed-off-by: John Bowler <[email protected]>
This adds 'make generate' which correctly handles rebuilding of the
resources if they have been modified before generating the generated_cpp
directory.  This fixes the problem where editing typesystem_*.xml then
running pythonqt_generator does nothing; the typesystem_*.xml files are
compiled into the generator and 'make' must be used to rebuild the
generator before the changes can be seen.

Signed-off-by: John Bowler <[email protected]>
@mrbean-bremen
Copy link
Contributor

Thanks - I will check this tomorrow (too sleepy now...)!

Copy link
Contributor

@mrbean-bremen mrbean-bremen left a comment

Choose a reason for hiding this comment

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

Looks quite good to me, thanks! @usiems - could you also have a look?

generator/main.cpp Outdated Show resolved Hide resolved
generator/main.cpp Show resolved Hide resolved
generator/main.cpp Outdated Show resolved Hide resolved
generator/main.cpp Outdated Show resolved Hide resolved
generator/main.cpp Outdated Show resolved Hide resolved
generator/main.cpp Show resolved Hide resolved
generator/main.cpp Show resolved Hide resolved
@usiems
Copy link
Contributor

usiems commented Oct 10, 2023

Looks good to me so far.

I.e. replace the hardcoded "path_splitter" by the appropriate Qt
constexpr (introduced in Qt5.6).

Signed-off-by: John Bowler <[email protected]>
Signed-off-by: John Bowler <[email protected]>
sep = ",";
}
const QString errMsg("WARNING: missing core Qt modules: Qt" +
requiredModules.join(",Qt"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpicking: If you want it as before (with the space) you need join(", Qt")).

@jbowler
Copy link
Contributor Author

jbowler commented Oct 11, 2023

This is getting too complicated and there is too much change of a merge conflict with other forks.

@jbowler jbowler closed this Oct 11, 2023
@jbowler jbowler deleted the pull-request-124 branch October 11, 2023 14:48
@mrbean-bremen
Copy link
Contributor

mrbean-bremen commented Oct 11, 2023

This is getting too complicated and there is too much change of a merge conflict with other forks.

Hm, I was actually going to merge this... this last nitpicking was not really important.
Do you want to split it, or just drop it?

All changes that are pure refactoring (like the for -> foreach change) are not really important. If it helps to leave them out, we can just omit these changes. We really appreciate the work you put into this, and it would be unfortunate if it could not be integrated due to such reasons.

@jbowler
Copy link
Contributor Author

jbowler commented Oct 11, 2023

Just drop it; I've convinced myself that the core-modules stuff is irrelevant because it, in fact, does nothing. I doubt any system really installs Qt headers with a repeated module directory, e.g. $QTDIR/QtCore/QtCore/qcoreapplication

I can run pythonqt_generator by hand and get the same results. The real changes I need are in the error reporting; I only submitted this PR because I did it first so I'm going to have to spend some time de-merging the changes in my own branches/stashes.

@mrbean-bremen
Copy link
Contributor

Ok - in case we still decide that the functionality is needed, we can recreate it from this PR... thanks!

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.

3 participants