I have questions about the QListView interaction

Visto 19 veces
Saltar al primer mensaje no leído

Eri

no leída,
25 nov 2018, 20:57:1425/11/18
a Python Programming for Autodesk Maya


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.


Thanks
example.png

Justin Israel

no leída,
25 nov 2018, 21:42:3225/11/18
a python_in...@googlegroups.com
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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/61f0065a-8bee-4f7e-9b6f-e0f02fa1b4e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eri

no leída,
25 nov 2018, 22:00:0725/11/18
a Python Programming for Autodesk Maya
100 items, each of which item about 10-20 fields. 15 custom wigets in item

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:


On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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+unsub...@googlegroups.com.

Justin Israel

no leída,
25 nov 2018, 22:49:2325/11/18
a python_in...@googlegroups.com
On Mon, Nov 26, 2018 at 4:00 PM Eri <td.e...@gmail.com> wrote:
100 items, each of which item about 10-20 fields. 15 custom wigets in item

Well you could try the QVBoxLayout managed approach. QList{View,Widget} won't be the right one anyways for dynamic widget items. Its either that or a custom QGraphicsScene (higher performance)
 

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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.

--
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/935db486-7739-4fd8-9e64-36ffa1ed690c%40googlegroups.com.

Eri

no leída,
25 nov 2018, 22:57:1825/11/18
a Python Programming for Autodesk Maya
What you mean is that the performance of using custom QGraphicsScene is even higher?How to customize QGraphicsScene?

在 2018年11月26日星期一 UTC+8上午11:49:23,Justin Israel写道:


On Mon, Nov 26, 2018 at 4:00 PM Eri <td.e...@gmail.com> wrote:
100 items, each of which item about 10-20 fields. 15 custom wigets in item

Well you could try the QVBoxLayout managed approach. QList{View,Widget} won't be the right one anyways for dynamic widget items. Its either that or a custom QGraphicsScene (higher performance)
 

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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+unsub...@googlegroups.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_maya+unsub...@googlegroups.com.

Justin Israel

no leída,
25 nov 2018, 23:05:0625/11/18
a python_in...@googlegroups.com
On Mon, Nov 26, 2018 at 4:57 PM Eri <td.e...@gmail.com> wrote:
What you mean is that the performance of using custom QGraphicsScene is even higher?How to customize QGraphicsScene?

QGraphicsScene is a more efficient way to do complex interfaces. You get better performance using it than with QWidget because with QWidget, every single widget has its own event handling in the chain, and its own paint event. With QGraphicsScene, there is one big paint event, and it can efficiently repaint the items that need it. 

You can do any kind of crazy interface that you want. See my post from over 8 years ago :-)
 

在 2018年11月26日星期一 UTC+8上午11:49:23,Justin Israel写道:
On Mon, Nov 26, 2018 at 4:00 PM Eri <td.e...@gmail.com> wrote:
100 items, each of which item about 10-20 fields. 15 custom wigets in item

Well you could try the QVBoxLayout managed approach. QList{View,Widget} won't be the right one anyways for dynamic widget items. Its either that or a custom QGraphicsScene (higher performance)
 

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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.

--
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.

--
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/dc3af376-e747-4a46-aa1b-214bb2a0c933%40googlegroups.com.

Eri

no leída,
26 nov 2018, 0:49:1226/11/18
a Python Programming for Autodesk Maya
OK,I tried QGraphicsScene. Thanks!

在 2018年11月26日星期一 UTC+8下午12:05:06,Justin Israel写道:


On Mon, Nov 26, 2018 at 4:57 PM Eri <td.e...@gmail.com> wrote:
What you mean is that the performance of using custom QGraphicsScene is even higher?How to customize QGraphicsScene?

QGraphicsScene is a more efficient way to do complex interfaces. You get better performance using it than with QWidget because with QWidget, every single widget has its own event handling in the chain, and its own paint event. With QGraphicsScene, there is one big paint event, and it can efficiently repaint the items that need it. 

You can do any kind of crazy interface that you want. See my post from over 8 years ago :-)
 

在 2018年11月26日星期一 UTC+8上午11:49:23,Justin Israel写道:
On Mon, Nov 26, 2018 at 4:00 PM Eri <td.e...@gmail.com> wrote:
100 items, each of which item about 10-20 fields. 15 custom wigets in item

Well you could try the QVBoxLayout managed approach. QList{View,Widget} won't be the right one anyways for dynamic widget items. Its either that or a custom QGraphicsScene (higher performance)
 

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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+unsub...@googlegroups.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_maya+unsub...@googlegroups.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_maya+unsub...@googlegroups.com.

Eri

