Commit 3ba2876d authored by Samuel Jones's avatar Samuel Jones
Browse files

Re #31667 Attempted to move to invoke method for memoryview

parent 6e610c10
......@@ -56,7 +56,7 @@ class MemoryPresenter(object):
if self.update_allowed:
mem_used_percent, mem_used, mem_avail = get_memory_info()
self.view.set_value(mem_used_percent, mem_used, mem_avail)
self.view.invoke_set_value(mem_used_percent, mem_used, mem_avail)
def cancel_memory_update(self):
......@@ -6,9 +6,9 @@
# SPDX - License - Identifier: GPL - 3.0 +
# This file is part of the mantid workbench.
from qtpy.QtWidgets import QWidget, QProgressBar
from qtpy.QtCore import Qt
from qtpy.QtCore import Qt, QMetaObject, Q_ARG
from PyQt5.QtCore import pyqtSlot
QProgressBar::chunk {
......@@ -71,7 +71,14 @@ class MemoryView(QWidget):
def set_value(self, new_value: int, mem_used: float, mem_avail: float):
def invoke_set_value(self, new_value: int, mem_used: float, mem_avail: float):
new_value = Q_ARG(int, new_value)
mem_used = Q_ARG(float, mem_used)
mem_avail = Q_ARG(float, mem_avail)
QMetaObject.invokeMethod(self, "_set_value", Qt.AutoConnection, new_value, mem_used, mem_avail)
@pyqtSlot(int, float, float)
def _set_value(self, new_value, mem_used, mem_avail):
Receives memory usage information passed by memory presenter
and updates the displayed content as well as the style if needed
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment