T
а так лучше более подробно описать задачу
Size: a a a
T
AU
T
T
T
If you really need to use multiple threads, what you'll probably need to do is have the threads do all their calculations on their own private data structures that the Qt GUI thread has no access to. Then when the threads have computed their results, they should send the results back to the Qt GUI thread (via queued connection or QApplication::postEvent()). The GUI thread can then look at the results and use them to update the QGraphicsItems, etc; this will be "safe" because this update can't happen in the middle of a window update.я так понял, это надо выполнять с помощью QCoreApplication::postEvent, но postEvent принимает QEvent, нам нужно чтоб QEvent.type был у нас paint, чтобы мы могли заюзать painter, но как нам тогда в paintEvent передать кастомные данные?
B
If you really need to use multiple threads, what you'll probably need to do is have the threads do all their calculations on their own private data structures that the Qt GUI thread has no access to. Then when the threads have computed their results, they should send the results back to the Qt GUI thread (via queued connection or QApplication::postEvent()). The GUI thread can then look at the results and use them to update the QGraphicsItems, etc; this will be "safe" because this update can't happen in the middle of a window update.я так понял, это надо выполнять с помощью QCoreApplication::postEvent, но postEvent принимает QEvent, нам нужно чтоб QEvent.type был у нас paint, чтобы мы могли заюзать painter, но как нам тогда в paintEvent передать кастомные данные?
T
S
CC
RG
A
S
A
/
CC
CC
FS
FS
NM
nО