Skip to content

Commit

Permalink
Merge pull request #4978 from jenshnielsen/add_pywin32_types
Browse files Browse the repository at this point in the history
Add pywin32 types
  • Loading branch information
jenshnielsen authored Feb 7, 2023
2 parents 91d0522 + 78ab4f4 commit c1f85e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ test = [
"types-setuptools>=57.0.0",
"types-tabulate>=0.1.0",
"types-tqdm>=4.64.6",
"types_pywin32>=305.0.0.7"
]
docs = [
"autodocsumm>=0.2.9",
Expand Down Expand Up @@ -211,17 +212,13 @@ module = [
"mcl_RF_Switch_Controller64",
"mcl_RF_Switch_Controller_NET45",
"opencensus.ext.azure.*",
"pythoncom",
"pyqtgraph.*",
"pywinusb.*",
"ruamel",
"spyder.utils.site",
"spyder_kernels.customize",
"System.IO",
"uncertainties",
"win32com.*",
"win32con",
"win32gui",
"wrapt",
"zhinst.qcodes",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
import win32com.client
from pythoncom import VT_BYREF, VT_I4, VT_R8
except ImportError as e:
message = ('To use the DynaCool Driver, please install win32com.'
' Installation can be done with pip install pypiwin32com')
message = "To use the DynaCool Driver, please install pywin32."
log.exception(message)
raise ImportError(message)
raise ImportError(message) from e


CmdArgs = namedtuple('CmdArgs', 'cmd args')
Expand Down
10 changes: 6 additions & 4 deletions qcodes/utils/qt_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ def foreground_qt_window(window: "QMainWindow") -> None:
# use the idea from
# https://stackoverflow.com/questions/12118939/how-to-make-a-pyqt4-window-jump-to-the-front
SetWindowPos(
window.winId(), # pyright: ignore[reportGeneralTypeIssues]
win32con.HWND_TOPMOST, # = always on top. only reliable way to bring it to the front on windows
int(window.winId()),
win32con.HWND_TOPMOST,
# = always on top. only reliable way to bring it to the front on windows
0,
0,
0,
0,
win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_SHOWWINDOW,
)
SetWindowPos(
window.winId(), # pyright: ignore[reportGeneralTypeIssues]
win32con.HWND_NOTOPMOST, # disable the always on top, but leave window at its top position
int(window.winId()),
win32con.HWND_NOTOPMOST,
# disable the always on top, but leave window at its top position
0,
0,
0,
Expand Down

0 comments on commit c1f85e4

Please sign in to comment.