Skip to content

Commit

Permalink
qt6 edits
Browse files Browse the repository at this point in the history
  • Loading branch information
jooste committed Sep 16, 2022
1 parent 157e6e7 commit 57d0130
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extra/textclient/textclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from PyQt6.QtCore import Qt, QTimer
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QTextEdit

from bluesky.network import Client
from bluesky.network.client import Client


# The echo textbox, command line, and bluesky network client as globals
Expand Down Expand Up @@ -54,7 +54,7 @@ def __init__(self, parent=None):
super().__init__(parent)
self.setMinimumHeight(150)
self.setReadOnly(True)
self.setFocusPolicy(Qt.NoFocus)
# self.setFocusPolicy(Qt.NoFocus)

def echo(self, text, flags=None):
''' Add text to this echo box. '''
Expand All @@ -67,12 +67,12 @@ class Cmdline(QTextEdit):
def __init__(self, parent=None):
super().__init__(parent)
self.setMaximumHeight(21)
self.setFocusPolicy(Qt.StrongFocus)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
# self.setFocusPolicy(Qt.StrongFocus)
# self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

def keyPressEvent(self, event):
''' Handle Enter keypress to send a command to BlueSky. '''
if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return:
if event.key() == Qt.Key.Key_Enter or event.key() == Qt.Key.Key_Return:
if bsclient is not None:
bsclient.stack(self.toPlainText())
echobox.echo(self.toPlainText())
Expand Down

0 comments on commit 57d0130

Please sign in to comment.