Opened 9 years ago

Closed 9 years ago

#399 closed defect (fixed)

Pressing delete key in log window goes back in html history

Reported by: Tom Goddard Owned by: Tom Goddard
Priority: major Milestone:
Component: Window Toolkit Version:
Keywords: Cc: pett@…
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Clicking into the log window (Qt) and pressing delete goes back in the html history which usually removes the last command from the history.

Ideally I'd like clicking on the log not to take focus, so I can still type commands after clicking a link in the log.

HTML history should not be recorded as new commands are added to the log. The Qt 5.7 QWebEngineView setHtml() method that we use to update the log claims it does not effect the history, but apparently that is incorrect. I did not see any way to disable history, but there is a clear() method on QWebEngineHistory() so it can be cleared each time we update the log.

Change History (5)

comment:1 by Tom Goddard, 9 years ago

I tried to get prevent the log panel from getting focus using QtWidget setFocusPolicy(NoFocus) on the QDockWidget, the ui_area, and the QWebEngineView -- had no effect, still responded to delete key presses. Qt 5.7.

I tried setFocusProxy(main_window) on the log panel (above 3 widgets) to redirect all key strokes to the main window, had no effect, log still responded to delete key, and alphanumeric keys did not go to command-line.

I tried setting keyPressEvent on the log panel widgets to main_window.forward_keystroke and alphanumeric keys went to command-line, but the delete key still changed the log contents and did not go to the command-line.

Was not able to find any method to get the delete key forwarded to the command-line.

comment:2 by Tom Goddard, 9 years ago

Using QApplication focusChanged signal never reports the log window getting the focus. Instead QOpenGLWidget is reported as getting the focus.

comment:3 by Tom Goddard, 9 years ago

Actually the log window does get the focus -- the QWebEngineView is reported as a QOpenGLWidget which initially confused me, thinking that was the graphics window.

Should clear the html history every time the html content is set. Haven't made this change yet. Want delete key and other keys forwarded to command-line.

comment:4 by Tom Goddard, 9 years ago

Fixed.

Cleared the HTML history for the log each time the html content is set with setHtml(). There doesn't appear to be a way to limit the history length to 0, there is no Qt API call for that although the Qt C++source code has a method setHistoryLimit() and the limit is set to 30 initially. Also the Qt docs say setHtml() does not effect the history, but this appears to be false.

comment:5 by Tom Goddard, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.