From 58ab977ad48e4534d5a5fa88819b0d765b421887 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Mon, 12 Aug 2019 11:50:45 +0200 Subject: [PATCH 01/14] QmlDesigner: Use backspace on Mac instead of delete This is what most users expect. Task-number: QDS-823 Change-Id: I3955d1afcdc6686d8d0f0150e335f453bd253633 Reviewed-by: Brook Cronin Reviewed-by: Knud Dollereder Reviewed-by: Thomas Hartmann --- .../components/curveeditor/curveeditorstyle.h | 6 +++++- .../timelineeditor/timelinegraphicsscene.cpp | 20 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h index 5a294e9aa0a..0ea44f27385 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h @@ -27,6 +27,8 @@ #include "detail/shortcut.h" +#include + #include #include #include @@ -87,7 +89,9 @@ struct Shortcuts Shortcut frameAll = Shortcut(Qt::NoModifier, Qt::Key_A); Shortcut insertKeyframe = Shortcut(Qt::MiddleButton, Qt::NoModifier); - Shortcut deleteKeyframe = Shortcut(Qt::NoModifier, Qt::Key_Delete); + + Shortcut deleteKeyframe = Utils::HostOsInfo::isMacHost() ? + Shortcut(Qt::NoModifier, Qt::Key_Backspace) : Shortcut(Qt::NoModifier, Qt::Key_Delete); }; struct CurveEditorStyle diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp index 99cc4867101..97ebb7e84d0 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp @@ -55,6 +55,8 @@ #include #include +#include + #include #include #include @@ -66,6 +68,14 @@ namespace QmlDesigner { +static int deleteKey() +{ + if (Utils::HostOsInfo::isMacHost()) + return Qt::Key_Backspace; + + return Qt::Key_Delete; +} + QList allTimelineFrames(const QmlTimeline &timeline) { QList returnList; @@ -566,14 +576,8 @@ void TimelineGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent) return; } - switch (keyEvent->key()) { - case Qt::Key_Delete: + if (deleteKey() == keyEvent->key()) handleKeyframeDeletion(); - break; - - default: - break; - } QGraphicsScene::keyReleaseEvent(keyEvent); } @@ -706,7 +710,7 @@ bool TimelineGraphicsScene::event(QEvent *event) { switch (event->type()) { case QEvent::ShortcutOverride: - if (static_cast(event)->key() == Qt::Key_Delete) { + if (static_cast(event)->key() == deleteKey()) { QGraphicsScene::keyPressEvent(static_cast(event)); event->accept(); return true; From 1f4176275ebf05de8024ff38cde781f22d135faf Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 8 Aug 2019 14:37:24 +0200 Subject: [PATCH 02/14] RemoteLinux: Fix tar packaging for long file paths Contrary to what we assumed, long file paths cannot be split up arbitrarily, but only at separators. Fixes: QTCREATORBUG-22815 Change-Id: Id13036f3d73cc5d6b272066c0f8a26d9748ce6b8 Reviewed-by: hjk --- .../remotelinux/tarpackagecreationstep.cpp | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/plugins/remotelinux/tarpackagecreationstep.cpp b/src/plugins/remotelinux/tarpackagecreationstep.cpp index 26ac446028c..67302cf3c62 100644 --- a/src/plugins/remotelinux/tarpackagecreationstep.cpp +++ b/src/plugins/remotelinux/tarpackagecreationstep.cpp @@ -228,24 +228,35 @@ bool TarPackageCreationStep::appendFile(QFile &tarFile, const QFileInfo &fileInf return true; } +static bool setFilePath(TarFileHeader &header, const QByteArray &filePath) +{ + if (filePath.length() <= int(sizeof header.fileName)) { + std::memcpy(&header.fileName, filePath.data(), filePath.length()); + return true; + } + int sepIndex = filePath.indexOf('/'); + while (sepIndex != -1) { + const int fileNamePart = filePath.length() - sepIndex; + if (sepIndex <= int(sizeof header.fileNamePrefix) + && fileNamePart <= int(sizeof header.fileName)) { + std::memcpy(&header.fileNamePrefix, filePath.data(), sepIndex); + std::memcpy(&header.fileName, filePath.data() + sepIndex + 1, fileNamePart); + return true; + } + sepIndex = filePath.indexOf('/', sepIndex + 1); + } + return false; +} + bool TarPackageCreationStep::writeHeader(QFile &tarFile, const QFileInfo &fileInfo, const QString &remoteFilePath) { TarFileHeader header; std::memset(&header, '\0', sizeof header); - const QByteArray &filePath = remoteFilePath.toUtf8(); - const int maxFilePathLength = sizeof header.fileNamePrefix + sizeof header.fileName; - if (filePath.count() > maxFilePathLength) { - raiseError(tr("Cannot add file \"%1\" to tar-archive: path too long.") - .arg(QDir::toNativeSeparators(remoteFilePath))); + if (!setFilePath(header, remoteFilePath.toUtf8())) { + raiseError(tr("Cannot add file \"%1\" to tar-archive: path too long.").arg(remoteFilePath)); return false; } - - const int fileNameBytesToWrite = qMin(filePath.length(), sizeof header.fileName); - const int fileNameOffset = filePath.length() - fileNameBytesToWrite; - std::memcpy(&header.fileName, filePath.data() + fileNameOffset, fileNameBytesToWrite); - if (fileNameOffset > 0) - std::memcpy(&header.fileNamePrefix, filePath.data(), fileNameOffset); int permissions = (0400 * fileInfo.permission(QFile::ReadOwner)) | (0200 * fileInfo.permission(QFile::WriteOwner)) | (0100 * fileInfo.permission(QFile::ExeOwner)) From 3046c83f85d037d5686e625f615a1a45f675ed87 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 13 Aug 2019 13:02:40 +0200 Subject: [PATCH 03/14] ProjectExplorer: Consider more compiler flags when collecting includes The -nostdinc and -nostdinc++ options must not get filtered out when constructing the compiler command line for collecting include paths. Fixes: QTCREATORBUG-22760 Change-Id: I6bb10024f39869d5ef546968eb13d07d39c985ae Reviewed-by: hjk --- src/plugins/projectexplorer/gcctoolchain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index e9c683e21d3..dd24b8755d1 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -531,7 +531,8 @@ QStringList GccToolChain::gccPrepareArguments(const QStringList &flags, const QString &flag = allFlags.at(i); if (flag.startsWith("-stdlib=") || flag.startsWith("--gcc-toolchain=") || flag.startsWith("-B") || flag.startsWith("--target=") - || (flag.startsWith("-isystem") && flag.length() > 8)) { + || (flag.startsWith("-isystem") && flag.length() > 8) + || flag == "-nostdinc" || flag == "-nostdinc++") { arguments << flag; } else if ((flag == "-target" || flag == "-gcc-toolchain" || flag == "-isystem" || flag == "-arch") From b6070995e055bc861ebed3cf647cf73bdaaf599e Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 13 Aug 2019 15:21:12 +0200 Subject: [PATCH 04/14] QmlDesigner: Add icons to curve editor Change-Id: I77f9b28f8cfe04022571d9c0cc092b9206c4df60 Reviewed-by: Alessandro Portale --- .../components/curveeditor/curveeditor.cpp | 12 +++++------ .../components/curveeditor/curveeditor.pri | 3 +++ .../components/curveeditor/curveeditor.qrc | 20 ++++++++++++++++++ .../components/curveeditor/curveeditorstyle.h | 8 +++---- .../images/tangetToolsLinearIcon.png | Bin 0 -> 233 bytes .../images/tangetToolsLinearIcon@2x.png | Bin 0 -> 383 bytes .../images/tangetToolsSplineIcon.png | Bin 0 -> 463 bytes .../images/tangetToolsSplineIcon@2x.png | Bin 0 -> 902 bytes .../images/tangetToolsStepIcon.png | Bin 0 -> 168 bytes .../images/tangetToolsStepIcon@2x.png | Bin 0 -> 252 bytes .../curveeditor/images/treeview_eye.png | Bin 0 -> 218 bytes .../curveeditor/images/treeview_eye@2x.png | Bin 0 -> 946 bytes .../curveeditor/images/treeview_lock.png | Bin 0 -> 237 bytes .../curveeditor/images/treeview_lock@2x.png | Bin 0 -> 909 bytes .../curveeditor/images/treeview_pin.png | Bin 0 -> 278 bytes .../curveeditor/images/treeview_pin@2x.png | Bin 0 -> 1223 bytes .../curveeditor/images/treeview_unlock.png | Bin 0 -> 233 bytes .../curveeditor/images/treeview_unlock@2x.png | Bin 0 -> 354 bytes .../curveeditor/images/treeview_unpin.png | Bin 0 -> 245 bytes .../curveeditor/images/treeview_unpin@2x.png | Bin 0 -> 1160 bytes 20 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_lock.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_lock@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_pin@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.png create mode 100644 src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.png diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp index 2a1ee1c5c7c..d06ea3c4957 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditor.cpp @@ -42,12 +42,12 @@ CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent) , m_tree(new TreeView(model, this)) , m_view(new GraphicsView(model)) { - QSplitter *splitter = new QSplitter; + auto *splitter = new QSplitter; splitter->addWidget(m_tree); splitter->addWidget(m_view); splitter->setStretchFactor(1, 2); - QVBoxLayout *box = new QVBoxLayout; + auto *box = new QVBoxLayout; box->addWidget(createToolBar()); box->addWidget(splitter); setLayout(box); @@ -72,12 +72,12 @@ void CurveEditor::clearCanvas() QToolBar *CurveEditor::createToolBar() { - QToolBar *bar = new QToolBar; + auto *bar = new QToolBar; bar->setFloatable(false); - QAction *tangentLinearAction = bar->addAction("Linear"); - QAction *tangentStepAction = bar->addAction("Step"); - QAction *tangentSplineAction = bar->addAction("Spline"); + QAction *tangentLinearAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsLinearIcon.png"), "Linear"); + QAction *tangentStepAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsStepIcon.png"), "Step"); + QAction *tangentSplineAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsSplineIcon.png"), "Spline"); QAction *tangentDefaultAction = bar->addAction("Set Default"); auto setLinearInterpolation = [this]() { diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri b/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri index 83896f04fc7..cd377aa2ced 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditor.pri @@ -44,3 +44,6 @@ SOURCES += \ $$PWD/detail/utils.cpp \ $$PWD/keyframe.cpp \ $$PWD/treeitem.cpp + + RESOURCES += \ + $$PWD/curveeditor.qrc diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc b/src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc new file mode 100644 index 00000000000..2f553722601 --- /dev/null +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditor.qrc @@ -0,0 +1,20 @@ + + + images/tangetToolsSplineIcon.png + images/tangetToolsSplineIcon@2x.png + images/tangetToolsLinearIcon.png + images/tangetToolsLinearIcon@2x.png + images/tangetToolsStepIcon.png + images/tangetToolsStepIcon@2x.png + images/treeview_eye.png + images/treeview_eye@2x.png + images/treeview_pin.png + images/treeview_pin@2x.png + images/treeview_unpin.png + images/treeview_unpin@2x.png + images/treeview_unlock@2x.png + images/treeview_lock.png + images/treeview_lock@2x.png + images/treeview_unlock.png + + diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h index 0ea44f27385..43e10bcd4c8 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h @@ -41,10 +41,10 @@ namespace DesignTools { struct TreeItemStyleOption { double margins; - QIcon pinnedIcon = QIcon(":/ICON_PINNED"); - QIcon unpinnedIcon = QIcon(":/ICON_UNPINNED"); - QIcon lockedIcon = QIcon(":/ICON_LOCKED"); - QIcon unlockedIcon = QIcon(":/ICON_UNLOCKED"); + QIcon pinnedIcon = QIcon(":/curveeditor/images/treeview_pin.png"); + QIcon unpinnedIcon = QIcon(":/curveeditor/images/treeview_unpin.png"); + QIcon lockedIcon = QIcon(":/curveeditor/images/treeview_lock.png"); + QIcon unlockedIcon = QIcon(":/curveeditor/images/treeview_unlock.png"); }; struct HandleItemStyleOption diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..a21c69eb4f2980e2e24c15f453acffbf3af8dddd GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4rT@h1`S>QUau^`+F|!&PQAsGuVwYB{H8rRdMeo$TetJtd}rcU-Yc8V Qz`(%Z>FVdQ&MBb@0IxP|761SM literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsLinearIcon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..09a3c0d0062e55609c8b51a68ac6e7cf2814ed7d GIT binary patch literal 383 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4rT@h2A3sW#~2tGssnsNTp1V`{)55#b?g5B z|G$3SItYTZH*easal?l7>(*`Cx^?}!bz3%XhA4oj|NsC0r;i{1|NsB_^Jlo0_3PF_ zxL>|}fh$I4Y~8Zu|NsA75n3Q;sFeiy1vBuADywMd=;|6TU$uVo<}KTH?%H$m?1jrW zpFDl`{Ke~cA3lEm_Vag++MnGF3=F-VE{-7<{#P&U7HTpOalNR~)TG2@_mQzBkYrM*ag{0qg-D o6Zja+CLUNawfyPqe~;rNy@hinGTE~k7#J8lUHx3vIVCg!07=@)uK)l5 literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsSplineIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..73b97dca43047eacf5594d6f08434cd1dfc72089 GIT binary patch literal 463 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7r+Kt`bGZN1Q>+7I`wecH9mTo76kyP-VMFNtueb z#|1|YMR5zK$#-3|%hr6Iajw2}-TgT;Eq%1le=EQBw)BCr0JC(WNNG&j^1FPEY5{C! zhc&XMa{aVjz-Dvq?e8tqpJ)F}>|uCX6uBmLWr*CJ%RY8a0rhL>g>KESt!}k^(BGl5^FL!m z@KtqTmK{t-SpS?~m)ETHiTMWmHnm$1fJ zuwLLhz-qv}{*eblFZ`EFGsZ9%FgUOrFlbme<#EsNI41`6dPWD<6_E_On#X7I z_(zJQTQ^K+$YK&<%=ql;(vtq~bo0rBja4nCGPZ3`9^BYlcU)ybY(&_xwOW0i4ca=| zkHbXWIXZ5At2Ue?*nQNFE7^k0Su#N-#6fA|kKD*m7f^WL8X(V)(%2VA^1; zGbsV?MJY?X{C7qy3JxrfreON*OE}+B;VSZV;+_dGrw<*N5%#vVxtgkDWEY zG9IXXSJuTSRGKqWQ`13nDf^kv)`^Qbf_v=V$*L~WZPGoK_O4b}v*BasZQmwMF>AJj zhV9o<4HrmQ?@*UBR%49cu~xk2i0d{P6N&TwwIOuCm#oL>R|0YQf3^X+YZDVuM4v*w>XIJdW#Us_7)-KVn=%cq=@ zWPS03!Hu`QwJhh^ZQq8DlBH@!#l@zJ7ccH!_gYLh?)0Wv6JsoE zxuas*Ozrlde|HZ_i5#fc%KbAd_L21;&4ya-pVGhL|C@3#)H7&*6H=Y&$&|vtz`)?? L>gTe~DWM4fq3MhW literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..0fed893c7e11cca578b07632c9a5956dd14e232d GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd7G?$phPQVgfdmu-d_r6q7#P;CTZapM|Nec- zJjNXi3=EtlL4LsujJ|>4&tATMSMer%4g&*&uBVG*2uE~sf&-J>QGr<-i*Kz8<#t$e wYGr`tW(AFAZZBnt0*5w{>#IUn2e2@#VPaoZ)G2$9fq{X+)78&qol`;+0CL|wi2wiq literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/tangetToolsStepIcon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..682985785c3fe30511ffd82a3d3474555ab96f32 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4rT@h2A3sW#~2tGYyx~jTp1V`)~{Pf2KxT} z`_Gy2+zbp1LM1_d!3>Pb8rnuHH*DXv`|Z0AAHV(low4E4ZUzR1SWg$n5R22v2@CWR zo{ES(NI0l`UY~`f=8T1C0cRuQZUdPGr;NFrL_RzUI-tN1c%b<*7heaH*&MEj9}b`H z`0Utw@XWc>hmW=BD;Uf%W#H0aU%XEuBA#P0Ly<@T2ZQk%j=7FIc_bJZ7#KWV{an^L HB{Ts5mFQ`@ literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye.png new file mode 100644 index 0000000000000000000000000000000000000000..b65141f7e56f5d171e7af4cf87e0449d7955d41b GIT binary patch literal 218 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}3q4&NLn2z=PPxt5Vj$qk zAGSet35)j)p=~X1PXy^46w)~;bd4{jMevA?OE1e4xgGX1(R@}`xbUy*;sFz z|AXa^81KrNEA~wN)01u_x3@{}L3t%#7vIBOomXs*OnEA)C-S%Bn#k|2R)I$c8R{#4 Xw{t#STeg6Kfq}u()z4*}Q$iB}jD%VI literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_eye@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..54bb4339a57532a82b858e2913cfda39fcaadd91 GIT binary patch literal 946 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4rT@hhPm4t-!L#RW(W9$xH60adWFFM|98GH zFfde<1o;IsFfy~Ub8z$U^6?7@3JHsfOGwGe$!lus=o?#FS=-q=I61qxdwTi$2Zuz) zrln`)7nGD&RM*xuwzjo*cK1%0IA!YWx$_sSShs2OmTkND?LTnn$k7vL&Rw{8>GGB9 zH*Vg#edq4I2aldSeg690`;VVKfBp9T$IoBC|NQ-46*7Z?fw9ih#W5t}aB_kK>*55F zo~FPCeuIsjT9P||xTT~tI=Z#2@18hGLt6ME+lQ`|k{0YLDd7%|Wljy78)r%AZ~Vo2 zRcFtk;NnwS4;JXCo8CF?6xyKi_RXVPehXbiB^GF0@pPXwc|)CEWbpeZOKI0+|`pE}hx2VZ)9yK@$5_&bZB#-e2dZx_pMsj$bbR+O@UX=a&f0@JL)U zS;#Klph)A^(F1d1=Db*@t*oT9__b8~hoGLhLUQIDCoPVMAD%L8`OfUF4b04;E{9DS z-?creP*=V4a6zhEE63(N4$6Tmc2?O%a(tACc8wF0VcWr~>>59-+sfKyhU-B)NyRvs zOx>gXhZ|nlEQ#peJSDA}!?;^odFPr%SE7AeT$ojS7EM(7WE;}r`I%|;rev;3;!bB& zetK}bBs%|(S>mu|(&IEmT`AMMmrqYzBrnPWN(3=D~$E{-7@6O$7bC|}s~Jx|DJ{@Z)I%kzaN zu;kp|d++-@qe%z$nKSh~k5l~7^Ip%$;KV-R2JQ`evJ(;>)I4uc2{>@zK%d@$CY1wR vfsGr=?^+vF@QPQkvo`xZkZJkf)|kh@uvsBD-_qfqCCJ&Hu6{1-oD!M?qMT zKa7v*)IwLmz+{_6ohv>H`0n^{jJvniV~=5tNCn3oR=0-74(?07)n9U0zvozo=?cSVjj9U-Di=9E`qbcjfcJr2 zfwV-|l^aRE^K-*yMw+>o%1+$AMD@Uu_e%xZ*}r71wP$#DLSQ=Y1N9Hi?_wt`%=0nw zUgZDPSLcUn{)e`FeuHCtySzT&wbuUY_%QSHkaPeG=FE!W;6A7_#^EPF4_Csb%SHP>6g)|#vvd(zg5#P~89bMFZ+`kdOncFh8-{D#7#9gE&=)n5N%y?{Y^ zXv3DC^H#tAbfwkDyo=SftUTNzsvdCr@2k_NZ`4*hEH^e@ZB&!iKC@gi>-6l6MXf@z z)fbty0$>UKiV>yl#C)u34t#X=Yo5bxto`t-5~ZdXvkqP4!lG{rJ-0$ExwWW@3=M z?zzTvb*nA!`B&W)%00#Zt7dL;jf&G@D~4VT<~Q5kZ9P35C6E+>Vv}Pv9z6FhX7S+GXro=5vQFU1T>e<@2ADe?7x!>M0 znL~f-y*#y=rzLtfN|%YenIx7FeD8vQUDJZue^osX8=h%r*qv%)ckI10!+U+L$#1Mr z`V{yJv2;u^k#ubE@SH4&&a`9cc#?|Me z>hg8E`?nvO{7a_ePUrMFSIc3^U4SEm{{z2$=cAO_@6YlwFfcH9y85}Sb4q9e0OZx1 Ay#N3J literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_pin.png new file mode 100644 index 0000000000000000000000000000000000000000..5dc71ad902c385fb0614f1276010af9e65838c78 GIT binary patch literal 278 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I7G?$phQ^Te;|vT81_3@Ht_&oCD0>-h1_lQH zk|4ie1_1+yfP{jE{`u?opTGb9tHM$_1_p*UPZ!4!jfu$#3-mkYH=IiU^W4b zX*0Sv?vQ!v zC~aWB!5zc6>D=z53n97O-WT|En5HqjXOKPc-=RNlKl7jPnyynGSFhYTS;8dU_`Y%N zC$=xQTV}G^OyuaFQ|`VbjwOS!s!{epSwh^sy=Z zyX9MC(|&zxiQ-OZJI7|G{b4O@)Z9S*Os_-2S-J;wT>qX|JrsSe<7CD6mME@-)&K1_ z2>*x(+<#N@>7%Q{S(*o89ymXcPT(~-Ecvl&Po>jZmJPN090lt)KXO>=^OQ4_Gtg|S zSIe2N_LE;vzxDm7NA|iqD+@zsCg1$w*Lpc>V%gfFJb!z(V^0dVWyxzkyczLqpMLAo zb7&!1&$dQC?$)(+!6isWJSvHYSCj8!}EKbH*ea;YLt^G z$+Tx}weGy0^B+yT7K(&7lsEc|o~{1W6!cJR#`4?=m$XFFstP69|1q$wQf!bkjMdI` zd=s58+3WiCi%}|vyPGBJybrz?F^JG*eDf!EeZsbFEgwA-)BmeJ&?pf4!Mh`zm$As_ z#MISuy=Oe!epSYjSB9;Qscp{0RDrLD)2Ei2YIeR1bDL%oDOtyJgH?v5ZoSFRlj>dU z5nE(KFJy*1*xa%2+~bX59hJB350oz8w^(Rfe_1k8vGDHqMxi-djCL(aI=CR_ZdEh; zmizxp-CPyk8Cop6ve~!MaH-6JcJ&_Z@(pj^^{~9?F1jLm*quT8GW%Zj@VDQdaGIst ze_;Ng{9*OBgDu8JZ2OdUbQXwLXspi)jp>k*n1AZ1|H&V9M`hO^leWul0lC%n!Gnpz7TF89h(iU~_Idv!;5J}2kR2@g(wV!F??Bn zf6b-H9v9;zIU=PQ1ff=lJNT-N(X}Ge!qQ%Y5%fw zX9PJ5Z&x0_lJY6(kg~0++wx>_Yt_^RiWUekd*0S?&-PUEt=3G1~IZZv~b5+%I zl_lHP9~4nOwRq#*qT8pVzRurz|M8COc0Z9T_gC-OEj@LGADF5157T#yl!#U|?YIboFyt=akR{0Oue^+yDRo literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock.png new file mode 100644 index 0000000000000000000000000000000000000000..b653b0c246a370181bb59517425f486b1e4eb2fd GIT binary patch literal 233 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I7G?$phQ^Te;|vT8x&b~Rt_-Arg9|k57#JA% zN`m}?83Ysz90C#=`sc6TfByb*(Qge53=FZJE{-7@=aUl_$bP8$o@Zn<|E;WmiUQ}6 zy}RRnztfy_VDEGup3nD`ew=yFXJAmU-?)K$!yfH~goOI%4O$1bI5C7WNN(7d?I3FL sosZ|<0oHqt2Nwt*D9}_1ka)qt5K@-acWv$g7m$-ZUHx3vIVCg!0Ho+bL;wH) literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unlock@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2563d5cc64b621a28d82a4c003cc0243e45ac03b GIT binary patch literal 354 zcmeAS@N?(olHy`uVBq!ia0y~yU~pt$U~phzW?*30-pYQNfq}swz$e6&fkY5xFT>5i zz`$P;;57_}kue+(N{l@y(B7xs-mUGSNE@JJ<5?Ty)4{E))It z|9?I6#h(FE!f*cnmwyvzwjee_)ZpL$|H6l6{r_(t*1qA-|NoMQF11Uw@mc))U(b;E z@$dip4bDf|b}Z*uk?{Bbd4~O5Y@%=GJv|^9a3$p6*Z==r_i(NGr`%lMZ5VpTJ@Dgy z^KB81tTRrwFW_pMxYns*0av@AT+;hM(LYB+1iM!~;<}fjZ?x#ugoB(6{r~naT77rl Qa!^=#y85}Sb4q9e0O7%fQUCw| literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin.png new file mode 100644 index 0000000000000000000000000000000000000000..7a0e4264fabe51f25a4dc242671e6a3ade4b7e80 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I7G?$phQ^Te;|vT8x&b~Rt_-Arg9|k57#J8B zOM?7@862M7NMm4NDD!l243UuBd+;D{lLG_8!CEO+uB{x!Q-6F-UvVI!aU;{C^TMgw z0xo+FGtEdeO#c`1Y8b4?7AQ`T|mJm)oF_A`l%&F}>|-_zC4Wt~$( F699+WN?!l~ literal 0 HcmV?d00001 diff --git a/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.png b/src/plugins/qmldesigner/components/curveeditor/images/treeview_unpin@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..396f6ce7616a464e2837375d99a55ec3dfe8ad3f GIT binary patch literal 1160 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hE~)opsw^CRO5C zz0L;iryIDpEM<+UTDMlJKX*}imdye+sr*0Ud#`EtcKYtQxWq8s8j%Udam>=jA@ZVr5Gg`Np zVM+tzf|rFV5-&dO3VdKxaQv)3<5r&660CmJ`nHr;3U&?l@?gaQ=bmisv->aL~2wihlT`+UfPtJrxYYd)byQ->iRdQDF?x;JFZ?5{5 zZ$pL~$0~uWqe>q-Ri-qqnt$H=Kz8q;1-*WdWd+2Z$GcO?V_#jLG|y8jcapvU5kCd{y;j}@dB5}2kQ^5*Y+nYyuw?i zx@Dg8;?fmYKDjt&>!#=QecKa$_;Y((L*eRO-nyUOi*)Wbkq_`?d(QOuz~=+I&CJq` z)@6r;YuWQS7AS>2)V-lP%}A?QUzEA5hkNUucGXIO0MF7=?)H$1xvLf==^DOGm#*aZ z-lSK;QNdMl_}sg!zE!WT^GlAWa&ho#8CI@it;S{Zgm)d@ zn-`m;usHNvmF-5$0}PvwwQ4>-BJyD_W6?{EBnP3EUuXVLwk>OHzGnB3W!0=M;rQ>f z8kVWP>bi8>%syXgMwXUx?Afb6iM=5z=et|FHn(YpeoS0$bgpTU*bLM7^O5Xlq&FP< zb8pq%*ueX96aQB_&AYLUeWjc#A8Q5>`PfYfh(w`q;< zdpVCz3%RNvX#e}?*(>Fn64-yV{{8uI<2h!jsOqh~?|r3h^wVXkuipLh{7wI}zFeg% zoRcE|ZIhg>zU`W_!wQnzwb5v=!Isb|;6+Tt(rc zbGBU6{BrBlLV*eAxT4cqU)9DamY;5SJK&eKqtHu~XL-n{ Date: Tue, 13 Aug 2019 16:07:53 +0200 Subject: [PATCH 05/14] Improve scene to view fitting Change-Id: Ib665c37db491d2af90f27a99f6b1c2d6f09b9df2 Reviewed-by: Thomas Hartmann --- .../curveeditor/detail/curveitem.cpp | 20 +++++++++++-------- .../curveeditor/detail/graphicsscene.cpp | 2 +- .../curveeditor/detail/graphicsview.cpp | 7 ++++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp index b327e18c01f..e1317265ff9 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp @@ -85,13 +85,19 @@ int CurveItem::type() const QRectF CurveItem::boundingRect() const { + if (m_keyframes.empty()) + return QRectF(); + auto bbox = [](QRectF &bounds, const Keyframe &frame) { grow(bounds, frame.position()); - grow(bounds, frame.leftHandle()); - grow(bounds, frame.rightHandle()); + if (frame.hasLeftHandle()) + grow(bounds, frame.leftHandle()); + if (frame.hasRightHandle()) + grow(bounds, frame.rightHandle()); }; - QRectF bounds; + QPointF init = m_keyframes[0]->keyframe().position(); + QRectF bounds(init, init); for (auto *item : m_keyframes) bbox(bounds, item->keyframe()); @@ -213,11 +219,9 @@ std::vector CurveItem::curves() const if (tmp.size() >= 2) out.push_back(AnimationCurve(tmp)); - out.push_back( - AnimationCurve( - current.data().value(), - previous.position(), - current.position())); + out.push_back(AnimationCurve(current.data().value(), + previous.position(), + current.position())); tmp.clear(); tmp.push_back(current); diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp index cf88397a46d..14a7399bfe6 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp @@ -142,7 +142,7 @@ void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) for (auto *item : itemList) { if (auto *curveItem = qgraphicsitem_cast(item)) { - // CurveItems might becom invalid after a keyframe-drag operation. + // CurveItems might become invalid after a keyframe-drag operation. curveItem->restore(); if (curveItem->contains(mouseEvent->scenePos())) diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp index bfa836137f7..94b53a3ea55 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp @@ -378,13 +378,16 @@ void GraphicsView::applyZoom(double x, double y, const QPoint &pivot) double minTime = minimumTime(); double maxTime = maximumTime(); + double minValue = minimumValue(); + double maxValue = maximumValue(); + QRectF canvas = canvasRect(); double xZoomedOut = canvas.width() / (maxTime - minTime); double xZoomedIn = m_style.zoomInWidth; double scaleX = lerp(clamp(m_zoomX, 0.0, 1.0), xZoomedOut, xZoomedIn); - double yZoomedOut = canvas.height() / maximumValue(); + double yZoomedOut = canvas.height() / (maxValue - minValue); double yZoomedIn = m_style.zoomInHeight; double scaleY = lerp(clamp(m_zoomY, 0.0, 1.0), -yZoomedOut, -yZoomedIn); @@ -480,8 +483,6 @@ void GraphicsView::drawExtremaY(QPainter *painter, const QRectF &rect) drawHorizontalLine(mapValueToY(m_scene.minimumValue())); drawHorizontalLine(mapValueToY(m_scene.maximumValue())); - drawHorizontalLine(mapValueToY(0.0)); - painter->restore(); } From b7bc7c25f5c620b3470b5e76cbd581c06361b6b8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Tue, 13 Aug 2019 17:11:36 +0200 Subject: [PATCH 06/14] StudioWelcome: Always check for community edition Change-Id: I9dc9bfc022c2611cb6bb9dc47820368e17d561e4 Reviewed-by: Tim Jenssen --- src/plugins/studiowelcome/studiowelcomeplugin.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/plugins/studiowelcome/studiowelcomeplugin.cpp b/src/plugins/studiowelcome/studiowelcomeplugin.cpp index c7db6969d2c..4cd6d357018 100644 --- a/src/plugins/studiowelcome/studiowelcomeplugin.cpp +++ b/src/plugins/studiowelcome/studiowelcomeplugin.cpp @@ -32,6 +32,9 @@ #include #include +#include +#include + #include #include #include @@ -127,11 +130,10 @@ ProjectModel::ProjectModel(QObject *parent) this, &ProjectModel::resetProjects); -#ifdef LICENSECHECKER + if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(), - Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker")))) + Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker")))) m_communityVersion = true; -#endif } int ProjectModel::rowCount(const QModelIndex &) const From d877a391240c9e54791804189b28ecb6a4fc9f52 Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Tue, 13 Aug 2019 17:19:34 +0200 Subject: [PATCH 07/14] Set dark style Change-Id: I194a7bb4f20dcecf3a4c3e783789a730a3ae89cc Reviewed-by: Thomas Hartmann --- .../curveeditor/detail/graphicsscene.cpp | 4 +++- .../curveeditor/detail/graphicsview.cpp | 4 ++-- .../curveeditor/detail/graphicsview.h | 2 ++ .../animationcurveeditormodel.cpp | 18 +++++++++++------- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp index 14a7399bfe6..4cea35e098c 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp @@ -141,7 +141,6 @@ void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) const auto itemList = items(); for (auto *item : itemList) { if (auto *curveItem = qgraphicsitem_cast(item)) { - // CurveItems might become invalid after a keyframe-drag operation. curveItem->restore(); @@ -155,6 +154,9 @@ void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) } } } + + if (m_dirty) + graphicsView()->setZoomY(0.0); } bool GraphicsScene::hasActiveKeyframe() const diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp index 94b53a3ea55..ed968bd0078 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp @@ -333,8 +333,6 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect) painter->fillRect(scene()->sceneRect(), m_style.backgroundAlternateBrush); drawGrid(painter, rect); - drawExtremaX(painter, rect); - drawExtremaY(painter, rect); } int GraphicsView::mapTimeToX(double time) const @@ -456,6 +454,7 @@ void GraphicsView::drawGrid(QPainter *painter, const QRectF &rect) painter->restore(); } +#if 0 void GraphicsView::drawExtremaX(QPainter *painter, const QRectF &rect) { auto drawVerticalLine = [rect, painter](double position) { @@ -485,6 +484,7 @@ void GraphicsView::drawExtremaY(QPainter *painter, const QRectF &rect) painter->restore(); } +#endif void GraphicsView::drawTimeScale(QPainter *painter, const QRectF &rect) { diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.h b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.h index 01dd0ca0261..af138429bf2 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.h +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.h @@ -130,9 +130,11 @@ private: void drawGrid(QPainter *painter, const QRectF &rect); +#if 0 void drawExtremaX(QPainter *painter, const QRectF &rect); void drawExtremaY(QPainter *painter, const QRectF &rect); +#endif void drawTimeScale(QPainter *painter, const QRectF &rect); diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp index 3ea519b79e2..e91d817772b 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurveeditormodel.cpp @@ -56,31 +56,35 @@ DesignTools::CurveEditorStyle AnimationCurveEditorModel::style() const { // Pseudo auto generated. See: CurveEditorStyleDialog DesignTools::CurveEditorStyle out; - out.backgroundBrush = QBrush(QColor(55, 55, 55)); - out.backgroundAlternateBrush = QBrush(QColor(0, 0, 50)); + out.backgroundBrush = QBrush(QColor(21, 21, 21)); + out.backgroundAlternateBrush = QBrush(QColor(32, 32, 32)); out.fontColor = QColor(255, 255, 255); out.gridColor = QColor(114, 116, 118); out.canvasMargin = 15; out.zoomInWidth = 99; out.zoomInHeight = 99; - out.timeAxisHeight = 40; + out.timeAxisHeight = 60; out.timeOffsetLeft = 10; out.timeOffsetRight = 10; - out.rangeBarColor = QColor(46, 47, 48); + out.rangeBarColor = QColor(50, 50, 255); out.rangeBarCapsColor = QColor(50, 50, 255); out.valueAxisWidth = 60; out.valueOffsetTop = 10; out.valueOffsetBottom = 10; - out.handleStyle.size = 12; + out.handleStyle.size = 10; out.handleStyle.lineWidth = 1; out.handleStyle.color = QColor(255, 255, 255); out.handleStyle.selectionColor = QColor(255, 255, 255); - out.keyframeStyle.size = 13; + out.keyframeStyle.size = 14; out.keyframeStyle.color = QColor(172, 210, 255); out.keyframeStyle.selectionColor = QColor(255, 255, 255); - out.curveStyle.width = 1; + out.curveStyle.width = 2; out.curveStyle.color = QColor(0, 200, 0); out.curveStyle.selectionColor = QColor(255, 255, 255); + out.treeItemStyle.margins = 0; + out.playhead.width = 20; + out.playhead.radius = 4; + out.playhead.color = QColor(200, 200, 0); return out; } From fc86de5e5ad07dbcd7693445e0dea7b9b0e26bed Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 13 Aug 2019 18:13:00 +0200 Subject: [PATCH 08/14] QmlDesigner: Fix editable ComboBox Change-Id: Ibf449a3dc34ffeedd70e46bffcb0670049bfb4fc Reviewed-by: Thomas Hartmann --- .../imports/HelperWidgets/UrlChooser.qml | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml index d4b59a32d9d..327bfb2335e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/UrlChooser.qml @@ -37,7 +37,6 @@ RowLayout { property string filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg" - FileResourcesModel { modelNodeBackendProperty: modelNodeBackend filter: urlChooser.filter @@ -63,15 +62,20 @@ RowLayout { property bool isComplete: false + property bool dirty: false + + onEditTextChanged: comboBox.dirty = true + function setCurrentText(text) { if (text === "") return - - var index = comboBox.find(textValue) + var index = comboBox.find(text) if (index === -1) currentIndex = -1 - editText = textValue + + editText = text + comboBox.dirty = false } property string textValue: { @@ -81,9 +85,7 @@ RowLayout { return backendValue.valueToString } - onTextValueChanged: { - setCurrentText(textValue) - } + onTextValueChanged: setCurrentText(textValue) Layout.fillWidth: true @@ -97,25 +99,41 @@ RowLayout { setCurrentText(textValue) } + onAccepted: { if (!comboBox.isComplete) return; - if (backendValue.value !== currentText) - backendValue.value = currentText; + if (backendValue.value !== editText) + backendValue.value = editText; + + comboBox.dirty = false } - onActivated: { - var cText = textAt(index) - print(cText) - if (backendValue === undefined) + onFocusChanged: { + if (comboBox.dirty) + handleActivate(comboBox.currentIndex) + } + + onActivated: handleActivate(index) + + function handleActivate(index) + { + var cText = comboBox.textAt(index) + + if (index === -1) + cText = comboBox.editText + + if (urlChooser.backendValue === undefined) return; if (!comboBox.isComplete) return; - if (backendValue.value !== cText) - backendValue.value = cText; + if (urlChooser.backendValue.value !== cText) + urlChooser.backendValue.value = cText; + + comboBox.dirty = false } Component.onCompleted: { From ef2c3f4e30e5854ff794ea49f0156673aa083ba6 Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Wed, 14 Aug 2019 11:28:07 +0200 Subject: [PATCH 09/14] Add newly created properties to the curve-editor Change-Id: I6a8b6deca7d1f1d124e4b3e2ac845bab5802cbf7 Reviewed-by: Thomas Hartmann --- .../components/timelineeditor/timelinegraphicsscene.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp index 97ebb7e84d0..09555f3ee37 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinegraphicsscene.cpp @@ -169,6 +169,7 @@ void TimelineGraphicsScene::setWidth(int width) void TimelineGraphicsScene::invalidateLayout() { m_layout->invalidate(); + toolBar()->setCurrentTimeline(currentTimeline()); } void TimelineGraphicsScene::setCurrenFrame(const QmlTimeline &timeline, qreal frame) From 85cebb3cbaea1eff9d6ee84a518a44dbc62a3319 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 14 Aug 2019 11:31:58 +0200 Subject: [PATCH 10/14] QmlDesigner: Block all mouse events in GradiantDialogPopup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QDS-914 Change-Id: I08f9038caa947141ab202e2e5f3b00256abe8a21 Reviewed-by: Brook Cronin Reviewed-by: Thomas Hartmann Reviewed-by: Henning Gründl --- .../imports/HelperWidgets/GradientDialogPopup.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml index d206ad9b889..2373c32c648 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientDialogPopup.qml @@ -68,6 +68,8 @@ Loader { MouseArea { anchors.fill: parent onClicked: gradientDialogLoader.visible = false + preventStealing: true + hoverEnabled: true } Rectangle { id: background From f136415e8c2dff0ea9c9bbab2df86e8fbc38fe64 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Wed, 14 Aug 2019 12:43:48 +0200 Subject: [PATCH 11/14] QmlDesigner: Update GradientPropertySpinBox Fixes the referenced bug by replacing the SpinBox used in the GradientPropertySpinBox with a RealSpinBox. Task-number: QDS-914 Change-Id: Iaef165d622b14575713b090c0cc8a0bbac78cabb Reviewed-by: Thomas Hartmann --- .../HelperWidgets/GradientPropertySpinBox.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml index 54483e1598c..e316ef80b18 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/GradientPropertySpinBox.qml @@ -28,7 +28,7 @@ import QtQuick.Layouts 1.0 import QtQuickDesignerTheme 1.0 import StudioControls 1.0 as StudioControls -StudioControls.SpinBox { +StudioControls.RealSpinBox { id: spinBox width: 82 Layout.minimumWidth: 82 @@ -36,9 +36,10 @@ StudioControls.SpinBox { property string propertyName actionIndicatorVisible: false - from: -9999 - to: 9999 - Component.onCompleted: spinBox.value = gradientLine.model.readGradientProperty(propertyName) - onCompressedValueModified: gradientLine.model.setGradientProperty(propertyName, spinBox.value) - stepSize: 1 + realFrom: -9999 + realTo: 9999 + realStepSize: 1 + + Component.onCompleted: spinBox.realValue = gradientLine.model.readGradientProperty(propertyName) + onCompressedRealValueModified: gradientLine.model.setGradientProperty(propertyName, spinBox.realValue) } From 7a39a3c9df9987b66fb6cf2720c23538ee3a471f Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Wed, 14 Aug 2019 13:11:38 +0200 Subject: [PATCH 12/14] Include handles when computing the scene extend Change-Id: I6a6cd17d97c7d590b329315283acdb90ab9117f1 Reviewed-by: Thomas Hartmann --- .../components/curveeditor/animationcurve.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp b/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp index f329ac6bae4..2c716652fdf 100644 --- a/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/animationcurve.cpp @@ -327,6 +327,22 @@ void AnimationCurve::analyze() if (frame.position().y() > m_maxY) m_maxY = frame.position().y(); + + if (frame.hasLeftHandle()) { + if (frame.leftHandle().y() < m_minY) + m_minY = frame.leftHandle().y(); + + if (frame.leftHandle().y() > m_maxY) + m_maxY = frame.leftHandle().y(); + } + + if (frame.hasRightHandle()) { + if (frame.rightHandle().y() < m_minY) + m_minY = frame.rightHandle().y(); + + if (frame.rightHandle().y() > m_maxY) + m_maxY = frame.rightHandle().y(); + } } } } From ab9aae4856872978f7a492f1991077ab87e9b7bd Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Sat, 13 Jul 2019 11:57:35 +0200 Subject: [PATCH 13/14] CMake build: Build with PCH This commit enables building with upstream CMake PCH support. Change-Id: Ib37745b00e7560e804483e7c2c2a3fa7cf6d663c Reviewed-by: Eike Ziller --- CMakeLists.txt | 3 ++- cmake/QtCreatorAPI.cmake | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43d7d9bce6e..41278e8d934 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) option(WITH_TESTS "Build Tests" OFF) option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality (e.g. source file disk checking)" OFF) +option(BUILD_WITH_PCH "Build with precompiled headers" ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -35,7 +36,7 @@ endif() find_package(Qt5 COMPONENTS Concurrent Core Network PrintSupport Qml Quick QuickWidgets - Sql ${_TEST_QT_COMPONENT} + Sql Widgets ${_TEST_QT_COMPONENT} REQUIRED ) diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 003ac10c307..6b1a67f0701 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -250,6 +250,42 @@ function(qtc_plugin_enabled varName name) endif() endfunction() +function(enable_pch target) + if (BUILD_WITH_PCH) + get_target_property(target_sources ${target} SOURCES) + list(LENGTH target_sources target_sources_number) + if (${target_sources_number} GREATER "3") + set(PCH_FILE "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_pch.h") + + function(_recursively_collect_dependencies input_target) + get_target_property(input_type ${input_target} TYPE) + if (${input_type} STREQUAL "INTERFACE_LIBRARY") + set(prefix "INTERFACE_") + endif() + get_target_property(link_libraries ${input_target} ${prefix}LINK_LIBRARIES) + foreach(library IN LISTS link_libraries) + if(TARGET ${library} AND NOT ${library} IN_LIST dependencies) + list(APPEND dependencies ${library}) + _recursively_collect_dependencies(${library}) + endif() + endforeach() + set(dependencies ${dependencies} PARENT_SCOPE) + endfunction() + _recursively_collect_dependencies(${target}) + + if ("Qt5::Widgets" IN_LIST dependencies) + set(PCH_FILE "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h") + endif() + + if (EXISTS ${PCH_FILE}) + set_target_properties(${target} PROPERTIES PRECOMPILE_HEADERS ${PCH_FILE}) + endif() + elseif(WITH_DEBUG_CMAKE) + message(STATUS "Skipped PCH for ${target}") + endif() + endif() +endfunction() + # # Public API functions # @@ -330,6 +366,7 @@ function(add_qtc_library name) ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${IDE_LIBRARY_PATH}" ${_arg_PROPERTIES} ) + enable_pch(${name}) unset(NAMELINK_OPTION) if (library_type STREQUAL "SHARED") @@ -528,6 +565,7 @@ function(add_qtc_plugin target_name) OUTPUT_NAME "${name}" ${_arg_PROPERTIES} ) + enable_pch(${target_name}) foreach(file IN LISTS _arg_EXPLICIT_MOC) set_explicit_moc(${target_name} "${file}") @@ -589,6 +627,15 @@ function(extend_qtc_target target_name) set(_arg_SOURCES ${prefixed_sources}) endif() target_sources(${target_name} PRIVATE ${_arg_SOURCES}) + + if (APPLE AND BUILD_WITH_PCH) + foreach(source IN LISTS _arg_SOURCES) + if (source MATCHES "^.*\.mm$") + set_source_files_properties(${source} PROPERTIES SKIP_PRECOMPILE_HEADERS ON) + endif() + endforeach() + endif() + set_public_headers(${target_name} "${_arg_SOURCES}") foreach(file IN LISTS _arg_EXPLICIT_MOC) @@ -656,6 +703,7 @@ function(add_qtc_executable name) RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${_DESTINATION}" ${_arg_PROPERTIES} ) + enable_pch(${name}) if (NOT _arg_SKIP_INSTALL) install(TARGETS ${name} DESTINATION "${_DESTINATION}") @@ -696,6 +744,7 @@ function(add_qtc_test name) BUILD_RPATH "${_RPATH_BASE}/${_RPATH}" INSTALL_RPATH "${_RPATH_BASE}/${_RPATH}" ) + enable_pch(${name}) if (NOT _arg_GTEST) add_test(NAME ${name} COMMAND ${name}) From 85cb98148670f0c74944cb79d093a4342966543f Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Wed, 14 Aug 2019 17:35:02 +0200 Subject: [PATCH 14/14] QmlDesigner: Fix potential crash It is not crashing with 5.12.3 and 5.13.0 Task-number: QDS-916 Change-Id: I87bd83b90b1eb74c7825564ea789def52eaa8df0 Reviewed-by: Thomas Hartmann --- .../components/stateseditor/stateseditormodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp index ae7400e3825..cb4b7cfe0a7 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditormodel.cpp @@ -37,6 +37,8 @@ #include #include +#include + enum { debug = false }; @@ -181,10 +183,11 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName) return; if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) { - Core::AsynchronousMessageBox::warning(tr("Invalid state name"), + auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"), newName.isEmpty() ? tr("The empty string as a name is reserved for the base state.") : tr("Name already used in another state")); + w->setAttribute(Qt::WA_ShowModal, false); reset(); } else { m_statesEditorView->renameState(internalNodeId, newName);