Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ jobs:
# workaround to allow to find the Qt include dirs for installed standard qt packages
mkdir /usr/include/qt5; ln -s /usr/include/x86_64-linux-gnu/qt5 /usr/include/qt5/include
export QTDIR=/usr/include/qt5
cd generator
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./pythonqt_generator
./generator/pythonqt_generator \
--output-directory=.

- name: Build PythonQt (exclude_generator)
run: |
Expand Down Expand Up @@ -169,10 +169,11 @@ jobs:
- name: Generate Wrappers
run: |
export QTDIR=/usr/include/qt5
cd generator
# Specify "/usr/include" so that header "bits/wordsize.h" included from "qconfig.h" is found.
# See https://git.rockylinux.org/staging/rpms/qt5-qtbase/-/blob/r8/SOURCES/qconfig-multilib.h
./pythonqt_generator --include-paths=/usr/include
./generator/pythonqt_generator \
--include-paths=/usr/include \
--output-directory=.

- name: Build PythonQt (exclude_generator)
run: |
Expand Down Expand Up @@ -270,9 +271,9 @@ jobs:

- name: Generate Wrappers
run: |
cd generator
UBSAN_OPTIONS="halt_on_error=1" ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./pythonqt_generator
./generator/pythonqt_generator \
--output-directory=.

- name: Build PythonQt (exclude_generator)
run: |
Expand Down Expand Up @@ -397,9 +398,9 @@ jobs:
- name: Generate Wrappers
shell: cmd
run: |
cd generator
set QTDIR=%QT_ROOT_DIR%
pythonqt_generator
generator\pythonqt_generator ^
--output-directory=.

- name: Build PythonQt (exclude_generator)
shell: cmd
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ jobs:
- name: Generate Wrappers
shell: bash
run: |
cd generator
QTDIR="$QT_ROOT_DIR" \
UBSAN_OPTIONS="halt_on_error=1" \
ASAN_OPTIONS="detect_leaks=0:detect_stack_use_after_return=1:fast_unwind_on_malloc=0" \
./pythonqt_generator
./generator/pythonqt_generator \
--output-directory=.

- name: Upload Wrappers
uses: actions/upload-artifact@v4
Expand Down
31 changes: 16 additions & 15 deletions generator/generator.qrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/trolltech/generator/">
<qresource prefix="/trolltech/generator">
<file>qtscript_masterinclude.h</file>
<file>build_all.txt</file>
<file alias="typesystem_general.txt">typesystem_general.xml</file>
<file alias="typesystem_core.txt">typesystem_core.xml</file>
<file alias="typesystem_gui.txt">typesystem_gui.xml</file>
<file alias="typesystem_sql.txt">typesystem_sql.xml</file>
<file alias="typesystem_opengl.txt">typesystem_opengl.xml</file>
<file alias="typesystem_svg.txt">typesystem_svg.xml</file>
<file alias="typesystem_network.txt">typesystem_network.xml</file>
<file alias="typesystem_xml.txt">typesystem_xml.xml</file>
<file alias="typesystem_webkit.txt">typesystem_webkit.xml</file>
<file alias="typesystem_webenginewidgets.txt">typesystem_webenginewidgets.xml</file>
<file alias="typesystem_xmlpatterns.txt">typesystem_xmlpatterns.xml</file>
<file alias="typesystem_multimedia.txt">typesystem_multimedia.xml</file>
<file alias="typesystem_qml.txt">typesystem_qml.xml</file>
<file alias="typesystem_quick.txt">typesystem_quick.xml</file>
<file>typesystem_general.xml</file>
<file>typesystem_core.xml</file>
<file>typesystem_gui.xml</file>
<file>typesystem_sql.xml</file>
<file>typesystem_opengl.xml</file>
<file>typesystem_svg.xml</file>
<file>typesystem_network.xml</file>
<file>typesystem_xml.xml</file>
<file>typesystem_webkit.xml</file>
<file>typesystem_webenginewidgets.xml</file>
<file>typesystem_xmlpatterns.xml</file>
<file>typesystem_uitools.xml</file>
<file>typesystem_multimedia.xml</file>
<file>typesystem_qml.xml</file>
<file>typesystem_quick.xml</file>
</qresource>
</RCC>
11 changes: 10 additions & 1 deletion generator/typesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,16 @@ bool TypeDatabase::parseFile(const QString &filename, unsigned int qtVersion, bo
{
QFile file(filename);

Q_ASSERT(file.exists());
// Attempt to open the file from the specified path
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
// If opening fails, attempt to load from Qt resources
file.setFileName(":/trolltech/generator/" + filename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Could not open file:" << filename;
return false;
}
}

QXmlInputSource source(&file);

int count = m_entries.size();
Expand Down