no leída,
26 nov 2018, 2:50:0526/11/18
a Python Programming for Autodesk Maya

I did a simple test, don't know if this is the case? 

But if you find a problem, there will be a case where BasicWidget() is multiple instances, so that it doesn‘t increase the load? Is there any other way?



在 2018年11月26日星期一 UTC+8下午12:05:06,Justin Israel写道:


On Mon, Nov 26, 2018 at 4:57 PM Eri <td.e...@gmail.com> wrote:
What you mean is that the performance of using custom QGraphicsScene is even higher?How to customize QGraphicsScene?

QGraphicsScene is a more efficient way to do complex interfaces. You get better performance using it than with QWidget because with QWidget, every single widget has its own event handling in the chain, and its own paint event. With QGraphicsScene, there is one big paint event, and it can efficiently repaint the items that need it. 

You can do any kind of crazy interface that you want. See my post from over 8 years ago :-)
 

在 2018年11月26日星期一 UTC+8上午11:49:23,Justin Israel写道:
On Mon, Nov 26, 2018 at 4:00 PM Eri <td.e...@gmail.com> wrote:
100 items, each of which item about 10-20 fields. 15 custom wigets in item

Well you could try the QVBoxLayout managed approach. QList{View,Widget} won't be the right one anyways for dynamic widget items. Its either that or a custom QGraphicsScene (higher performance)
 

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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+unsub...@googlegroups.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_maya+unsub...@googlegroups.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_maya+unsub...@googlegroups.com.

Justin Israel

no leída,
26 nov 2018, 4:59:4926/11/18
a python_in...@googlegroups.com


On Mon, Nov 26, 2018, 8:50 PM Eri <td.e...@gmail.com> wrote:

I did a simple test, don't know if this is the case? 

But if you find a problem, there will be a case where BasicWidget() is multiple instances, so that it doesn‘t increase the load? Is there any other way?

I am not sure what you mean by not increasing the load. But you will just have to test this at the scale of the number of items you need. If it works well with 100 items, then great. Be aware that it can still be expensive to use QWidgets within QGraphicsScene. But it really just depends how many you have visible in the view. It can be pretty efficient at only drawing when it needs to. 




在 2018年11月26日星期一 UTC+8下午12:05:06,Justin Israel写道:
On Mon, Nov 26, 2018 at 4:57 PM Eri <td.e...@gmail.com> wrote:
What you mean is that the performance of using custom QGraphicsScene is even higher?How to customize QGraphicsScene?

QGraphicsScene is a more efficient way to do complex interfaces. You get better performance using it than with QWidget because with QWidget, every single widget has its own event handling in the chain, and its own paint event. With QGraphicsScene, there is one big paint event, and it can efficiently repaint the items that need it. 

You can do any kind of crazy interface that you want. See my post from over 8 years ago :-)
 

在 2018年11月26日星期一 UTC+8上午11:49:23,Justin Israel写道:
On Mon, Nov 26, 2018 at 4:00 PM Eri <td.e...@gmail.com> wrote:
100 items, each of which item about 10-20 fields. 15 custom wigets in item

Well you could try the QVBoxLayout managed approach. QList{View,Widget} won't be the right one anyways for dynamic widget items. Its either that or a custom QGraphicsScene (higher performance)
 

在 2018年11月26日星期一 UTC+8上午10:42:32,Justin Israel写道:
On Mon, Nov 26, 2018 at 2:57 PM Eri <td.e...@gmail.com> wrote:


Hey all,

Here I got some questions about PyQT need consult with you.We are doing some UI development but met difficulties.
1. In the last version we were using  QListView+QStyledItemDelegate+QAbstractListModel as the code to load the items and these items include lots of custom widgets and the user need do interaction by using these widets. But the widgets cannot interact when they are displayed by the QlistView.We read the QT documentation and it seems like the QListView could only do previw for the viewer while cannot do interaction,not sure is this correct?

This sounds correct to me. It is documented that you can only expect to display static widgets in the list view, since they are painted directly as opposed to having each one of them run with event handling.
 
2. I also tried Qlistwidget to meet the interaction request,but the amount of the data is too large and performance does not good, not sure how to optimize.

This also lines up with my previous experience with the performance constraints of a QListWidget. 
 

Above,we really have no idea how to solve the problem,please kindly be advise.thanks.

In the past I have done a few apps that have the layout you described by managing a QVBoxLayout within a scroll widget. This has the downside that you have to manage the items without the model/view interface. How many items do you tend to have when you experience performance issues?

 


Thanks

--
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.

--
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.

--
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.

--
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/10cfc312-c5b4-40a3-8f7f-82b36c5d2a38%40googlegroups.com.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos