Source code for schrodinger.trajectory.trajectory_gui_dir.traj_plot_widgets

"""
Peripheral widgets for the plot panel

Copyright Schrodinger, LLC. All rights reserved.
"""
from schrodinger.Qt import QtCore
from schrodinger.Qt import QtWidgets


[docs]class PlotTitleLineEdit(QtWidgets.QLineEdit): """ Line Edit used in plot titles Editing is disabled until double clicked """
[docs] def __init__(self, parent=None): super().__init__(parent) self.allowEditing(False)
[docs] def mouseDoubleClickEvent(self, event): self.allowEditing(True) super().mouseDoubleClickEvent(event)
[docs] def focusOutEvent(self, event): self.allowEditing(False) super().focusOutEvent(event)
[docs] def allowEditing(self, enable): """ Allows the editing of the line edit """ self.setReadOnly(not enable) if enable: self.unsetCursor() else: self.setCursor(QtCore.Qt.PointingHandCursor)