summaryrefslogtreecommitdiffstats
path: root/examples/declarative/focusscope
Commit message (Collapse)AuthorAgeFilesLines
* Use console.log, not printWarwick Allison2009-11-233-12/+12
|
* Improve highlight range API and fix incorrect list end calc.Martin Jones2009-10-271-2/+2
|
* lowercase idsYann Bodson2009-10-063-33/+33
|
* Update testAaron Kennedy2009-09-291-2/+2
|
* Another focusscope testAaron Kennedy2009-09-291-0/+75
|
* Focus changes to QFxItem and QFxView.Andreas Aardal Hanssen2009-09-152-12/+12
| | | | | | | | | | | | | | | Remove QFxItem::activeFocus, make QFxItem::focus behave like QGraphicsItem::focus (same as activeFocus essentially). Introduce QFxItem::wantsFocus to provide the same behavior as QFxItem::focus used to. Also updated the focusScope manual tests to reflect this new behavior. This change is going to break every example that relies on activeFocus. The fix is to replace all references with "focus" instead. All places that bind to "focus" should now bind to "wantsFocus" instead. Reviewed-by: akennedy
* ListView currentItemMode API replaced with highlight range API.Martin Jones2009-09-141-1/+3
|
* Fixup 928e81b68e0b695662c7ee3dd0bfa409a7ca1ffdAaron Kennedy2009-08-271-0/+50
| | | | | I messed up when I reapplied this patch to the branch head. This also adds an extra test for the case fixed.
* Implement Focus Scope support in GraphicsViewAaron Kennedy2009-08-272-0/+116
Focus Scopes are an additional focus paradigm, designed to be more suitable for use by declarative UI. With focus scopes, graphics view continues to have a single focused item - this is the single item to which key events are *actually* delivered. To simplify the description that follows, we will say that this element has "global focus". Focus scopes partitions focus into a heirarchy. Each focus scope may have one sub-focused item, which may itself be another focus scope. The sub-focused item is said to be have "scope focus" or its ancestor focus scope. Consequently, any given QGraphicsItem may be globally focused, scope focused (which means it is focused within its ancestor focus scope) or both. A focus scope corresponds to a QGraphicsItem with the ItemIsFocusScope flag set. As graphics view doesn't have a single root item, a "virtual" focus scope is modeled as being the ancestor of all the root items. With focus scopes, when QGraphicsItem::setFocus() is called, the item's ancestors are searched until a focus scope is found (remembering the "virtual" root focus scope is used if there is no *actual* ancestor scope). The item is set as the sub-focused item of the focus scope (becoming focus scoped) and any existing sub-focused item of that focus scope has scope focus removed from it. The item that receives global focus is found by beginning at the "virtual" root focus scope and recursively decending into each item that is scope focused until a leaf (non-focus scope) item is reached. The implementation takes shortcuts here to be slightly more optimal, but the end result should be the same as though this abstract algorithm was evaluated each time. Two manual examples of focus scope are found under examples/declarative/focusscope