From ce32f25ba3d616eba40d5f88781dd8bbcb0759f0 Mon Sep 17 00:00:00 2001 From: Kai Koehne <kai.koehne@nokia.com> Date: Tue, 13 Jul 2010 17:05:47 +0200 Subject: [PATCH] QmlOutline: Show icons for known types --- .../qmlicons/Qt/16x16/BorderImage.png | Bin 0 -> 416 bytes .../qtcreator/qmlicons/Qt/16x16/Flickable.png | Bin 0 -> 406 bytes .../qtcreator/qmlicons/Qt/16x16/Flipable.png | Bin 0 -> 512 bytes .../qmlicons/Qt/16x16/FocusScope.png | Bin 0 -> 367 bytes .../qtcreator/qmlicons/Qt/16x16/GridView.png | Bin 0 -> 320 bytes share/qtcreator/qmlicons/Qt/16x16/Image.png | Bin 0 -> 579 bytes share/qtcreator/qmlicons/Qt/16x16/Item.png | Bin 0 -> 303 bytes .../qtcreator/qmlicons/Qt/16x16/ListView.png | Bin 0 -> 339 bytes .../qtcreator/qmlicons/Qt/16x16/MouseArea.png | Bin 0 -> 459 bytes .../qtcreator/qmlicons/Qt/16x16/PathView.png | Bin 0 -> 334 bytes .../qtcreator/qmlicons/Qt/16x16/Rectangle.png | Bin 0 -> 236 bytes share/qtcreator/qmlicons/Qt/16x16/State.png | Bin 0 -> 316 bytes share/qtcreator/qmlicons/Qt/16x16/Text.png | Bin 0 -> 224 bytes .../qtcreator/qmlicons/Qt/16x16/TextEdit.png | Bin 0 -> 249 bytes .../qtcreator/qmlicons/Qt/16x16/TextInput.png | Bin 0 -> 327 bytes .../qmlicons/Qt/16x16/Transition.png | Bin 0 -> 247 bytes .../qmlicons/QtWebkit/16x16/WebView.png | Bin 0 -> 544 bytes src/libs/qmljs/qmljsicons.cpp | 58 +++++++++++++ src/libs/qmljs/qmljsicons.h | 9 +- src/plugins/qmljseditor/qmljseditor.cpp | 2 +- src/plugins/qmljseditor/qmljseditorplugin.cpp | 8 ++ src/plugins/qmljseditor/qmljseditorplugin.h | 1 + src/plugins/qmljseditor/qmloutlinemodel.cpp | 77 ++++++++++++++---- src/plugins/qmljseditor/qmloutlinemodel.h | 8 +- 24 files changed, 141 insertions(+), 22 deletions(-) create mode 100644 share/qtcreator/qmlicons/Qt/16x16/BorderImage.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Flickable.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Flipable.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/FocusScope.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/GridView.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Image.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Item.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/ListView.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/MouseArea.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/PathView.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Rectangle.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/State.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Text.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/TextEdit.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/TextInput.png create mode 100644 share/qtcreator/qmlicons/Qt/16x16/Transition.png create mode 100644 share/qtcreator/qmlicons/QtWebkit/16x16/WebView.png diff --git a/share/qtcreator/qmlicons/Qt/16x16/BorderImage.png b/share/qtcreator/qmlicons/Qt/16x16/BorderImage.png new file mode 100644 index 0000000000000000000000000000000000000000..ef21dd9710709b536736c433368d595b2fe298fc GIT binary patch literal 416 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6U4S$Y z{B+)352QE?JR*x37`TN&n2}-D90{Nxdx@v7EBh^WP96ohYbTyv1Dc}X>Eak-aeC?G zjeSiH0&VsWwH^v)_;$!{+`4_~{TBBHpBNWBH~r?h<>Ikp;fg7;3G13pDBe5zds6Pd zn}3Zz`%hb>5fJ*n`LU?$L9b9-g$Ly#0t<9cZ<0O|D&o2;ZvFK5l}bt-9ILEW*E7bf z54TI)efQB`t&q^K>bY+c9u!yvTsO^}HA&^<lSPJYDxMro4WECWQEC4Dm+wH`e)aRk zE-4$|u3EL@Zr*8S6W_yWn;(9x@Hw~O?~&><zspmWWxm+O_gtn>M)<hlxt)Q=$9z6X z7+c8ozbUicq_a3TdQS1=w>-19mdPZFCEfqt!7=@G>a|zexoHAzir1og3?s7Bqc>a= zYJ0fp;LDO(s(-cqriTTJtbG4FKm2>&L*u|{ssC3p{(mU#J@sUXZC;!VF!&feUHx3v IIVCg!0D>Z~82|tP literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Flickable.png b/share/qtcreator/qmlicons/Qt/16x16/Flickable.png new file mode 100644 index 0000000000000000000000000000000000000000..963a7afea358303873397bfd01b9088d6b990287 GIT binary patch literal 406 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg4c1|8umE6sz6@jLRdAc};Xq=xq zNqb$3gMjPm1_d_(lU~V_8amMq2b4B&6ue0g$$O%ccxD4X2dAQkNKT``i*@QVN-E~> zaoBnL`@DZ4rcu+DuF{gxP-GFz>{?{v%Y6J**>25(O@7Q7x4%6tx~X4y?)0WRdLN`O zFdX<^yR!4e*D6m*mV<V&BCTu;k1bApu{rOeB7E53PvN0y3X4)BTLh}3qdI=@Dkz=% zxoe&Mx5*7DQ+y@b1dngrvRUW!rku%69VWiMm;WU67@q$;No8l;`u`=H-~ayoH!gJQ zwy!`jjV`%<cBN~jvTceCd+z67FYVOmd;I+KNlSKyl%AKn?0he$>vb?(D3xWf=u@7r vsGHKWHMhFpOyA=<zoj}lrlrnJ+Q+a|VunD};|M`upfPy5`njxgN@xNAIX0mc literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Flipable.png b/share/qtcreator/qmlicons/Qt/16x16/Flipable.png new file mode 100644 index 0000000000000000000000000000000000000000..354f5bd91c30220917b3863200ee6c874c4bd015 GIT binary patch literal 512 zcmV+b0{{JqP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp) z=>Px#24YJ`L;&yr@Br|+4r=ZI000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY- z3?>~Jn-J;%00DqWL_t(I%bk<Gs`5Y(h95PH7_=5*>_kWq!7DKSG}d<U7QBEUxq#e+ zowZ<Z6)!+Rw9rDV>@3s-L6SX{2jv96^PPd0WtiOuX6D_LrfD*h$?(4s$1ze$lyo}H zdcEc^VVWjNQlZ&wqN*ynT#o5<`Vo={h@uF~ve@tUwA*cNw;TC<o<gC(Y&QEhKuU?O z>*%^ptJUIixo|ulIUEi&8V#1q<!8YCe&_LceCMjFVi*R7VX)ine%Hb)03el0{cZ-f zZ37U7;oIY<q?B*>)31r=dGz~zve_(Q7!m{lK@cE>AP54&F#HT~9Ea_8%VaX4UaupB z;Cj7c+cu_YCIWu6AcSB%9y1z^uq=!7`HZ3{bUGc1#Uj4%GoR1tcDu;{$8o6DYQ%BO zU@)LkseIR})hfMS?+uVnnye54-}e~~hq$f_!0B|tbzPz;!t=b(YkW0|=Xop^3s$QY z<#HLvao*QkDwX7Bv-$I9N@<!VUoHGRUzOyCr@jD8E2%D+_~rfp0000<MNUMnLSTaE CUEk9H literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/FocusScope.png b/share/qtcreator/qmlicons/Qt/16x16/FocusScope.png new file mode 100644 index 0000000000000000000000000000000000000000..3a65e43525e391b936ca47531dc5dd382ebe8870 GIT binary patch literal 367 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg4c1|7@`J;=4U4TOGJzX3_EKbjz zWSG}tAmTDVe4)#trHmH~H2DNHP1zUTdcriPqfJ;LV*-DJZM2G;PSctj6Lo&xp0|GH zPqRrHU60s*JYn7Q-QxL&d(1Wbhd-pMOnkm`)ha7htLFvh6f<qJZ%-?f>7D2@E%nu| zK5dQDlQL(W(e>Efb>JsMSf=MBhJ>}T-xuDy&)zrDW!AD+zvroVu6Ql={_o0F%Q81y z3ld@dZ1X?rM%!okpC=9lvqfj7bCmH(zquL{wt@E@&%?7Tn^q^g2o=hlj?#8$ShH3C zwMLi9%b)Ts4c{7NuQnDlM@)N~%bjl?vHa`yo$U4E*J6eEo8)gxuG#;|2k3PMPgg&e IbxsLQ06DgkO8@`> literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/GridView.png b/share/qtcreator/qmlicons/Qt/16x16/GridView.png new file mode 100644 index 0000000000000000000000000000000000000000..011392dc557b73596cde95264b91dff8e2624bfc GIT binary patch literal 320 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg4c1|8uUVX-3U!c$dPZ!4!jq_6{ zY~*b*;BmEI-s9-&=<ax2Psi~ngGfggug1;huC_vlLl)r@Pn8b4epo$U{J%xn6cx@U ztG?!r88@R&pJ6*-bG~AkiEr<YMH+v)GiNcRL_Ry58p$A0zHXJ5&+Tn|*GhGlWl9+y z`>)NA{dU(nu3wiLYwuq@QqNp_KmYbJtzGMO^PiaFWwi7XyMAfeiO+L7uH0U@RVXlW z+N1Ww0@v^#(zo6VG`wf#>wR3o8}m?d$K40IJ&!EXo;}b0%M{^UaN^nt?sTAE7(8A5 KT-G@yGywpRK6)Df literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Image.png b/share/qtcreator/qmlicons/Qt/16x16/Image.png new file mode 100644 index 0000000000000000000000000000000000000000..fc4c7eccc1fc5d76ea874b2adbe4fb501df8d9b9 GIT binary patch literal 579 zcmV-J0=)f+P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY- z3@0<(RxD%y00F~EL_t(I%cYV%uPIR!hM$=^!Q5!{J_-@zFX;RP(P%YV3KETk@GJZQ zQ79F9jY1;PAQGj*M?x^zGkc#x4k72}+?@L)E7{pQ@0)k6y=XKVno`R6Md`I#jgL$w zqXU2V83hQysn_f7*QFMXMwMxre^)7m<2VQ*Fbo5q&xgn3!M1H|+vWpcFc|Q!Os7)- zEXyL9Ox_LNsaC6u$76!QAn|ydVzKxTcRC%;=QFun4xi75{w^+;%PbZPVzC%P2ztF9 zl}hFDem<W$9*+Qcz24UZ&1RGNd`>77LI{Crnna^fX0zENb}pBDoNe2FCYVmA42MGk zfdIGLjqCNw<#NGs9F$U&N~MR;vMd1h`~5RPzuyNy*L7UiMM{b5y14HB$5yM=w?lmx z6bc0<lL_1H7SlAjTrLP9kW%6}4&iVZfP6mB;c&q3_rDqdL?RJ1O=G!Sa=l(jBoY9$ zS}g#w*(}H75!ZFu?RL*a8jVK053}3t(r&l0EQ@qHjS%9cC4kLlgBFX$R4SF?bUGn~ zc&Xd%_O0-X^?H3zU>F8Mh#$AmFbp(JLrRI1^4@|{N(ZRd>ylrfDW&)yJ^?q}6Y0&h Rz^4EJ002ovPDHLkV1lf>_R|0W literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Item.png b/share/qtcreator/qmlicons/Qt/16x16/Item.png new file mode 100644 index 0000000000000000000000000000000000000000..6d1e0f214d5076df6648f36330e8e16dc7460ac6 GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgg4c1|8m&X$`uB7j2cJzX3_EKV<- zxRJNnL4ZX(hLe${V}g@{f<k#hAggc03E5iF`|Lu?3sbn6kL`(k+02`^bawdt?@W62 zdn5u_j-*D~9V^_ErQWbCbJEO{XH+sj+$(2#v`8c4w%Bu-^*YtD*X3<Jg&6j-e|xZM zRamX50F(9eZR~xAW~;Xxn9cn8PgA+9Oyhp5h`P`T&C4>+S#mUn^L?_hf39$PlR`zE r6U&jzS@+JqS+;@a-fumo5;gzt5p!gFRc5#XozCFt>gTe~DWM4fPL^ui literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/ListView.png b/share/qtcreator/qmlicons/Qt/16x16/ListView.png new file mode 100644 index 0000000000000000000000000000000000000000..b2e62ca068f82f81e9f09e778f63f8387f7d2776 GIT binary patch literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^RN= z>}A+1+|+ggD8gCb5n0T@z%2~Ij105pNB{-dOFVsD*>ACP^5_`bFZ#M3D0JD=#WBR< z^xDaWea!|UF6|92j;$`vjV{f13Y#^i-^|i)+~E@R#3V59;XG#r<^8$W6f?pF`;0E> zAOBx@%#Yz~ZT;NmKfU!?PFSkHubpw)#P>eal~UP_t6obvuzP;GryX{1GOLZJ(XkUz z+78EN*sEo~eQb45*&+9~Tl~URS`B|$5`XV!@xAOKJSBCfP>aK{!aJf540vt}%#XH^ z?bkoM{deu<L+RNy_cnZIVEnaK#jA4OdPTj{LVqWivA71h2&Y7D`^WnH&TU1mfLY6) gt9W+IF<v15Jaff#mXMp)K<_bly85}Sb4q9e0HTq9x&QzG literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/MouseArea.png b/share/qtcreator/qmlicons/Qt/16x16/MouseArea.png new file mode 100644 index 0000000000000000000000000000000000000000..b28576ac8772a6ae778ee1ac543be04c1ab5f665 GIT binary patch literal 459 zcmV;+0W|)JP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00001b5ch_0Itp) z=>Px#24YJ`L;&dk=>X}YVy_|q000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY- z3@{7v*AQ#~00B!$L_t(2&yA5ktAbz@#-D3{+#)d?5*k~Zgi>5|Y3b9HQ%m4?X=tsX zIf#O`XlV#qd<8*tGT+emZ3w)Vkgm^k&Ve7#dCvLi_xt#&JkPT%V~lam8Dn(-*XtG4 zq^fGYXeN_M5Cn>%tk>%=j8IfT5KO1j+wEqWW+i}9N(fmj7L-y=)BXoUQH-L95Hg$1 zWLX{z29{-g1Defd9LM+joe(k}kLUBb=XtuWe*nLsYqc5x&Uq9??}_WW05nZIolYeV ztJP|^+X0B<7{GfyLWtuyhGCRAD2kG%X&8pGEWanq<uXmv$K%oIbV>jK&*zg;T9_Dy zaXcQ+=W}^z0F6c?Ns|43zu9cs?RKlx8V-k}(WpE$07;U3-`{Sx0BqZ~EK3lC&nsnF zRy2ph;cukN<&q@H=OcQ(9<Qu!w_9h7sj7;~dI9rY!5C%v9CZKy002ovPDHLkV1hQ; BzC{24 literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/PathView.png b/share/qtcreator/qmlicons/Qt/16x16/PathView.png new file mode 100644 index 0000000000000000000000000000000000000000..23c3a2f5dae22b63da65a3f127c8481dd3377d0e GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^RN= z>}A+1+|+ggD8gCb5n0T@z%2~Ij105pNB{-dOFVsD*>ACP@)$}=mj<K)h0b}pIEGl9 zUOQ=H?qLG~S9?$97>8cAfYn}WC#J?!ayoijxGv+o!x`o5EHLFqj0BfRblI5$>@ns4 z@7K2*H@w>Qk4sVJ%Mym85>tbseih3cU(661>Y6t-l~Y06Q&aWnwM92|KdP+EoVEL4 zqJ*51XH{{N`|WwEH`d<WwXWLp&bGJx&ulriv&sMdyX?j9n!2+Iwm-s|cH5n(7hqYT z(e=jv%RS~8!DX4Z?ri!RaV_d=?SE;-V>5a;BuG2lt9IguWIJbh_Hz!)3CnV$V-s$w bJBUyJ^Gk2lnmrvrpD}p4`njxgN@xNApPqfs literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Rectangle.png b/share/qtcreator/qmlicons/Qt/16x16/Rectangle.png new file mode 100644 index 0000000000000000000000000000000000000000..f6c33cacd7b16f55cce98ba1cf22443762f380ad GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^RN= z>}A+1+|+ggD8gCb5n0T@z%2~Ij105pNB{-dOFVsD*>ACP@))rM$K}@pg>pPy978Nl zzrD0kkXez3^&;yWtNlzb_A7BEI{ezj^ycFYjj!EHWm&ZZKR&5uvrtfAn0l|e=GKHG z_oR)LAC-O)6znmyD2x>k6<V(Hms#lQ-G1hGex{r6uoj<-Nmx6TYs$5#2?6*1e%IIX ce0hNPq<hF34^5X>KzkWHUHx3vIVCg!0Jfz~W&i*H literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/State.png b/share/qtcreator/qmlicons/Qt/16x16/State.png new file mode 100644 index 0000000000000000000000000000000000000000..d400b013aeb020c7a656826ad25c2afd827f9a48 GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfEp{G08LsZ#`5Zu@bDl1aAsXkW25sbRG2l7U#u(Jr<KTJF z%B08RB$tPWM?*xzv`I}z;(w%mYW&~6`doT^NgvO#85Vtur3=mp1~zrn-go~#Ayv|A z;gle+pSgj5#N7BNaztM@ebM=7`@ObB8ZMizZOc8~S^M9Br#*4r^JSScrl)E;SI#qD z`P!;SMM3Ey!-vv#?+rKWl|FXwXHz;PKXHb|bAkSi+=n;mI58+#%sIRvS9-FEZ)-&M z_uBmtQQ5JfSARzDTK701>NWpi6W`}Kk1g1^7#a+pUDVyn;PNW=-K;IM76E<6;OXk; Jvd$@?2>?VSd6WPE literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Text.png b/share/qtcreator/qmlicons/Qt/16x16/Text.png new file mode 100644 index 0000000000000000000000000000000000000000..a49a39c33c6a882f898ead68dc81122f2d0ddf05 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|*pj^6U4S$Y z{B+)352QE?JR*x37`TN&n2}-D90{Nxdx@v7EBh^WP9Agaebd@j1BDViT^vI+&hHI8 z$$P+n<MFJfH~S@;9ptAj>RJ+*vHI6h#SOeGR-NII?%*gFS28lb;hf#OpyN}+7Y@Pe zY;ndh*XQJDp5@uQ_rhnFOY_rZ|Ej(gZhNU66!>o4$C>OQS1%o4G!2zIWGnw?2hc7C MPgg&ebxsLQ0KR=mQvd(} literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/TextEdit.png b/share/qtcreator/qmlicons/Qt/16x16/TextEdit.png new file mode 100644 index 0000000000000000000000000000000000000000..4f41cd9bc5269d0f4eb348e8a0fc25ff44ffbcc9 GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|*pj^6T^QDZ z;FUWmyg(7o0*}aI1_o|n5N2eUHAey{$X?><>&kwMos-8zd)?Kq3xGnEo-U3d8t11@ zJk5JRfycS<g-F{<36nQR6fQ7}y8d0dXR_-C14ECh_jmcDvbSFIb@9@CC$Gp-*e$`v zz>ubx_O7n_#o-CX$GBJhlJX2aUUBVw+wqToFWd|A$~?Q_&!OwfpEFEXQ8zsH?c^O! o&)qM*Ys)VG{U)HWbIVd$<-MU3wk{8=1UiDj)78&qol`;+0ADOw+5i9m literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/TextInput.png b/share/qtcreator/qmlicons/Qt/16x16/TextInput.png new file mode 100644 index 0000000000000000000000000000000000000000..394ac907cf686515d102e0b366fec7665deb920b GIT binary patch literal 327 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6U4S$Y z{B+)352QE?JR*x37`TN&n2}-D90{Nxdx@v7EBh^WP995!?Z=DO0)>uyx;TbdoSr+$ zm#f8qr!~H70k`A!uX=~)r28$5J7jtOL2C?`)4d$G%vC*C*%f(pUrv|LoRy|=`ctd$ z#3P$@0<NBA*z<7j^VrJwGyfVnx=hfT#J~{hx{Yo1ex*q_ID#}D`STo<<(gEW=;%}E zwq(_WRjVv~g@5h4ueWQRv0d2hZ43>&*5&fg>u;}=IL`1v(%pH3_QS4_t3oX|`yU;a zds2C>a-Q$wYnd(2l|@}Q>OVXcQC>Y^*QJNw(*AP<&EgQ0oKq|^(b}wr@yfaj$BUyD RDFeO4;OXk;vd$@?2>?<pdPx8P literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/Qt/16x16/Transition.png b/share/qtcreator/qmlicons/Qt/16x16/Transition.png new file mode 100644 index 0000000000000000000000000000000000000000..86f591ff7bdc287872b1170e1d5c54f3fa639115 GIT binary patch literal 247 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61SBU+%rFB|jKx9jP7LeL$-D$|I14-?iy0WW zg+Z8+Vb&Z8pdfpRr>`sfEp{G0HJuuHlOCW@r>Bc!h{pM?lMeE-C~~;6>Nc#-U=@3L zP%O8FD}`Te-D96?A2<9@`qTJdf$L1pT2uWiQNf|@9b3ab`)R70v={wVSd_c6qelAJ z+>WAihjo_n{CE1n7+Eui)Ao(s$v5)CK0O=Rb2ya_o$(8uz9jYK%mu6d-+wqG!HJ{4 ow14isYIFO~VGImsYQFrmlW&OW*VtU34s;ZQr>mdKI;Vst0A2Z3kN^Mx literal 0 HcmV?d00001 diff --git a/share/qtcreator/qmlicons/QtWebkit/16x16/WebView.png b/share/qtcreator/qmlicons/QtWebkit/16x16/WebView.png new file mode 100644 index 0000000000000000000000000000000000000000..3f61ad0b1c0740c7c671686cffc3ddaf8c6a232f GIT binary patch literal 544 zcmV+*0^j|KP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00001b5ch_0Itp) z=>Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igY- z3_2C@H^qej00E#$L_t(2&y|wF3aUU9hQ~=Avmi1ln6X6)MLQ#Clk1>uZx-|%w(u1~ z+E-8@1Vt1jh-4^DICtT_k*&JlZqE7sIh<iQjB%k*06&nXDPxR>5FQQ(@Ee2>{;M>f z&!^Mr<MCjONs?5pRvpLr6mo&lXe0<iy<YEjyAZ-Sj$PNaENih?ydC&yD~e*8=JWX^ zgb+eRQS9}4f*@Fy^&OZ@CI}(l_m|71EX!dSzFx0dt#&@2bzLtOi{tS)7r0)ps;crl z&-46XFpwmPQVJnN2t`rEaopu{$?b5z-*sIVMG*i%DNWNftA}BDyWIc)Q51deAW2fQ z*;Ew8^SmGkD5aEALP)#aE|p4*vD}1mxqLdER8>U?Z8n?rdadhvr_&*XWOw<#pPQg4 z%4)TulrqNp{eGIJf*{a;c%JuusJ{Wnagrq2Znu<DgixhYX*3#{z1!{LIG)XBnaOFI zc03-l!*Do62(?-*gpe%DK@jZs`y@$R*L{BtplKTWz_xAEG!4Tr48t@{+qOTu7-K*P iVLyX0<}k+KfA|C1&iO@fOdO{G0000<MNUMnLSTa1KjZiS literal 0 HcmV?d00001 diff --git a/src/libs/qmljs/qmljsicons.cpp b/src/libs/qmljs/qmljsicons.cpp index 710e619847f..f423c124466 100644 --- a/src/libs/qmljs/qmljsicons.cpp +++ b/src/libs/qmljs/qmljsicons.cpp @@ -28,17 +28,29 @@ **************************************************************************/ #include "qmljsicons.h" +#include <QtCore/QDebug> +#include <QtCore/QDir> +#include <QtCore/QHash> +#include <QtCore/QPair> using namespace QmlJS; using namespace QmlJS::AST; +enum { + debug = false +}; + namespace QmlJS { +Icons *Icons::m_instance = 0; + class IconsPrivate { public: QIcon elementIcon; QIcon propertyIcon; + QHash<QPair<QString,QString>,QIcon> iconHash; + QString resourcePath; }; } // namespace QmlJS @@ -52,9 +64,55 @@ Icons::Icons() Icons::~Icons() { + m_instance = 0; delete m_d; } +Icons *Icons::instance() +{ + if (!m_instance) + m_instance = new Icons(); + return m_instance; +} + +void Icons::setIconFilesPath(const QString &iconPath) +{ + if (iconPath == m_d->resourcePath) + return; + + m_d->resourcePath = iconPath; + + if (debug) + qDebug() << "QmlJSIcons -" << "parsing" << iconPath; + QDir topDir(iconPath); + foreach (const QFileInfo &subDirInfo, topDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) { + if (debug) + qDebug() << "QmlJSIcons - parsing" << subDirInfo.absoluteFilePath(); + const QString packageName = subDirInfo.fileName(); + QDir subDir(subDirInfo.absoluteFilePath() + QLatin1String("/16x16")); + foreach (const QFileInfo &iconFile, subDir.entryInfoList(QDir::Files)) { + QIcon icon(iconFile.absoluteFilePath()); + if (icon.isNull()) { + if (debug) + qDebug() << "QmlJSIcons - skipping" << iconFile.absoluteFilePath(); + continue; + } + if (debug) + qDebug() << "QmlJSIcons - adding" << packageName << iconFile.baseName() << "icon to database"; + QPair<QString,QString> element(packageName, iconFile.baseName()); + m_d->iconHash.insert(element, icon); + } + } +} + +QIcon Icons::icon(const QString &packageName, const QString typeName) const +{ + QPair<QString,QString> element(packageName, typeName); + if (debug) + qDebug() << "QmlJSIcons - icon for" << packageName << typeName << "requested" << m_d->iconHash.contains(element); + return m_d->iconHash.value(element); +} + QIcon Icons::icon(Node *node) const { if (dynamic_cast<AST::UiObjectDefinition*>(node)) { diff --git a/src/libs/qmljs/qmljsicons.h b/src/libs/qmljs/qmljsicons.h index 783e5ac4d6d..47cec83ef16 100644 --- a/src/libs/qmljs/qmljsicons.h +++ b/src/libs/qmljs/qmljsicons.h @@ -41,14 +41,21 @@ class IconsPrivate; class QMLJS_EXPORT Icons { public: - Icons(); ~Icons(); + static Icons *instance(); + + void setIconFilesPath(const QString &iconPath); + + QIcon icon(const QString &packageName, const QString typeName) const; QIcon icon(AST::Node *node) const; QIcon objectDefinitionIcon() const; QIcon scriptBindingIcon() const; +private: + Icons(); + static Icons *m_instance; IconsPrivate *m_d; }; diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp index b7144f1f30d..7528acd51b2 100644 --- a/src/plugins/qmljseditor/qmljseditor.cpp +++ b/src/plugins/qmljseditor/qmljseditor.cpp @@ -850,7 +850,7 @@ void QmlJSTextEditor::updateOutlineNow() return; } - m_outlineModel->update(document); + m_outlineModel->update(document, snapshot); updateOutlineIndexNow(); } diff --git a/src/plugins/qmljseditor/qmljseditorplugin.cpp b/src/plugins/qmljseditor/qmljseditorplugin.cpp index d55d5b31dcf..944d34ae4ce 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.cpp +++ b/src/plugins/qmljseditor/qmljseditorplugin.cpp @@ -39,6 +39,7 @@ #include "qmljsoutline.h" #include "qmljspreviewrunner.h" #include "qmljsquickfix.h" +#include "qmljs/qmljsicons.h" #include <qmldesigner/qmldesignerconstants.h> @@ -186,6 +187,13 @@ void QmlJSEditorPlugin::extensionsInitialized() { } +ExtensionSystem::IPlugin::ShutdownFlag QmlJSEditorPlugin::aboutToShutdown() +{ + delete QmlJS::Icons::instance(); // delete object held by singleton + + return IPlugin::aboutToShutdown(); +} + void QmlJSEditorPlugin::openPreview() { Core::EditorManager *em = Core::EditorManager::instance(); diff --git a/src/plugins/qmljseditor/qmljseditorplugin.h b/src/plugins/qmljseditor/qmljseditorplugin.h index af6e5f9280c..9fa7ba4a97e 100644 --- a/src/plugins/qmljseditor/qmljseditorplugin.h +++ b/src/plugins/qmljseditor/qmljseditorplugin.h @@ -77,6 +77,7 @@ public: // IPlugin bool initialize(const QStringList &arguments, QString *errorMessage = 0); void extensionsInitialized(); + ShutdownFlag aboutToShutdown(); static QmlJSEditorPlugin *instance() { return m_instance; } diff --git a/src/plugins/qmljseditor/qmloutlinemodel.cpp b/src/plugins/qmljseditor/qmloutlinemodel.cpp index bad1f2b7b3c..0a56622ba11 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.cpp +++ b/src/plugins/qmljseditor/qmloutlinemodel.cpp @@ -1,7 +1,11 @@ #include "qmloutlinemodel.h" #include <qmljs/parser/qmljsastvisitor_p.h> +#include <qmljs/qmljsinterpreter.h> +#include <qmljs/qmljslookupcontext.h> +#include <coreplugin/icore.h> #include <QtCore/QDebug> +#include <QtCore/QTime> #include <typeinfo> using namespace QmlJS; @@ -11,7 +15,8 @@ enum { debug = false }; -namespace { +namespace QmlJSEditor { +namespace Internal { class QmlOutlineModelSync : protected AST::Visitor { @@ -22,14 +27,23 @@ public: { } - void operator()(Document::Ptr doc) + void operator()(Document::Ptr doc, const Snapshot &snapshot) { m_nodeToIndex.clear(); + // Set up lookup context once to do the element type lookup + // + // We're simplifying here by using the root context everywhere + // (empty node list). However, creating the LookupContext is quite expensive (about 3ms), + // and there is AFAIK no way to introduce new type names in a sub-context. + m_context = LookupContext::create(doc, snapshot, QList<AST::Node*>()); + if (debug) qDebug() << "QmlOutlineModel ------"; if (doc && doc->ast()) doc->ast()->accept(this); + + m_context.clear(); } private: @@ -64,7 +78,7 @@ private: } - + typedef QPair<QString,QString> ElementType; bool visit(AST::UiObjectDefinition *objDef) { if (!validElement(objDef)) { @@ -78,8 +92,14 @@ private: + objDef->lastSourceLocation().length; const QString typeName = asString(objDef->qualifiedTypeNameId); - const QString id = getId(objDef); - QModelIndex index = m_model->enterElement(typeName, id, location); + + if (!m_typeToIcon.contains(typeName)) { + m_typeToIcon.insert(typeName, getIcon(objDef)); + } + const QIcon icon = m_typeToIcon.value(typeName); + QString id = getId(objDef); + + QModelIndex index = m_model->enterElement(typeName, id, icon, location); m_nodeToIndex.insert(objDef, index); return true; } @@ -112,10 +132,33 @@ private: } bool validElement(AST::UiObjectDefinition *objDef) { - // For 'Rectangle { id }', id is parsed as UiObjectDefinition ... Filter this out.ctan + // For 'Rectangle { id }', id is parsed as UiObjectDefinition ... Filter this out. return objDef->qualifiedTypeNameId->name->asString().at(0).isUpper(); } + QIcon getIcon(AST::UiObjectDefinition *objDef) { + const QmlJS::Interpreter::Value *value = m_context->evaluate(objDef->qualifiedTypeNameId); + + if (const Interpreter::ObjectValue *objectValue = value->asObjectValue()) { + do { + QString module; + QString typeName; + if (const Interpreter::QmlObjectValue *qmlObjectValue = + dynamic_cast<const Interpreter::QmlObjectValue*>(objectValue)) { + module = qmlObjectValue->packageName(); + } + typeName = objectValue->className(); + + QIcon icon = m_model->m_icons->icon(module, typeName); + if (! icon.isNull()) + return icon; + + objectValue = objectValue->prototype(m_context->context()); + } while (objectValue); + } + return QIcon(); + } + QString getId(AST::UiObjectDefinition *objDef) { QString id; for (AST::UiObjectMemberList *it = objDef->initializer->members; it; it = it->next) { @@ -137,19 +180,19 @@ private: QmlOutlineModel *m_model; + LookupContext::Ptr m_context; + QHash<AST::Node*, QModelIndex> m_nodeToIndex; + QHash<QString, QIcon> m_typeToIcon; int indent; }; - -} // namespace - -namespace QmlJSEditor { -namespace Internal { - QmlOutlineModel::QmlOutlineModel(QObject *parent) : QStandardItemModel(parent) { + m_icons = Icons::instance(); + const QString resourcePath = Core::ICore::instance()->resourcePath(); + QmlJS::Icons::instance()->setIconFilesPath(resourcePath + "/qmlicons"); } QmlJS::Document::Ptr QmlOutlineModel::document() const @@ -157,7 +200,7 @@ QmlJS::Document::Ptr QmlOutlineModel::document() const return m_document; } -void QmlOutlineModel::update(QmlJS::Document::Ptr doc) +void QmlOutlineModel::update(QmlJS::Document::Ptr doc, const QmlJS::Snapshot &snapshot) { m_document = doc; @@ -166,12 +209,12 @@ void QmlOutlineModel::update(QmlJS::Document::Ptr doc) m_currentItem = invisibleRootItem(); QmlOutlineModelSync syncModel(this); - syncModel(doc); + syncModel(doc, snapshot); emit updated(); } -QModelIndex QmlOutlineModel::enterElement(const QString &type, const QString &id, const AST::SourceLocation &sourceLocation) +QModelIndex QmlOutlineModel::enterElement(const QString &type, const QString &id, const QIcon &icon, const AST::SourceLocation &sourceLocation) { QStandardItem *item = enterNode(sourceLocation); if (!id.isEmpty()) { @@ -179,8 +222,8 @@ QModelIndex QmlOutlineModel::enterElement(const QString &type, const QString &id } else { item->setText(type); } + item->setIcon(icon); item->setToolTip(type); - item->setIcon(m_icons.objectDefinitionIcon()); return item->index(); } @@ -193,7 +236,7 @@ QModelIndex QmlOutlineModel::enterProperty(const QString &name, const AST::Sourc { QStandardItem *item = enterNode(sourceLocation); item->setText(name); - item->setIcon(m_icons.scriptBindingIcon()); + item->setIcon(m_icons->scriptBindingIcon()); return item->index(); } diff --git a/src/plugins/qmljseditor/qmloutlinemodel.h b/src/plugins/qmljseditor/qmloutlinemodel.h index f2e914a36c7..dbc3e7f217b 100644 --- a/src/plugins/qmljseditor/qmloutlinemodel.h +++ b/src/plugins/qmljseditor/qmloutlinemodel.h @@ -20,9 +20,9 @@ public: QmlOutlineModel(QObject *parent = 0); QmlJS::Document::Ptr document() const; - void update(QmlJS::Document::Ptr doc); + void update(QmlJS::Document::Ptr doc, const QmlJS::Snapshot &snapshot); - QModelIndex enterElement(const QString &typeName, const QString &id, const QmlJS::AST::SourceLocation &location); + QModelIndex enterElement(const QString &typeName, const QString &id, const QIcon &icon, const QmlJS::AST::SourceLocation &location); void leaveElement(); QModelIndex enterProperty(const QString &name, const QmlJS::AST::SourceLocation &location); @@ -40,7 +40,9 @@ private: QmlJS::Document::Ptr m_document; QList<int> m_treePos; QStandardItem *m_currentItem; - QmlJS::Icons m_icons; + QmlJS::Icons *m_icons; + + friend class QmlOutlineModelSync; }; } // namespace Internal -- GitLab