Commit ae9f1b02 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][databaseeditor] Allow content of the DB viewer to be selected

This will enable users to copy elements of the v1 implementation.
parent 01811488
......@@ -25,6 +25,7 @@
import numpy as np
from PyQt5 import QtCore
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import pyqtProperty
from PyQt5.QtCore import QStringListModel
......@@ -64,13 +65,21 @@ from .utils import create_delete_button_and_layout
# V1 part
class SelectableLabel(QLabel):
def __init__(self, parent=None):
super(SelectableLabel, self).__init__(parent)
self.setTextInteractionFlags(
QtCore.Qt.TextSelectableByMouse | QtCore.Qt.TextSelectableByKeyboard
)
class SetViewer(QWidget):
def __init__(self, parent=None):
super(SetViewer, self).__init__(parent)
self.name_label = QLabel()
self.template_label = QLabel()
self.view_label = QLabel()
self.name_label = SelectableLabel()
self.template_label = SelectableLabel()
self.view_label = SelectableLabel()
self.outputs_tablewidget = QTableWidget()
self.outputs_tablewidget.verticalHeader().setVisible(False)
self.outputs_tablewidget.setColumnCount(2)
......@@ -111,8 +120,8 @@ class ProtocolViewer(QWidget):
self.set_viewers = []
self.name_label = QLabel()
self.template_label = QLabel()
self.name_label = SelectableLabel()
self.template_label = SelectableLabel()
self.sets_layout = QVBoxLayout()
self.sets_layout.addStretch(1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment