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. Pre-allocating a space to insert my specialized widget

Pre-allocating a space to insert my specialized widget

Scheduled Pinned Locked Moved Unsolved Qt for Python
2 Posts 2 Posters 178 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.
  • B Offline
    B Offline
    BegBlev
    wrote on last edited by
    #1

    Hello,

    I’m designing a composite widget in Qt Designer (PyQt5) that contains several standard widgets and one custom widget implemented in a separate class. I need to reserve a position for the custom widget in the middle of a QVBoxLayout.

    Currently, I place a plain QWidget as a placeholder in Designer, then place my custom widget in the placeholder through init method. This works, but I suspect there's a cleaner or more appropriate way to handle this. What is the recommended method for allocating space for a custom widget and assigning it at runtime?
    05377ae9-9732-45a2-a3df-8ac5444cc9b8-image.png
    Thank you

    JonBJ 1 Reply Last reply
    0
    • B BegBlev

      Hello,

      I’m designing a composite widget in Qt Designer (PyQt5) that contains several standard widgets and one custom widget implemented in a separate class. I need to reserve a position for the custom widget in the middle of a QVBoxLayout.

      Currently, I place a plain QWidget as a placeholder in Designer, then place my custom widget in the placeholder through init method. This works, but I suspect there's a cleaner or more appropriate way to handle this. What is the recommended method for allocating space for a custom widget and assigning it at runtime?
      05377ae9-9732-45a2-a3df-8ac5444cc9b8-image.png
      Thank you

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @BegBlev
      So that I understand --- and I am more C++ than Python --- are you using Designer's Promote to ... from the widget's context menu, e.g. as per https://www.pythonguis.com/tutorials/embed-pyqtgraph-custom-widgets-qt-app/ ?

      1 Reply Last reply
      2

      • Login

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