Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Not possible to set layout on custom widget plugin
QtWS25 Last Chance

Not possible to set layout on custom widget plugin

Scheduled Pinned Locked Moved Unsolved General and Desktop
plugincustom widgets
3 Posts 2 Posters 1.4k 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.
  • H Offline
    H Offline
    Hallot
    wrote on 16 Feb 2017, 17:23 last edited by
    #1

    Hi,

    I am trying to create a simple widget plugin for Qt Designer. I am however stuck on a few points.

    It's a simple widget inheriting from QWidget, which has a title and a content QWidget underneath.
    When clicking on the title, the content is hidden/shown, with a small animation.
    Sources can be found here: https://github.com/Hallot/CollapsibleWidgetQt

    I can build the plugin just fine, and it appears in Qt Designer afterwards.
    However, I cannot add a layout to my custom widget. If I add a couple of QLabels to the widget, no layout is available.
    I have set the isContainer() method to true, to no avail.
    Any idea of what I am doing wrong?

    Second question, I have defined a property "title" in the domXml() method, so the user can set the title from the Qt Designer interface.
    How can I get when this field is changed so I can change the value of the title in the widget?

    Last question, the animations depend on the height of the content, so I'd need to reset the maximumHeight value for the animations every time the content widget is modified. Is there a signal for this?

    Thanks.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 17 Feb 2017, 08:16 last edited by
      #2

      If you just need the final result, it's available: https://github.com/crapp/qaccordion

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • H Offline
        H Offline
        Hallot
        wrote on 20 Feb 2017, 07:43 last edited by
        #3

        Thanks for the link, but I am mostly interested in being able to do it all through the Qt Designer UI via a plugin.

        1 Reply Last reply
        0

        3/3

        20 Feb 2017, 07:43

        • Login

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