At the moment, I'm overwritting the 'resizeEvent' method of the window to calculate how many rows and columns I'm going to need and I re-draw the rowss and columns of buttons based on the result.
For some reason, I have the feeling that I might be re-inventing the wheel and there might be an easier way to do this. That's why I'm sending this message. :-)
This is the code that I have so far:
- https://gist.github.com/davidmartinezanim/9640295
Also there are a few questions that I have:
I know that there are quite a few questions in this email and I intend to start fixing things one step at a time, but I wanted to check with you guys if I'm going in the right direction or not.
Many thanks in advance
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpxVO57NYLzudWa7SZE_AOEAucJayBBy3%2Bx0afNNrBjcPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1jpSs7qPF4QfHpRQTGSfzg_wuG4iqxz1y2PA3qWLU7bQ%40mail.gmail.com.
--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWM3bV7irujE9P4jcWnJ31bCfg%2BaJuuainNz%2BQjVW3qKWA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpzcVbrWco%2B5-%2BsHXijmCX8RmWAyTiB-6z-_519pGh8_mQ%40mail.gmail.com.
I think that I'm getting rather confused when it comes to port the class.
As far as I know, when we deal with graphic elements we need both a 'Scene' (data) and a 'View' (what displays data). When we inherit from QGraphicsLayout, what we are creating is a 'Layout', right? Does that mean that the resulting class is going to be our view class? Could you explain how the different elements relate to each other? This is the first time that I deal with graphic elements. All what I've done so far were regular widgets.
Many thanks
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2J9AkmOAKjvJKvyiHzZEaAiUAeLpf%2BhSF55Fdz5CqAZg%40mail.gmail.com.
Did you need to do a QGraphics approach or was this just an experiment after I mentioned I was doing it? Technically it will work as QWidget, but can end up being more performant as QGraphics if you use a ton of images.
Porting the flow layout is basically just converting it to be a subclass of QGraphicsLayout which has some slightly different concepts when it comes to the geometry. But it is the same in terms of what it functions as.
Layouts don't inherently have any visual representation. They just manage the size and position of the items assigned to it. So it wouldn't be considered a view. Just like in QWidgets, you still have to add the layout to the parent widget for which it will conform all the child widgets.
In a QGraphics setup, you have a QGraphicsView which looks into a QGraphicsScene (the model) to view all of the items. Layouts aren't actually part of the core concepts. They are something you can use if you are using QGraphicsWidgets, which support a mixture of graphics items a qwidget concepts.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpzMRae5Kw4wiO7wPydmSgcLGyhSOLas4i2rosUJR%2B6PBA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0nQSYRqNuFj%2B0Q34uccxmH4gaKn5nXBsUt98vTRPc6Og%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpxbJBthXRJiip38hzZ6nXnRby%3DL9%2BdBq8ORb7povw-NZA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBGpgcfZMmvF-yEXa4mXD18HOWjOP_0rrAow-rH6qPL%3DA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpym5UC7Ev6xTq6rfuHasm0bC%2B237cz_%3DHDGQha2jCsDbQ%40mail.gmail.com.
I think it's worth learning how to do it.I need to be able to draw a few dozen images so I think the QGraphics approach is the appropriate one.
I do understand that layouts are not visual but define how elements are arranged. But how does work within a QGraphics approach?As you mention, it looks like when working in a QGraphics setup, I need to have a scene (the model) and the view.
Does that mean that the layout will exist within the view? Or is it supposed to be part of a QGraphicsWidget?
With regular QWidgets, I can create a window to be that QWidget but that doesn't seem to be the case with QGraphicsWidget.
Finally, is the layout going to accept regular widgets and pixmaps or QGraphicsWidgets?
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAMLeNpxbJBthXRJiip38hzZ6nXnRby%3DL9%2BdBq8ORb7povw-NZA%40mail.gmail.com.