Skip to content

Commit

Permalink
Update tutorial app and merge Luis updates
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Nov 26, 2018
1 parent 557467d commit c48b745
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
9 changes: 3 additions & 6 deletions pyforms_gui/controls/control_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@

class ControlLabel(ControlBase):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.selectable = kwargs.get('selectable', False)

def init_form(self):
control_path = tools.getFileInSameDirectory(__file__, "label.ui")
self._form = uic.loadUi(control_path)
self._form.label.setText(self._label)
self._selectable = False
super(ControlLabel, self).init_form()

def load_form(self, data, path=None): pass
Expand All @@ -41,8 +38,7 @@ def selectable(self): return self._selectable

@selectable.setter
def selectable(self, value):
self._selectable = value
if self._selectable:
if value:
self._form.label.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
self._form.label.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
else:
Expand All @@ -52,6 +48,7 @@ def selectable(self, value):
@property
def form(self): return self._form


@property
def value(self): return ControlBase.value.fget(self)

Expand Down
5 changes: 0 additions & 5 deletions pyforms_gui/controls/control_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@
from AnyQt.QtWidgets import QLineEdit
from AnyQt import uic


class ControlText(ControlBase):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.readonly = kwargs.get('readonly', False)

def init_form(self):
control_path = tools.getFileInSameDirectory(__file__, "textInput.ui")
self._form = uic.loadUi(control_path)
Expand Down
6 changes: 3 additions & 3 deletions tutorials/Controls4Docs/ControlList.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ def __init__(self):
super(SimpleExample,self).__init__('Simple example')

#Definition of the forms fields
self._control = ControlList('List')
self._control = ControlList('List',horizontal_headers=[] )

self.formset = [' ',(' ', '_control', ' '),' ']

self._control.value = [('Elem1', 'Elem2'), ('Elem3', 'Elem4')]

self._control += ('Elem5', 'Elem6')

self._control.horizontalHeaders = ['col1','col2','col3']
self._control.horizontalHeaders = ['col4',]
self._control.horizontal_headers = ['col1','col2','col3']
self._control.horizontal_headers = ['col4',]



Expand Down

0 comments on commit c48b745

Please sign in to comment.