The method Justin describes closely matches the one we use. To avoid dealing with icons, we use those character codes to draw the arrows: https://www.alt-codes.net/triangle-symbols
Nicolas Le mer. 27 mai 2020 à 23:20, Justin Israel <justinisr...@gmail.com> a écrit : > > > On Thu, May 28, 2020 at 1:01 AM Erik Spellerberg < > erik.spellerb...@gmail.com> wrote: > >> I need a widget that looks and behaves like mayas native frameLayout with >> a title, arrow icon and you can click it to expand and collapse. >> >> Currently I have borrowed a hacky sollution that converts the layout into >> a maya frameLayout, but it doesn't refresh when I dock the window so I have >> to change the window size when docked for all the widgets to display at the >> right location. >> I would rather make a proper custom PyQt widget that has the elements >> that I want, but I really don't know how to go about it. >> > > If you can't fine an existing example of an "accordion" layout/widget, and > you wanted to create from from scratch, I would suggest creating a widget > that has a vertical layout. The first item would be your title bar, which > contain a swizzle/triangle type icon. The second item in the layout would > probably be a QScrollWidget if you want the layout to handle automatically > scrolling. Or it could be a QStackedWidget if you want to to set any widget > into it, which may already be a scroll widget. Then you can wire up your > swizzle button to toggle the visibility of the main content widget. > When these individual layout items are added to another vertical layout, > with either a top alignment, or having a stretcher added as the last item, > the toggling of the accordion items will cause them to compress up to the > top. > > Justin > > > -- >> You received this message because you are subscribed to the Google Groups >> "Python Programming for Autodesk Maya" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to python_inside_maya+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/dffb898a-a57e-4324-ba11-46d4905a2e18%40googlegroups.com >> <https://groups.google.com/d/msgid/python_inside_maya/dffb898a-a57e-4324-ba11-46d4905a2e18%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to python_inside_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3%3Dk_kJFrFmJ%2B1E%3D%2By1pZKN20rae-5pSMy_oiUr0DquoA%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3%3Dk_kJFrFmJ%2B1E%3D%2By1pZKN20rae-5pSMy_oiUr0DquoA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD65uqmwN1CW%2BHdZih4wW7bEfbXs8OqN4dAfNHBo5%3Dvxsam7RQ%40mail.gmail.com.