A Widget is often obtained with funq.client.FunqClient.widget() .
Example:
my_widget = self.funq.widget('my_widget')
Allow to manipulate a QWidget or derived.
Variables: |
|
---|
Returns a dict of availables properties for this widget with associated values.
Example:
enabled = widget.properties()["enabled"]
Define some properties on this widget.
Example:
widget.set_properties(text="My beautiful text")
Define one property on this widget.
Example:
widget.set_property('text', "My beautiful text")
Wait for the properties to have the given values.
Example:
self.wait_for_properties({'enabled': True, 'visible': True})
Click on the widget. If wait_for_enabled is > 0 (default), it will wait until the widget become active (enabled and visible) before sending click.
Double click on the widget. If wait_for_enabled is > 0 (default), it will wait until the widget become active (enabled and visible) before sending click.
Simulate keypress and keyrelease events for every character in the given text. Example:
widget.keyclick("my text")
Send a shortcut on the widget, defined with a text sequence. See the QKeySequence::fromString to see the documentation of the format needed for the text sequence.
Parameters: | text – text sequence of the shortcut (see QKeySequence::fromString documentation) |
---|
Do a drag and drop from this widget.
Parameters: |
|
---|
CAUTION; This methods allows to call a slot (written on the tested application). The slot must take a QVariant and returns a QVariant.
This is not really recommended to use this method, as it will trigger code in the tested application in an unusual way.
The methods returns what the slot returned, decoded as python object.
Parameters: |
|
---|
To interact with items in QAbstractTableModel, it is needed to get the associated view (QAbstractItemView). The returned instance will be of type AbstractItemView and the data will then be retrievable with the AbstractItemView.model_items() method.
Example:
view = self.funq.widget('my_tableview')
assert isinstance(view, AbstractItemView)
model_items = view.model_items()
item = model_items.item_by_named_path(['item1'])
item.dclick()
Specific Widget to manipulate QAbstractItemView or derived.
Returns an instance of ModelItems based on the model associated to the view.
Returns the editor actually opened on this view. One item must be in editing mode, by using ModelItem.dclick() or ModelItem.edit() for example.
Currently these editor types are handled: ‘QLineEdit’, ‘QComboBox’, ‘QSpinBox’ and ‘QDoubleSpinBox’.
Parameters: | editor_class_name – name of the editor type. If None, every type of editor will be tested (this may actually be very slow) |
---|
Allow to manipulate all modelitems in a QAbstractModelItem or derived.
Variables: | items – list of ModelItem |
---|
Allow to iterate on every items recursively.
Example:
for item in items.iter():
print item
Returns the item (ModelItem) that match the arborescence defined by named_path and in the given column.
Note
The arguments are the same as for row_by_named_path(), with the addition of column.
Parameters: | column – the column of the desired item |
---|
Returns the item list of ModelItem that match the arborescence defined by named_path, or None if the path does not exists.
Important
Use unicode characters in named_path to match elements with non-ascii characters.
Example:
model_items.row_by_named_path([u'TG/CBO/AP (AUT 1)',
u'Paramètres tranche',
u'TG',
u'DANGER'])
Parameters: |
|
---|
Allow to manipulate a modelitem in a QAbstractModelItem or derived.
Variables: |
|
---|
Handling QGraphicsItems data is quite similar to handling data of the Models/Views framework.
It requires the associated view (an instance of QGraphicsView). In funq the widget will be an instance of GraphicsView and the data will be available with the GraphicsView.gitems() method.
Example:
gview = self.funq.widget('my_gview')
gitems = gview.gitems()
for item in gitems.iter():
# do something with item
Allow to manipulate an instance of QGraphicsView.
Allow to manipulate a group of QGraphicsItems.
Variables: | items – list of GItem that are on top of the scene (and not subitems) |
---|
Allow to iterate on every items recursively.
Example:
for item in items.iter():
print item
Allow to manipulate a QGraphicsItem.
Variables: |
|
---|