Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Side-loading my own Qt.dll on default PiSide2 installed with pip
Qt 6.12 LTS is out! See what's new in the release blog

Side-loading my own Qt.dll on default PiSide2 installed with pip

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 813 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    OniNiubbo
    wrote on last edited by
    #1

    Hi all.

    I'm working on a Python + Qt (PySide2) project.

    Since I want to fix a bug in Qt (that I've already submitted), I want to build my own version of the Qt libraries (Core, GUI and Widgets) and give a try at bug fixing.

    Also having access to the Qt source code means that, if needed, I can tackle performance issues and bugs C++ side.

    Here is my workflow:

    • I've installed Python 3.10.6 on my Windows machine;
    • I've created a virtual env and "pip installed" PySide2 version 5.15.2.1;
    • I've used git to download Qt 5-5.15.2 and I've built my own version of Qt (the idea is to manipulate Qt source code later on);
    • I've copied my Qt5Core.dll, Qt5Gui.dll and Qt5Widgets.dll inside <venv folder>\Lib\site-packages\PySide2 overwriting the *.dlls already there;

    At this point I can run my PySide2 app, but it crashes randomly after 10 minutes or so, segfaulting.

    Before going deeper into the issue, my question is: is my workflow ok? Is overwriting the *.dlls sufficient? Do I need to build Shiboken too? Do I need to build PySide2 too?

    If I run "dumpbin /headers Qt5Core.dll" for my version of the library, I get:

    Microsoft (R) COFF/PE Dumper Version 14.29.30146.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file Qt5Core.dll
    
    PE signature found
    
    File Type: DLL
    
    FILE HEADER VALUES
                 14C machine (x86)
                   6 number of sections
            630B79FC time date stamp Sun Aug 28 16:21:48 2022
                   0 file pointer to symbol table
                   0 number of symbols
                  E0 size of optional header
                2102 characteristics
                       Executable
                       32 bit word machine
                       DLL
    
    OPTIONAL HEADER VALUES
                 10B magic # (PE32)
               14.29 linker version
    <many other (probably useless) rows>
    

    If I run "dumpbin /headers Qt5Core.dll" for the official "pip install" library, I get:

    Microsoft (R) COFF/PE Dumper Version 14.29.30146.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    
    Dump of file Qt5Core.dll
    
    PE signature found
    
    File Type: DLL
    
    FILE HEADER VALUES
                 14C machine (x86)
                   6 number of sections
            61D69156 time date stamp Thu Jan  6 07:51:02 2022
                   0 file pointer to symbol table
                   0 number of symbols
                  E0 size of optional header
                2102 characteristics
                       Executable
                       32 bit word machine
                       DLL
    
    OPTIONAL HEADER VALUES
                 10B magic # (PE32)
               14.26 linker version
    <many other (probably useless) rows>
    

    I have the feeling that the different "linker version" (different compiler minor version) is causing a binary incompatibility.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I would go with building PySide2 as well with your version of Qt. That way you ensure that you have everything using the same toolchain.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OniNiubbo
        wrote on last edited by
        #3

        Compiling PySide2 from scratch, pointing the build process to the custom Qt solved the issue.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved