diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-06 20:40:54 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-06 21:41:33 +0200 |
commit | 026353c74a6343281045d42e717cd67e52aaf24c (patch) | |
tree | 1ad36ce6a7e57d10df808715981bf07c9a6462d6 /src | |
parent | 0385c432962418431ec5fb4a80d57a5dd9926c6e (diff) | |
parent | 6b23b6b4507b42a96fb3fb7d2315523f54ce1ac0 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Fusion style ComboBox popup height was adjusted according to 90a0d402
to make tst_controls::ComboBox::test_emptyPopupAfterModelCleared pass
with the Fusion style.
Conflicts:
src/imports/controls/ComboBox.qml
src/imports/controls/material/ComboBox.qml
src/imports/controls/universal/ComboBox.qml
Change-Id: I2bad826dc56de9d8952ea2a9ace950c7cf3cbc58
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/ComboBox.qml | 3 | ||||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-popup.png | bin | 21693 -> 30328 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtquickcontrols2-popup.svg | 560 | ||||
-rw-r--r-- | src/imports/controls/fusion/ComboBox.qml | 3 | ||||
-rw-r--r-- | src/imports/controls/material/ComboBox.qml | 3 | ||||
-rw-r--r-- | src/imports/controls/universal/ComboBox.qml | 3 | ||||
-rw-r--r-- | src/quicktemplates2/qquickcombobox.cpp | 10 | ||||
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 7 | ||||
-rw-r--r-- | src/quicktemplates2/qquickoverlay.cpp | 29 | ||||
-rw-r--r-- | src/quicktemplates2/qquickoverlay_p_p.h | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpage.cpp | 7 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpage_p.h | 2 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpopup.cpp | 29 |
13 files changed, 485 insertions, 173 deletions
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 8442ec79..a3735880 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T @@ -111,7 +112,7 @@ T.ComboBox { popup: T.Popup { y: control.height width: control.width - implicitHeight: contentItem.implicitHeight + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) topMargin: 6 bottomMargin: 6 diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.png b/src/imports/controls/doc/images/qtquickcontrols2-popup.png Binary files differindex 4514948d..a0bc3d8c 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-popup.png +++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg index 1d78addf..91bde0c5 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg +++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg @@ -9,12 +9,12 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="679.31317" - height="357.84125" - viewBox="0 0 679.31314 357.84124" + width="817.22076" + height="605.42444" + viewBox="0 0 766.14443 567.58541" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r15371" sodipodi:docname="qtquickcontrols2-popup.svg" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> @@ -30,9 +30,9 @@ inkscape:isstock="true"> <path id="path4327" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -45,9 +45,9 @@ inkscape:isstock="true"> <path id="path4318" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -60,8 +60,8 @@ inkscape:isstock="true"> <path id="path4191" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" transform="matrix(0.4,0,0,0.4,4,0)" inkscape:connector-curvature="0" /> </marker> @@ -77,7 +77,7 @@ id="path4212" style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" - transform="scale(-0.6,-0.6)" + transform="scale(-0.6)" inkscape:connector-curvature="0" /> </marker> <marker @@ -91,9 +91,9 @@ <path inkscape:connector-curvature="0" id="path4318-4" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" /> + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> </marker> <marker inkscape:stockid="TriangleOutL" @@ -106,9 +106,9 @@ <path inkscape:connector-curvature="0" id="path4327-1" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" /> + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> </marker> <marker inkscape:stockid="TriangleInL" @@ -120,9 +120,9 @@ inkscape:isstock="true"> <path id="path4318-9" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -135,9 +135,9 @@ inkscape:isstock="true"> <path id="path4327-5" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -150,9 +150,9 @@ inkscape:isstock="true"> <path id="path4318-2" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(-0.8,-0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -165,11 +165,161 @@ inkscape:isstock="true"> <path id="path4327-2" - d="m 5.77,0 -8.65,5 0,-10 8.65,5 z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="scale(0.8,0.8)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-5" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-17" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-7-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-5-2" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-4-3" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-17-4" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-3" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-7-1-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-5-2-3" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-4-3-5" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-17-4-6" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-4-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-4" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-3-6" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-5" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> </defs> <sodipodi:namedview id="base" @@ -178,21 +328,21 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="359.69451" - inkscape:cy="143.84745" + inkscape:zoom="1" + inkscape:cx="433.56809" + inkscape:cy="282.4206" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="false" inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" + inkscape:window-height="1137" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" - fit-margin-top="0" - fit-margin-left="0" - fit-margin-right="0" - fit-margin-bottom="0" + fit-margin-top="1" + fit-margin-left="1" + fit-margin-right="1" + fit-margin-bottom="1" units="px" /> <metadata id="metadata7"> @@ -202,7 +352,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -210,19 +360,19 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(91.482322,-255.11685)"> + transform="translate(117.89629,-192.1482)"> <rect - style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1.21129668;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="rect4136" - width="564.41473" - height="248.82799" - x="-30.289024" - y="321.69858" /> + width="564.20264" + height="365.80341" + x="-21.075951" + y="321.69159" /> <flowRoot xml:space="preserve" id="flowRoot4138" - style="font-style:normal;font-weight:normal;font-size:15.41801071px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(1.1690183,0,0,1.1690183,19.800223,-141.31953)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(1.1690183,0,0,1.1690183,28.907253,-141.43255)"><flowRegion id="flowRegion4140"><rect id="rect4142" width="129.78784" @@ -230,55 +380,65 @@ x="-34.519978" y="400.22751" style="font-size:15.41801071px;fill:#000000" /></flowRegion><flowPara - id="flowPara4144" - style="font-size:20.55734825px;fill:#000000">Background</flowPara><flowPara - id="flowPara4146" /></flowRoot> <rect - style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:27.60000038;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" + id="flowPara4146" + style="font-size:19.24691807px;line-height:1.25">Background</flowPara></flowRoot> <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:32.28859329;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" id="rect4148" - width="464.22452" - height="165.94499" - x="18.895706" - y="364.74274" /> + width="432.17508" + height="243.95665" + x="44.027798" + y="384.97104" /> <flowRoot xml:space="preserve" id="flowRoot4138-6" - style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,144.03104,146.23557)"><flowRegion - id="flowRegion4140-6"><rect + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-size:37.45019655px;" + transform="matrix(0.6007979,0,0,0.6007979,156.36974,204.3766)"><flowRegion + id="flowRegion4140-6" + style="font-size:37.45019655px;"><rect id="rect4142-6" width="334.36047" height="80.812172" x="42.426407" y="481.62601" - style="font-size:40px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6">Content item</flowPara></flowRoot> <path - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL);marker-end:url(#TriangleOutL)" - d="m 27.018805,516.90108 0,-133.62042" - id="path4179" - inkscape:connector-curvature="0" /> - <path - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839902;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2);marker-end:url(#TriangleOutL-9)" - d="m 26.776662,538.68728 451.028788,0" - id="path4179-7" - inkscape:connector-curvature="0" /> + style="font-size:37.45019655px;fill:#000000;" /></flowRegion><flowPara + id="flowPara4146-6" + style="font-size:37.45019655px;line-height:1.25;">Content item</flowPara></flowRoot> <g + id="g8534" + transform="translate(3.75)"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179" + d="M 53.000835,594.60056 V 394.41764" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL);marker-end:url(#TriangleOutL)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,35.985339,191.89348)" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="flowRoot4138-6-2" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6"><rect + style="font-size:20px;fill:#000000" + y="481.62601" + x="42.426407" + height="101.01524" + width="117.17769" + id="rect4142-6-1" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;fill:#000000" + id="flowPara9732">Available height</flowPara></flowRoot> </g> + <g + id="g8545"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-7" + d="M 56.564013,608.03247 H 464.47744" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91225624;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2);marker-end:url(#TriangleOutL-9)" /> + </g> <flowRoot xml:space="preserve" - id="flowRoot4138-6-2" - style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,10.003309,144.31674)"><flowRegion - id="flowRegion4140-6-6"><rect - id="rect4142-6-1" - width="117.17769" - height="101.01524" - x="42.426407" - y="481.62601" - style="font-size:20px;fill:#000000" /></flowRegion><flowPara - id="flowPara9732" - style="font-size:17.5px;fill:#000000">Available height</flowPara></flowRoot> <flowRoot - xml:space="preserve" id="flowRoot4138-6-2-7" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,10.811464,253.07573)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.5748758,0,0,0.59339159,197.89365,327.81679)"><flowRegion id="flowRegion4140-6-6-4"><rect id="rect4142-6-1-4" width="252.53812" @@ -286,60 +446,70 @@ x="42.426407" y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" - id="flowPara10048">Available width</flowPara></flowRoot> <flowRoot - xml:space="preserve" - id="flowRoot4138-6-1" - style="font-style:normal;font-weight:normal;font-size:25px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,210.99354,300.96896)"><flowRegion - id="flowRegion4140-6-9"><rect - id="rect4142-6-0" - width="270.72089" - height="68.690361" - x="42.426407" - y="481.62601" - style="font-size:25px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6-2" - style="font-size:17.5px">Width</flowPara></flowRoot> <path - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.90119678;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)" - d="m -26.522148,583.27143 557.292688,0" - id="path4179-8" - inkscape:connector-curvature="0" /> - <path - style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.9011969;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)" - d="m -43.461661,566.30584 0,-239.7552" - id="path4179-9" - inkscape:connector-curvature="0" /> + style="font-size:17.5px;line-height:1.25;fill:#000000" + id="flowPara10048">Available width</flowPara></flowRoot> <g + id="g7654" + transform="translate(0,118.125)"> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,220.10057,300.85594)" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="flowRoot4138-6-1" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-9"><rect + style="font-size:25px;fill:#000000" + y="481.62601" + x="42.426407" + height="68.690361" + width="270.72089" + id="rect4142-6-0" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25" + id="flowPara4146-6-2">Width</flowPara></flowRoot> <path + inkscape:connector-curvature="0" + id="path4179-8" + d="M -17.415118,583.15841 H 539.87757" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.90119678;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)" /> + </g> + <g + id="g7868"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-9" + d="M -34.354631,681.50532 V 326.43762" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.9011969;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,-102.8965,207.92708)" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="flowRoot4138-6-1-7" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-9-7"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="68.690361" + width="270.72089" + id="rect4142-6-0-5" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;fill:#000000" + id="flowPara4146-6-2-9">Height</flowPara></flowRoot> </g> <flowRoot xml:space="preserve" - id="flowRoot4138-6-1-7" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,-112.00353,150.83655)"><flowRegion - id="flowRegion4140-6-9-7"><rect - id="rect4142-6-0-5" - width="270.72089" - height="68.690361" - x="42.426407" - y="481.62601" - style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6-2-9" - style="font-size:17.5px;fill:#000000">Height</flowPara></flowRoot> <flowRoot - xml:space="preserve" id="flowRoot4138-6-3" - style="font-style:normal;font-weight:normal;font-size:60px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,166.31611,-24.786365)"><flowRegion - id="flowRegion4140-6-67"><rect + style="font-style:normal;font-weight:normal;font-size:54.09472656px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,189.12753,-15.52439)"><flowRegion + id="flowRegion4140-6-67" + style="font-size:54.09472656px"><rect id="rect4142-6-5" width="334.36047" height="80.812172" x="42.426407" y="481.62601" - style="font-size:60px;fill:#000000" /></flowRegion><flowPara - id="flowPara4146-6-3">Popup</flowPara></flowRoot> <flowRoot + style="font-size:54.09472656px;fill:#000000" /></flowRegion><flowPara + id="flowPara4146-6-3" + style="font-size:54.09472656px;line-height:1.25">Popup</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,186.57489,257.45801)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,193.38009,362.34499)"><flowRegion id="flowRegion4140-6-6-4-6"><rect id="rect4142-6-1-4-2" width="252.53812" @@ -347,12 +517,12 @@ x="42.426407" y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" + style="font-size:17.5px;line-height:1.25;fill:#000000" id="flowPara10048-9">Bottom padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-1" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,193.9747,48.798368)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,203.99672,59.935343)"><flowRegion id="flowRegion4140-6-6-4-6-2"><rect id="rect4142-6-1-4-2-7" width="252.53812" @@ -360,12 +530,12 @@ x="42.426407" y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" + style="font-size:17.5px;line-height:1.25;fill:#000000" id="flowPara10048-9-0">Top padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-9" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,457.80767,148.11921)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,459.4147,204.33375)"><flowRegion id="flowRegion4140-6-6-4-6-3"><rect id="rect4142-6-1-4-2-6" width="81.109558" @@ -377,8 +547,8 @@ id="flowPara4386">Right padding</flowPara></flowRoot> <flowRoot xml:space="preserve" id="flowRoot4138-6-2-7-5-9-2" - style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - transform="matrix(0.6007979,0,0,0.6007979,-54.735211,151.06168)"><flowRegion + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-38.128181,202.36202)"><flowRegion id="flowRegion4140-6-6-4-6-3-5"><rect id="rect4142-6-1-4-2-6-4" width="81.109558" @@ -387,5 +557,115 @@ y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" - id="flowPara4386-0">Left padding</flowPara></flowRoot> </g> + id="flowPara4386-0">Left padding</flowPara></flowRoot> <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.09440184;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4757" + width="763.17505" + height="514.7428" + x="-116.41159" + y="243.5061" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-3-4" + style="font-style:normal;font-weight:normal;font-size:59.99999619px;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,175.59116,-90.52439)"><flowRegion + id="flowRegion4140-6-67-2" + style="font-size:59.99999619px"><rect + id="rect4142-6-5-4" + width="334.36047" + height="80.812172" + x="42.426407" + y="481.62601" + style="font-size:59.99999619px;fill:#000000" /></flowRegion><flowPara + id="flowPara4146-6-3-0" + style="font-size:54.09472656px;line-height:1.25">Window</flowPara></flowRoot> <g + id="g5624" + transform="translate(0,116.25)"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-98" + d="M 562.38606,632.48202 V 575.7366" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-7);marker-end:url(#TriangleOutL-4)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,549.95467,303.47098)" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="flowRoot4138-6-2-7-5-9-1" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6-4-6-3-2"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="93.762154" + width="81.109558" + id="rect4142-6-1-4-2-6-9" /></flowRegion><flowPara + id="flowPara5598" + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Bottom margin</flowPara></flowRoot> </g> + <g + id="g5669" + transform="translate(-9.0164,-96.197039)"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-98-8" + d="M 571.40246,409.73194 V 352.98652" + style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-7-1);marker-end:url(#TriangleOutL-4-3)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,558.97106,80.720903)" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="flowRoot4138-6-2-7-5-9-1-8" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6-4-6-3-2-8"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="93.762154" + width="81.109558" + id="rect4142-6-1-4-2-6-9-2" /></flowRegion><flowPara + id="flowPara5598-6" + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Top margin</flowPara></flowRoot> </g> + <g + id="g7367" + transform="translate(32.877167,129.04286)"> + <path + transform="translate(-32.87717,-4.3906312)" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839908;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-4);marker-end:url(#TriangleOutL-9-3)" + d="m 558.40434,364.18736 h 70.4038" + id="path4179-7-5" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,510.85405,81.658403)" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="flowRoot4138-6-2-7-5-9-1-8-0" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6-4-6-3-2-8-5"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="93.762154" + width="81.109558" + id="rect4142-6-1-4-2-6-9-2-6" /></flowRegion><flowPara + id="flowPara5598-6-1" + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Right margin</flowPara></flowRoot> </g> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-7-5-2" + d="m -96.90814,305.30865 h 70.4038" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839908;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-4-7);marker-end:url(#TriangleOutL-9-3-6)" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-9-1-8-0-4" + style="font-style:normal;font-weight:normal;line-height:0.01%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + transform="matrix(0.6007979,0,0,0.6007979,-111.58126,-21.57968)"><flowRegion + id="flowRegion4140-6-6-4-6-3-2-8-5-3"><rect + id="rect4142-6-1-4-2-6-9-2-6-0" + width="81.109558" + height="93.762154" + x="42.426407" + y="481.62601" + style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000" + id="flowPara5598-6-1-4">Left margin</flowPara></flowRoot> </g> </svg> diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index 6e02cbc3..3244678a 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Templates 2.3 as T import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 @@ -142,7 +143,7 @@ T.ComboBox { popup: T.Popup { id: popup width: control.width - implicitHeight: contentItem.implicitHeight + 2 + height: Math.min(contentItem.implicitHeight + 2, control.Window.height - topMargin - bottomMargin) topMargin: 6 bottomMargin: 6 palette: control.palette diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 55afdb3f..57d5a61b 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T @@ -136,7 +137,7 @@ T.ComboBox { popup: T.Popup { y: control.editable ? control.height - 5 : 0 width: control.width - implicitHeight: contentItem.implicitHeight + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) transformOrigin: Item.Top topMargin: 12 bottomMargin: 12 diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 35c4d815..1888f8d4 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T @@ -132,7 +133,7 @@ T.ComboBox { popup: T.Popup { width: control.width - implicitHeight: Math.min(396, contentItem.implicitHeight) + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) topMargin: 8 bottomMargin: 8 diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index 7ba68f81..a6f9f6ca 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -705,7 +705,15 @@ QQuickComboBox::QQuickComboBox(QQuickItem *parent) QQuickComboBox::~QQuickComboBox() { - setPopup(nullptr); + Q_D(QQuickComboBox); + // Disconnect visibleChanged() to avoid a spurious highlightedIndexChanged() signal + // emission during the destruction of the (visible) popup. (QTBUG-57650) + QObjectPrivate::disconnect(d->popup, &QQuickPopup::visibleChanged, d, &QQuickComboBoxPrivate::popupVisibleChanged); + + // Delete the popup directly instead of calling setPopup(nullptr) to avoid calling + // destroyDelegate(popup) and potentially accessing a destroyed QML context. (QTBUG-50992) + delete d->popup; + d->popup = nullptr; } /*! diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index 030fc98e..8159f05e 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -301,7 +301,7 @@ bool QQuickDrawerPrivate::grabMouse(QQuickItem *item, QMouseEvent *event) Q_Q(QQuickDrawer); handleMouseEvent(item, event); - if (!window || !interactive || popupItem->keepMouseGrab()) + if (!window || !interactive || popupItem->keepMouseGrab() || popupItem->keepTouchGrab()) return false; const QPointF movePoint = event->windowPos(); @@ -377,6 +377,7 @@ bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event) } if (overThreshold) { + popupItem->grabTouchPoints(QVector<int>() << touchId); popupItem->setKeepTouchGrab(true); offset = offsetAt(movePoint); } @@ -422,7 +423,6 @@ bool QQuickDrawerPrivate::handleRelease(QQuickItem *item, const QPointF &point, return QQuickPopupPrivate::handleRelease(item, point, timestamp); } - pressPoint = QPointF(); velocityCalculator.stopMeasuring(point, timestamp); qreal velocity = 0; @@ -479,6 +479,9 @@ bool QQuickDrawerPrivate::handleRelease(QQuickItem *item, const QPointF &point, popupItem->setKeepMouseGrab(false); popupItem->setKeepTouchGrab(false); + pressPoint = QPointF(); + touchId = -1; + return wasGrabbed; } diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index 0f7edc77..15104808 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -181,11 +181,23 @@ QQuickOverlayPrivate::QQuickOverlayPrivate() { } -bool QQuickOverlayPrivate::startDrag(QEvent *event) +bool QQuickOverlayPrivate::startDrag(QEvent *event, const QPointF &pos) { + Q_Q(QQuickOverlay); if (allDrawers.isEmpty()) return false; + // don't start dragging a drawer if a modal popup overlay is blocking (QTBUG-60602) + QQuickItem *item = q->childAt(pos.x(), pos.y()); + if (item) { + const auto popups = stackingOrderPopups(); + for (QQuickPopup *popup : popups) { + QQuickPopupPrivate *p = QQuickPopupPrivate::get(popup); + if (p->dimmer == item && popup->isVisible() && popup->isModal()) + return false; + } + } + const QVector<QQuickDrawer *> drawers = stackingOrderDrawers(); for (QQuickDrawer *drawer : drawers) { QQuickDrawerPrivate *p = QQuickDrawerPrivate::get(drawer); @@ -251,7 +263,7 @@ bool QQuickOverlayPrivate::handleMouseEvent(QQuickItem *source, QMouseEvent *eve { switch (event->type()) { case QEvent::MouseButtonPress: - if (!target && startDrag(event)) + if (!target && startDrag(event, event->windowPos())) return true; return handlePress(source, event, target); case QEvent::MouseMove: @@ -269,17 +281,12 @@ bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *eve bool handled = false; switch (event->type()) { case QEvent::TouchBegin: - if (!target && startDrag(event)) - handled = true; - else - handled = handlePress(source, event, target); - break; - case QEvent::TouchUpdate: + case QEvent::TouchEnd: for (const QTouchEvent::TouchPoint &point : event->touchPoints()) { switch (point.state()) { case Qt::TouchPointPressed: - if (!target && startDrag(event)) + if (!target && startDrag(event, point.scenePos())) handled = true; else handled |= handlePress(source, event, target); @@ -296,10 +303,6 @@ bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *eve } break; - case QEvent::TouchEnd: - handled = handleRelease(source, event, target ? target : mouseGrabberPopup.data()); - break; - default: break; } diff --git a/src/quicktemplates2/qquickoverlay_p_p.h b/src/quicktemplates2/qquickoverlay_p_p.h index de8539c9..38284332 100644 --- a/src/quicktemplates2/qquickoverlay_p_p.h +++ b/src/quicktemplates2/qquickoverlay_p_p.h @@ -70,7 +70,7 @@ public: return overlay->d_func(); } - bool startDrag(QEvent *event); + bool startDrag(QEvent *event, const QPointF &pos); bool handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target); bool handleMove(QQuickItem *source, QEvent *event, QQuickPopup *target); bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target); diff --git a/src/quicktemplates2/qquickpage.cpp b/src/quicktemplates2/qquickpage.cpp index 6137a7e8..40d47cda 100644 --- a/src/quicktemplates2/qquickpage.cpp +++ b/src/quicktemplates2/qquickpage.cpp @@ -329,6 +329,13 @@ QQmlListProperty<QQuickItem> QQuickPage::contentChildren() QQuickItemPrivate::children_clear); } +void QQuickPage::componentComplete() +{ + Q_D(QQuickPage); + QQuickControl::componentComplete(); + d->layout->update(); +} + void QQuickPage::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) { QQuickControl::contentItemChange(newItem, oldItem); diff --git a/src/quicktemplates2/qquickpage_p.h b/src/quicktemplates2/qquickpage_p.h index 90d10e4a..1b14588a 100644 --- a/src/quicktemplates2/qquickpage_p.h +++ b/src/quicktemplates2/qquickpage_p.h @@ -97,6 +97,8 @@ Q_SIGNALS: void contentChildrenChanged(); protected: + void componentComplete() override; + void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override; void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override; diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 543a6f34..840b9f19 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE \section1 Popup Layout - The following diagram illustrates the layout of a typical popup: + The following diagram illustrates the layout of a popup within a window: \image qtquickcontrols2-popup.png @@ -304,7 +304,7 @@ bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point) if (point.id() == touchId) return true; - if (touchId == -1 && point.state() == Qt::TouchPointPressed) { + if (touchId == -1 && point.state() != Qt::TouchPointReleased) { touchId = point.id(); return true; } @@ -986,12 +986,13 @@ void QQuickPopup::resetSpacing() /*! \qmlproperty real QtQuick.Controls::Popup::margins - This property holds the default margins around the popup. + This property holds the distance between the edges of the popup and the + edges of its window. A popup with negative margins is not pushed within the bounds of the enclosing window. The default value is \c -1. - \sa topMargin, leftMargin, rightMargin, bottomMargin + \sa topMargin, leftMargin, rightMargin, bottomMargin, {Popup Layout} */ qreal QQuickPopup::margins() const { @@ -1027,12 +1028,13 @@ void QQuickPopup::resetMargins() /*! \qmlproperty real QtQuick.Controls::Popup::topMargin - This property holds the top margin around the popup. + This property holds the distance between the top edge of the popup and + the top edge of its window. A popup with a negative top margin is not pushed within the top edge of the enclosing window. The default value is \c -1. - \sa margins, bottomMargin + \sa margins, bottomMargin, {Popup Layout} */ qreal QQuickPopup::topMargin() const { @@ -1057,12 +1059,13 @@ void QQuickPopup::resetTopMargin() /*! \qmlproperty real QtQuick.Controls::Popup::leftMargin - This property holds the left margin around the popup. + This property holds the distance between the left edge of the popup and + the left edge of its window. A popup with a negative left margin is not pushed within the left edge of the enclosing window. The default value is \c -1. - \sa margins, rightMargin + \sa margins, rightMargin, {Popup Layout} */ qreal QQuickPopup::leftMargin() const { @@ -1087,12 +1090,13 @@ void QQuickPopup::resetLeftMargin() /*! \qmlproperty real QtQuick.Controls::Popup::rightMargin - This property holds the right margin around the popup. + This property holds the distance between the right edge of the popup and + the right edge of its window. A popup with a negative right margin is not pushed within the right edge of the enclosing window. The default value is \c -1. - \sa margins, leftMargin + \sa margins, leftMargin, {Popup Layout} */ qreal QQuickPopup::rightMargin() const { @@ -1117,12 +1121,13 @@ void QQuickPopup::resetRightMargin() /*! \qmlproperty real QtQuick.Controls::Popup::bottomMargin - This property holds the bottom margin around the popup. + This property holds the distance between the bottom edge of the popup and + the bottom edge of its window. A popup with a negative bottom margin is not pushed within the bottom edge of the enclosing window. The default value is \c -1. - \sa margins, topMargin + \sa margins, topMargin, {Popup Layout} */ qreal QQuickPopup::bottomMargin() const { |