Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6 Designer Custom Widget Directory Structure
Forum Update on Monday, May 27th 2025

PySide6 Designer Custom Widget Directory Structure

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 377 Views
  • 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.
  • A Offline
    A Offline
    AndreBam
    wrote on 24 Jul 2024, 12:26 last edited by
    #1

    I'm trying to structure my custum widgets or plugins in a way such that all the required files are not all in the same directory. QtDesigner sees the TicTacToe custom widget (https://doc.qt.io/qtforpython-6/examples/example_designer_taskmenuextension.html#task-menu-extension-example) when all the files are in the same directory, but it doesn't when I separate them (and of course modify the import paths). Do the files all have to be in the same directory?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AndreBam
      wrote on 25 Jul 2024, 09:36 last edited by
      #2

      The solution I found was to add the path to the various other files in the register*.py file. So something like sys.path.append("/path/to/necessary/dirs") so that the python files could be importable.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CristianMaureira
        wrote on 21 Aug 2024, 09:03 last edited by
        #3

        You can also rely on the PYSIDE_DESIGNER_PLUGINS variable to point where the plugin is?
        https://doc.qt.io/qtforpython-6/tutorials/basictutorial/uifiles.html#designer-custom-widgets

        1 Reply Last reply
        0

        • Login

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