Skip to content

Commit

Permalink
standalone
Browse files Browse the repository at this point in the history
- fixes standalone widget
  • Loading branch information
amitabhverma committed Dec 19, 2024
1 parent 3d54288 commit 29c6a98
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion recOrder/cli/jobs_mgmt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import submitit, os, json, time
import os, json
import socket
from pathlib import Path
from tempfile import TemporaryDirectory
import submitit

# Jobs query object
# Todo: Not sure where these should functions should reside - ask Talon
Expand Down
4 changes: 2 additions & 2 deletions recOrder/plugin/tab_recon.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def closeEvent(self, event):
self.worker.stopServer()

def hideEvent(self, event):
if event.type() == QEvent.Type.Hide and self._ui.isVisible():
if event.type() == QEvent.Type.Hide and (self._ui is not None and self._ui.isVisible()):
pass

def showEvent(self, event):
Expand Down Expand Up @@ -1516,7 +1516,7 @@ def startServer(self):

while self.serverRunning:
connection, address = self.serverSocket.accept()
if not self.ui.isVisible():
if self.ui is not None and not self.ui.isVisible():
break
try:
buf = connection.recv(64)
Expand Down
18 changes: 18 additions & 0 deletions recOrder/tests/widget_tests/test_pydantic_model_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout

from recOrder.plugin import tab_recon

class MainWindow(QWidget):
def __init__(self):
super().__init__()
recon_tab = tab_recon.Ui_Form()
layout = QVBoxLayout()
self.setLayout(layout)
layout.addWidget(recon_tab.recon_tab_widget)

if __name__ == "__main__":
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())

0 comments on commit 29c6a98

Please sign in to comment.