Qt-contributors-summit-2014-QtCS14QtQuick: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
=Notes from QtQuick session= | |||
==Adaptive UI continued from QtCS 2013== | |||
Apparently we have form factor detection now? https://codereview.qt.io/#change,84471<br /> That should help finish enacting the previous adaptable UI plans, but now we need people to use them and provide feedback. | |||
==Views NG continued from QtCS 2013== | |||
A couple more people partially volunteered. Maybe we can add them together and get 1 full volunteer to start working on this? | |||
==QtGui equivalent== | |||
''For types not non-visual QtQml, but not QtQuick specific'' | |||
“QtQmlGui” layer is needed, for stuff like Qt.vector3D and colors, which is <span class="caps">GUI</span> related (not viable for QtQml) but should be shared between more than just QtQuick. | |||
Prerequisite feature for the <span class="caps">QML</span> discussion – Module dependencies. Something like<br /> | |||
<div class="cpp-qt geshi"> | |||
# <div class="de1"><span class="kw2">using</span> QtQml <span class="nu16">2.0</span></div> | |||
</div> | |||
<br /> in your qmldir, and then<br /> | |||
<div class="cpp-qt geshi"> | |||
# <div class="de1">import MyModule <span class="nu16">1.0</span> as Namespace</div> | |||
</div> | |||
would also have the effect of | |||
<div class="cpp-qt geshi"> | |||
# <div class="de1">import QtQml <span class="nu16">2.0</span> as Namespace</div> | |||
</div> | |||
Then we can have QtQuick using QtQml 2.0 and QtQmlGui 2.0, and “move” items without breaking applications. | |||
==Some new elements== | |||
Both suggested, and likely will be contributed, by Sean Harmer. | |||
===Polar Coordinate Positioner=== | |||
Positions items around a pole. | |||
===MouseRegion=== | |||
Non-rectangular MouseArea. Probably a new element, as it will be much more complex and it will be overkill for the common case. | |||
==Expanded Touch Regions for fat fingers== | |||
Touch Special Handling? Threshold around touch events<br /> Long term might want:<br /> | |||
<div class="cpp-qt geshi"> | |||
# <div class="de1">Window <span class="br0">{</span></div> | |||
# <div class="de1"> threshold<span class="sy0">:</span> isTablet ? <span class="nu0">10</span> <span class="sy0">:</span> <span class="nu0">15</span> <span class="co1">//Plus attached property to fine-tune</span></div> | |||
# <div class="de1"> Rectangle <span class="br0">{</span></div> | |||
# <div class="de1"> MouseArea <span class="br0">{</span> anchors.<span class="me1">fill</span><span class="sy0">:</span> parent <span class="br0">}</span></div> | |||
# <div class="de2"> <span class="br0">}</span></div> | |||
# <div class="de1"><span class="br0">}</span></div> | |||
</div> | |||
<br /> Where threshold is implemented inside the touch delivery and includes intelligent heuristics (like if you touch an area between a tiny button and a giant button, you probably wanted the tiny button because if you wanted the giant button you’d be closer to the center). | |||
But for now, MouseArea margins can do the basic, non-intelligent way. Especially when using singletons:<br /> | |||
<div class="cpp-qt geshi"> | |||
# <div class="de1">QtObject <span class="br0">{</span><span class="co1">//Singleton, document for now</span></div> | |||
# <div class="de1"> property <span class="kw4">int</span> margins<span class="sy0">:</span> <span class="sy0">-</span><span class="nu0">15</span></div> | |||
# <div class="de1"><span class="br0">}</span></div> | |||
</div> | |||
<br /> So a per device/form singleton and having MouseArea margins bind to that allows all anchors.fill: parent MouseAreas to extend beyond their parent. | |||
==QFontMetrics Functionality== | |||
TextContainer element which exposes similar functionality to QFontMetrics. But it exposes it by sizing a non-visual item with set sizes. Like an invisible text item, more efficient and not propagating visibility to its children. Something like:<br /> | |||
<div class="cpp-qt geshi"> | |||
# <div class="de1">TextContainer <span class="br0">{</span> <span class="co1">//+ More font metrics functions, like baseline (but not baseline specifically)</span></div> | |||
# <div class="de1"> text<span class="sy0">:</span> <span class="st0">"100%"</span> <span class="co1">//Not painted ever, used only for sizing</span></div> | |||
# <div class="de1"> font<span class="sy0">:</span> realTextt.<span class="me1">font</span></div> | |||
# <div class="de1"> Text <span class="br0">{</span></div> | |||
# <div class="de2"> id<span class="sy0">:</span> realText</div> | |||
# <div class="de1"> text<span class="sy0">:</span> slider.<span class="me1">value</span></div> | |||
# <div class="de1"> anchors.<span class="me1">centerIn</span><span class="sy0">:</span> parent</div> | |||
# <div class="de1"> <span class="br0">}</span></div> | |||
# <div class="de1"><span class="br0">}</span></div> | |||
</div> | |||
<br /> But TextContainer is a terrible name… |
Revision as of 14:12, 25 February 2015
Notes from QtQuick session
Adaptive UI continued from QtCS 2013
Apparently we have form factor detection now? https://codereview.qt.io/#change,84471
That should help finish enacting the previous adaptable UI plans, but now we need people to use them and provide feedback.
Views NG continued from QtCS 2013
A couple more people partially volunteered. Maybe we can add them together and get 1 full volunteer to start working on this?
QtGui equivalent
For types not non-visual QtQml, but not QtQuick specific
“QtQmlGui” layer is needed, for stuff like Qt.vector3D and colors, which is GUI related (not viable for QtQml) but should be shared between more than just QtQuick.
Prerequisite feature for the QML discussion – Module dependencies. Something like
- using QtQml 2.0
in your qmldir, and then
- import MyModule 1.0 as Namespace
would also have the effect of
- import QtQml 2.0 as Namespace
Then we can have QtQuick using QtQml 2.0 and QtQmlGui 2.0, and “move” items without breaking applications.
Some new elements
Both suggested, and likely will be contributed, by Sean Harmer.
Polar Coordinate Positioner
Positions items around a pole.
MouseRegion
Non-rectangular MouseArea. Probably a new element, as it will be much more complex and it will be overkill for the common case.
Expanded Touch Regions for fat fingers
Touch Special Handling? Threshold around touch events
Long term might want:
- Window {
- threshold: isTablet ? 10 : 15 //Plus attached property to fine-tune
- Rectangle {
- MouseArea { anchors.fill: parent }
- }
- }
Where threshold is implemented inside the touch delivery and includes intelligent heuristics (like if you touch an area between a tiny button and a giant button, you probably wanted the tiny button because if you wanted the giant button you’d be closer to the center).
But for now, MouseArea margins can do the basic, non-intelligent way. Especially when using singletons:
- QtObject {//Singleton, document for now
- property int margins: -15
- }
So a per device/form singleton and having MouseArea margins bind to that allows all anchors.fill: parent MouseAreas to extend beyond their parent.
QFontMetrics Functionality
TextContainer element which exposes similar functionality to QFontMetrics. But it exposes it by sizing a non-visual item with set sizes. Like an invisible text item, more efficient and not propagating visibility to its children. Something like:
- TextContainer { //+ More font metrics functions, like baseline (but not baseline specifically)
- text: "100%" //Not painted ever, used only for sizing
- font: realTextt.font
- Text {
- id: realText
- text: slider.value
- anchors.centerIn: parent
- }
- }
But TextContainer is a terrible name…