aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2020-02-26 08:35:05 +0100
committerEike Ziller <eike.ziller@qt.io>2020-02-26 08:35:05 +0100
commit61dc14b67f493aaed42f9fe34ddbd655eaf96b5e (patch)
treee97d965c71fdeb224a5567eae05e82360fdcd2f0 /src/plugins
parent23946de45755ce58d55004bf3e508a83d6299573 (diff)
parentfa59e02f89cc581f27095fb63134a6eb3c554f95 (diff)
Merge remote-tracking branch 'origin/4.12'
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/android/androiddevicedialog.cpp2
-rw-r--r--src/plugins/android/androidmanager.cpp2
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.cpp265
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.h19
-rw-r--r--src/plugins/android/androidsdkdownloader.cpp2
-rw-r--r--src/plugins/android/androidsdkmanager.cpp14
-rw-r--r--src/plugins/android/androidsettingswidget.cpp41
-rw-r--r--src/plugins/autotest/boost/boosttestsettingspage.cpp2
-rw-r--r--src/plugins/autotest/qtest/qttestparser.cpp2
-rw-r--r--src/plugins/autotest/testrunner.cpp1
-rw-r--r--src/plugins/bazaar/bazaareditor.cpp28
-rw-r--r--src/plugins/bazaar/bazaareditor.h1
-rw-r--r--src/plugins/bineditor/bineditorplugin.cpp2
-rw-r--r--src/plugins/boot2qt/device-detection/qdbwatcher.cpp10
-rw-r--r--src/plugins/boot2qt/qdbplugin.cpp2
-rw-r--r--src/plugins/clangformat/clangformatutils.cpp8
-rw-r--r--src/plugins/clearcase/clearcaseeditor.cpp31
-rw-r--r--src/plugins/clearcase/clearcaseeditor.h5
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildstep.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp14
-rw-r--r--src/plugins/cmakeprojectmanager/cmakekitinformation.cpp1
-rw-r--r--src/plugins/cmakeprojectmanager/fileapireader.cpp13
-rw-r--r--src/plugins/cmakeprojectmanager/servermode.cpp11
-rw-r--r--src/plugins/cmakeprojectmanager/servermodereader.cpp11
-rw-r--r--src/plugins/coreplugin/actionmanager/actioncontainer.cpp40
-rw-r--r--src/plugins/coreplugin/actionmanager/actionmanager.cpp6
-rw-r--r--src/plugins/coreplugin/actionmanager/command.cpp48
-rw-r--r--src/plugins/coreplugin/basefilewizardfactory.cpp95
-rw-r--r--src/plugins/coreplugin/dialogs/ioptionspage.cpp18
-rw-r--r--src/plugins/coreplugin/dialogs/newdialog.cpp2
-rw-r--r--src/plugins/coreplugin/dialogs/openwithdialog.cpp1
-rw-r--r--src/plugins/coreplugin/dialogs/promptoverwritedialog.cpp1
-rw-r--r--src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp1
-rw-r--r--src/plugins/coreplugin/dialogs/saveitemsdialog.cpp1
-rw-r--r--src/plugins/coreplugin/dialogs/settingsdialog.cpp1
-rw-r--r--src/plugins/coreplugin/editormanager/documentmodel.cpp12
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.cpp318
-rw-r--r--src/plugins/coreplugin/editormanager/editormanager.h2
-rw-r--r--src/plugins/coreplugin/editormanager/ieditor.cpp94
-rw-r--r--src/plugins/coreplugin/editormanager/ieditorfactory.cpp91
-rw-r--r--src/plugins/coreplugin/editormanager/iexternaleditor.cpp33
-rw-r--r--src/plugins/coreplugin/externaltool.cpp8
-rw-r--r--src/plugins/coreplugin/find/basetextfind.cpp4
-rw-r--r--src/plugins/coreplugin/find/ifindfilter.cpp28
-rw-r--r--src/plugins/coreplugin/find/ifindsupport.cpp30
-rw-r--r--src/plugins/coreplugin/find/searchresultwindow.cpp20
-rw-r--r--src/plugins/coreplugin/iwizardfactory.cpp74
-rw-r--r--src/plugins/coreplugin/locator/executefilter.cpp8
-rw-r--r--src/plugins/coreplugin/locator/ilocatorfilter.cpp10
-rw-r--r--src/plugins/coreplugin/messagemanager.cpp7
-rw-r--r--src/plugins/coreplugin/messagemanager.h1
-rw-r--r--src/plugins/coreplugin/plugindialog.cpp2
-rw-r--r--src/plugins/coreplugin/progressmanager/futureprogress.cpp12
-rw-r--r--src/plugins/coreplugin/progressmanager/progressmanager.cpp102
-rw-r--r--src/plugins/coreplugin/systemsettings.cpp2
-rw-r--r--src/plugins/coreplugin/versiondialog.cpp1
-rw-r--r--src/plugins/cppeditor/cpppreprocessordialog.cpp2
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp8
-rw-r--r--src/plugins/cpptools/symbolsearcher_test.cpp6
-rw-r--r--src/plugins/cvs/cvseditor.cpp43
-rw-r--r--src/plugins/cvs/cvseditor.h7
-rw-r--r--src/plugins/debugger/analyzer/startremotedialog.cpp1
-rw-r--r--src/plugins/debugger/breakhandler.cpp1
-rw-r--r--src/plugins/debugger/debuggeractions.cpp6
-rw-r--r--src/plugins/debugger/debuggeractions.h1
-rw-r--r--src/plugins/debugger/debuggercore.h1
-rw-r--r--src/plugins/debugger/debuggerdialogs.cpp47
-rw-r--r--src/plugins/debugger/debuggerengine.cpp4
-rw-r--r--src/plugins/debugger/debuggerengine.h5
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp45
-rw-r--r--src/plugins/debugger/gdb/gdbengine.cpp22
-rw-r--r--src/plugins/debugger/gdb/gdbengine.h1
-rw-r--r--src/plugins/debugger/gdb/gdboptionspage.cpp10
-rw-r--r--src/plugins/debugger/loadcoredialog.cpp1
-rw-r--r--src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp1
-rw-r--r--src/plugins/debugger/stackhandler.cpp1
-rw-r--r--src/plugins/debugger/unstartedappwatcherdialog.cpp1
-rw-r--r--src/plugins/debugger/uvsc/uvscclient.cpp14
-rw-r--r--src/plugins/git/branchview.cpp13
-rw-r--r--src/plugins/git/branchview.h1
-rw-r--r--src/plugins/git/changeselectiondialog.cpp1
-rw-r--r--src/plugins/git/gerrit/gerritdialog.cpp2
-rw-r--r--src/plugins/git/gerrit/gerritpushdialog.cpp1
-rw-r--r--src/plugins/git/gitclient.cpp73
-rw-r--r--src/plugins/git/gitclient.h2
-rw-r--r--src/plugins/git/gitconstants.h10
-rw-r--r--src/plugins/git/giteditor.cpp121
-rw-r--r--src/plugins/git/giteditor.h15
-rw-r--r--src/plugins/git/gitplugin.cpp94
-rw-r--r--src/plugins/git/gitsettings.cpp2
-rw-r--r--src/plugins/git/gitsettings.h1
-rw-r--r--src/plugins/git/gitutils.cpp1
-rw-r--r--src/plugins/git/logchangedialog.cpp1
-rw-r--r--src/plugins/git/remotedialog.cpp2
-rw-r--r--src/plugins/git/stashdialog.cpp1
-rw-r--r--src/plugins/help/openpageswidget.cpp2
-rw-r--r--src/plugins/imageviewer/exportdialog.cpp2
-rw-r--r--src/plugins/imageviewer/multiexportdialog.cpp2
-rw-r--r--src/plugins/languageclient/client.cpp19
-rw-r--r--src/plugins/languageclient/languageclientcompletionassist.cpp17
-rw-r--r--src/plugins/languageclient/languageclientfunctionhint.cpp17
-rw-r--r--src/plugins/languageclient/languageclientmanager.cpp5
-rw-r--r--src/plugins/languageclient/languageclientquickfix.cpp17
-rw-r--r--src/plugins/languageclient/languageclientsettings.cpp1
-rw-r--r--src/plugins/mcusupport/mcusupportrunconfiguration.cpp5
-rw-r--r--src/plugins/mercurial/constants.h8
-rw-r--r--src/plugins/mercurial/mercurialeditor.cpp33
-rw-r--r--src/plugins/mercurial/mercurialeditor.h10
-rw-r--r--src/plugins/perforce/perforceeditor.cpp32
-rw-r--r--src/plugins/perforce/perforceeditor.h5
-rw-r--r--src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp4
-rw-r--r--src/plugins/projectexplorer/buildconfiguration.h2
-rw-r--r--src/plugins/projectexplorer/buildmanager.cpp1
-rw-r--r--src/plugins/projectexplorer/buildstep.cpp5
-rw-r--r--src/plugins/projectexplorer/buildstep.h2
-rw-r--r--src/plugins/projectexplorer/deployconfiguration.h2
-rw-r--r--src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp1
-rw-r--r--src/plugins/projectexplorer/projectconfiguration.h2
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp3
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h2
-rw-r--r--src/plugins/projectexplorer/sessionmodel.cpp6
-rw-r--r--src/plugins/projectexplorer/toolchainoptionspage.h4
-rw-r--r--src/plugins/projectexplorer/waitforstopdialog.cpp1
-rw-r--r--src/plugins/python/pythonutils.cpp66
-rw-r--r--src/plugins/python/pythonutils.h5
-rw-r--r--src/plugins/qbsprojectmanager/qbsbuildstep.cpp3
-rw-r--r--src/plugins/qbsprojectmanager/qbscleanstep.cpp2
-rw-r--r--src/plugins/qbsprojectmanager/qbsinstallstep.cpp3
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp5
-rw-r--r--src/plugins/qbsprojectmanager/qbssettings.cpp9
-rw-r--r--src/plugins/qbsprojectmanager/qbssettings.h1
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeproject.cpp12
-rw-r--r--src/plugins/qmakeprojectmanager/qmakestep.cpp9
-rw-r--r--src/plugins/qmldesigner/CMakeLists.txt15
-rw-r--r--src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp3
-rw-r--r--src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp37
-rw-r--r--src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp11
-rw-r--r--src/plugins/qmldesigner/components/bindingeditor/bindingeditordialog.cpp1
-rw-r--r--src/plugins/qmldesigner/components/componentcore/actioninterface.h3
-rw-r--r--src/plugins/qmldesigner/components/componentcore/addimagesdialog.cpp1
-rw-r--r--src/plugins/qmldesigner/components/componentcore/zoomaction.cpp9
-rw-r--r--src/plugins/qmldesigner/components/connectioneditor/addnewbackenddialog.cpp1
-rw-r--r--src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp12
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp2
-rw-r--r--src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h2
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3d.pri12
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3d.qrc34
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dactions.cpp97
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dactions.h84
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp125
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dcanvas.h66
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dview.cpp247
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dview.h87
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp106
-rw-r--r--src/plugins/qmldesigner/components/edit3d/edit3dwidget.h53
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/edit_light_off.pngbin0 -> 1189 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/edit_light_off@2x.pngbin0 -> 1430 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/edit_light_on.pngbin0 -> 1355 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/edit_light_on@2x.pngbin0 -> 1766 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/fit_active.pngbin0 -> 266 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/fit_active@2x.pngbin0 -> 386 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/global.pngbin0 -> 433 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/global@2x.pngbin0 -> 561 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/group_selection_selected.pngbin0 -> 438 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/group_selection_selected@2x.pngbin0 -> 904 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/item_selection_selected.pngbin0 -> 355 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/item_selection_selected@2x.pngbin0 -> 661 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/local.pngbin0 -> 1309 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/local@2x.pngbin0 -> 1960 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/move_active.pngbin0 -> 294 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/move_active@2x.pngbin0 -> 303 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/move_selected.pngbin0 -> 191 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/move_selected@2x.pngbin0 -> 272 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/ortho.pngbin0 -> 1310 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/ortho@2x.pngbin0 -> 1727 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/persp.pngbin0 -> 1391 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/persp@2x.pngbin0 -> 1971 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/rotate_active.pngbin0 -> 451 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/rotate_active@2x.pngbin0 -> 869 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/rotate_selected.pngbin0 -> 478 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/rotate_selected@2x.pngbin0 -> 906 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/scale_active.pngbin0 -> 242 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/scale_active@2x.pngbin0 -> 338 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/scale_selected.pngbin0 -> 277 bytes
-rw-r--r--src/plugins/qmldesigner/components/edit3d/images/scale_selected@2x.pngbin0 -> 364 bytes
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp13
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp7
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditorview.cpp4
-rw-r--r--src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp18
-rw-r--r--src/plugins/qmldesigner/components/formeditor/selectionindicator.cpp11
-rw-r--r--src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp2
-rw-r--r--src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp3
-rw-r--r--src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp6
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp4
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatorview.cpp3
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp32
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp4
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp2
-rw-r--r--src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp2
-rw-r--r--src/plugins/qmldesigner/components/resources/centerwidget.css4
-rw-r--r--src/plugins/qmldesigner/components/resources/dockwidgets.css128
-rw-r--r--src/plugins/qmldesigner/components/resources/resources.qrc1
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp6
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h3
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp2
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/easingcurvedialog.cpp1
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp1
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp2
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp1
-rw-r--r--src/plugins/qmldesigner/componentsplugin/componentsplugin.qbs1
-rw-r--r--src/plugins/qmldesigner/designercore/include/abstractview.h6
-rw-r--r--src/plugins/qmldesigner/designercore/include/nodehints.h1
-rw-r--r--src/plugins/qmldesigner/designercore/include/nodeinstanceview.h6
-rw-r--r--src/plugins/qmldesigner/designercore/include/viewmanager.h1
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp20
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h3
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp25
-rw-r--r--src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp3
-rw-r--r--src/plugins/qmldesigner/designercore/metainfo/nodehints.cpp5
-rw-r--r--src/plugins/qmldesigner/designercore/model/abstractview.cpp20
-rw-r--r--src/plugins/qmldesigner/designercore/model/model.cpp16
-rw-r--r--src/plugins/qmldesigner/designercore/model/model_p.h3
-rw-r--r--src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp2
-rw-r--r--src/plugins/qmldesigner/designercore/model/viewmanager.cpp14
-rw-r--r--src/plugins/qmldesigner/designmodewidget.cpp479
-rw-r--r--src/plugins/qmldesigner/designmodewidget.h23
-rw-r--r--src/plugins/qmldesigner/openuiqmlfiledialog.cpp1
-rw-r--r--src/plugins/qmldesigner/qmldesigner_dependencies.pri4
-rw-r--r--src/plugins/qmldesigner/qmldesignerconstants.h3
-rw-r--r--src/plugins/qmldesigner/qmldesignericons.h31
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.pro1
-rw-r--r--src/plugins/qmldesigner/qmldesignerplugin.qbs18
-rw-r--r--src/plugins/qmldesigner/qtquickplugin/quick.metainfo6
-rw-r--r--src/plugins/qmldesigner/shortcutmanager.cpp45
-rw-r--r--src/plugins/qmldesigner/shortcutmanager.h6
-rw-r--r--src/plugins/qmldesigner/switchsplittabwidget.cpp50
-rw-r--r--src/plugins/qmldesigner/switchsplittabwidget.h13
-rw-r--r--src/plugins/qmljseditor/qmljssemantichighlighter.cpp2
-rw-r--r--src/plugins/qmlprofiler/flamegraphmodel.cpp6
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp1
-rw-r--r--src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp4
-rw-r--r--src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp5
-rw-r--r--src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h4
-rw-r--r--src/plugins/qmlprojectmanager/qmlproject.cpp9
-rw-r--r--src/plugins/qmlprojectmanager/qmlproject.h1
-rw-r--r--src/plugins/qmlprojectmanager/qmlprojectconstants.h1
-rw-r--r--src/plugins/qtsupport/baseqtversion.cpp6
-rw-r--r--src/plugins/studiowelcome/CMakeLists.txt11
-rw-r--r--src/plugins/subversion/subversioneditor.cpp34
-rw-r--r--src/plugins/subversion/subversioneditor.h1
-rw-r--r--src/plugins/subversion/subversionplugin.cpp1
-rw-r--r--src/plugins/texteditor/codeassist/codeassistant.cpp2
-rw-r--r--src/plugins/texteditor/codeassist/documentcontentcompletion.cpp14
-rw-r--r--src/plugins/texteditor/codeassist/iassistprocessor.h1
-rw-r--r--src/plugins/texteditor/texteditor.cpp14
-rw-r--r--src/plugins/valgrind/memchecktool.cpp3
-rw-r--r--src/plugins/vcsbase/cleandialog.cpp1
-rw-r--r--src/plugins/vcsbase/diffandloghighlighter.cpp18
-rw-r--r--src/plugins/vcsbase/diffandloghighlighter.h5
-rw-r--r--src/plugins/vcsbase/nicknamedialog.cpp1
-rw-r--r--src/plugins/vcsbase/vcsbaseeditor.cpp96
-rw-r--r--src/plugins/vcsbase/vcsbaseeditor.h11
-rw-r--r--src/plugins/vcsbase/vcsbasesubmiteditor.cpp1
264 files changed, 3335 insertions, 1450 deletions
diff --git a/src/plugins/android/androiddevicedialog.cpp b/src/plugins/android/androiddevicedialog.cpp
index 4fb41262126..a2783d4d514 100644
--- a/src/plugins/android/androiddevicedialog.cpp
+++ b/src/plugins/android/androiddevicedialog.cpp
@@ -472,8 +472,6 @@ AndroidDeviceDialog::AndroidDeviceDialog(int apiLevel, const QStringList &abis,
connect(m_ui->lookingForDeviceCancel, &QPushButton::clicked,
this, &AndroidDeviceDialog::defaultDeviceClear);
-
- m_connectedDevices = AndroidConfig::connectedDevices(AndroidConfigurations::currentConfig().adbToolPath());
}
AndroidDeviceDialog::~AndroidDeviceDialog()
diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp
index 3027495dfc1..d4bc98d6bb9 100644
--- a/src/plugins/android/androidmanager.cpp
+++ b/src/plugins/android/androidmanager.cpp
@@ -539,6 +539,8 @@ QString AndroidManager::androidNameForApiLevel(int x)
return QLatin1String("Android 9");
case 29:
return QLatin1String("Android 10");
+ case 30:
+ return QLatin1String("Android 11");
default:
return tr("Unknown Android version. API Level: %1").arg(QString::number(x));
}
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp
index 6f0bff08bcb..bc80a84ba75 100644
--- a/src/plugins/android/androidmanifesteditorwidget.cpp
+++ b/src/plugins/android/androidmanifesteditorwidget.cpp
@@ -49,32 +49,39 @@
#include <texteditor/texteditor.h>
#include <utils/algorithm.h>
+#include <utils/fileutils.h>
+#include <utils/stylehelper.h>
#include <utils/utilsicons.h>
-#include <QLineEdit>
-#include <QFileInfo>
-#include <QDomDocument>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QDebug>
#include <QDir>
+#include <QDomDocument>
+#include <QFileDialog>
+#include <QFileInfo>
+#include <QFormLayout>
#include <QGroupBox>
#include <QHBoxLayout>
+#include <QImage>
#include <QLabel>
-#include <QFormLayout>
-#include <QComboBox>
-#include <QSpinBox>
-#include <QDebug>
-#include <QToolButton>
-#include <utils/fileutils.h>
-#include <utils/stylehelper.h>
+#include <QLineEdit>
#include <QListView>
+#include <QLoggingCategory>
#include <QPushButton>
-#include <QFileDialog>
-#include <QTimer>
-#include <QCheckBox>
#include <QScrollArea>
+#include <QSpinBox>
+#include <QTimer>
+#include <QToolButton>
#include <algorithm>
#include <limits>
+
+namespace {
+static Q_LOGGING_CATEGORY(androidManifestEditorLog, "qtc.android.manifestEditor", QtWarningMsg)
+}
+
using namespace ProjectExplorer;
using namespace Android;
using namespace Android::Internal;
@@ -237,22 +244,44 @@ void AndroidManifestEditorWidget::initializePage()
createDPIButton(iconLayout,
applicationGroupBox,
- m_lIconButton, m_lIconClearButton,
- tr("Low DPI icon"), tr("Select low DPI icon."));
+ m_masterIconButton, iconSize(LowDPI),
+ tr("Master icon"), tr("Select master icon."));
+
+ m_masterIconButton->setIcon(QIcon::fromTheme(QLatin1String("document-open"), Utils::Icons::OPENFILE.icon()));
+
+ iconLayout->addStretch(1);
+
+ QFrame* line = new QFrame();
+ line->setFrameShape(QFrame::VLine);
+ line->setFrameShadow(QFrame::Sunken);
+ iconLayout->addWidget(line);
+
+ iconLayout->addStretch(1);
+
+ createDPIButton(iconLayout,
+ applicationGroupBox,
+ m_lIconButton, iconSize(LowDPI),
+ tr("Low DPI icon"), tr("Select low DPI icon."),
+ &m_lIconClearButton,
+ &m_lIconScaleWarningLabel);
iconLayout->addStretch(1);
createDPIButton(iconLayout,
applicationGroupBox,
- m_mIconButton, m_mIconClearButton,
- tr("Medium DPI icon"), tr("Select medium DPI icon."));
+ m_mIconButton, iconSize(MediumDPI),
+ tr("Medium DPI icon"), tr("Select medium DPI icon."),
+ &m_mIconClearButton,
+ &m_mIconScaleWarningLabel);
iconLayout->addStretch(1);
createDPIButton(iconLayout,
applicationGroupBox,
- m_hIconButton, m_hIconClearButton,
- tr("High DPI icon"), tr("Select high DPI icon."));
+ m_hIconButton, iconSize(HighDPI),
+ tr("High DPI icon"), tr("Select high DPI icon."),
+ &m_hIconClearButton,
+ &m_hIconScaleWarningLabel);
iconLayout->addStretch(6);
@@ -269,6 +298,8 @@ void AndroidManifestEditorWidget::initializePage()
connect(m_targetLineEdit, &QComboBox::currentTextChanged,
this, setDirtyFunc);
+ connect(m_masterIconButton, &QAbstractButton::clicked,
+ this, &AndroidManifestEditorWidget::setMasterIcon);
connect(m_lIconButton, &QAbstractButton::clicked,
this, &AndroidManifestEditorWidget::setLDPIIcon);
connect(m_mIconButton, &QAbstractButton::clicked,
@@ -549,10 +580,7 @@ void AndroidManifestEditorWidget::setDirty(bool dirty)
bool AndroidManifestEditorWidget::isModified() const
{
- return m_dirty
- || !m_hIconPath.isEmpty()
- || !m_mIconPath.isEmpty()
- || !m_lIconPath.isEmpty();
+ return m_dirty;
}
AndroidManifestEditorWidget::EditorPage AndroidManifestEditorWidget::activePage() const
@@ -592,18 +620,10 @@ void AndroidManifestEditorWidget::preSave()
syncToEditor();
QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
- if (!m_lIconPath.isEmpty()) {
- copyIcon(LowDPI, baseDir, m_lIconPath);
- m_lIconPath.clear();
- }
- if (!m_mIconPath.isEmpty()) {
- copyIcon(MediumDPI, baseDir, m_mIconPath);
- m_mIconPath.clear();
- }
- if (!m_hIconPath.isEmpty()) {
- copyIcon(HighDPI, baseDir, m_hIconPath);
- m_hIconPath.clear();
- }
+ copyIcon(LowDPI, baseDir, m_lIconPath);
+ copyIcon(MediumDPI, baseDir, m_mIconPath);
+ copyIcon(HighDPI, baseDir, m_hIconPath);
+
// no need to emit changed() since this is called as part of saving
updateInfoBar();
@@ -795,9 +815,9 @@ void AndroidManifestEditorWidget::syncToWidgets(const QDomDocument &doc)
m_lIconButton->setIcon(icon(baseDir, LowDPI));
m_mIconButton->setIcon(icon(baseDir, MediumDPI));
m_hIconButton->setIcon(icon(baseDir, HighDPI));
- m_lIconPath.clear();
- m_mIconPath.clear();
- m_hIconPath.clear();
+ m_lIconPath = baseDir + iconPath(LowDPI);
+ m_mIconPath = baseDir + iconPath(MediumDPI);
+ m_hIconPath = baseDir + iconPath(HighDPI);
disconnect(m_defaultPermissonsCheckBox, &QCheckBox::stateChanged,
this, &AndroidManifestEditorWidget::defaultPermissionOrFeatureCheckBoxClicked);
@@ -999,15 +1019,17 @@ void AndroidManifestEditorWidget::parseApplication(QXmlStreamReader &reader, QXm
QXmlStreamAttributes attributes = reader.attributes();
QStringList keys = {QLatin1String("android:label")};
QStringList values = {m_appNameLineEdit->text()};
+ QStringList remove;
bool ensureIconAttribute = !m_lIconPath.isEmpty()
|| !m_mIconPath.isEmpty()
|| !m_hIconPath.isEmpty();
if (ensureIconAttribute) {
keys << QLatin1String("android:icon");
values << QLatin1String("@drawable/icon");
- }
+ } else
+ remove << QLatin1String("android:icon");
- QXmlStreamAttributes result = modifyXmlStreamAttributes(attributes, keys, values);
+ QXmlStreamAttributes result = modifyXmlStreamAttributes(attributes, keys, values, remove);
writer.writeAttributes(result);
reader.readNext();
@@ -1230,6 +1252,34 @@ QString AndroidManifestEditorWidget::iconPath(IconDPI dpi)
return {};
}
+QSize AndroidManifestEditorWidget::iconSize(IconDPI dpi)
+{
+ switch (dpi) {
+ case HighDPI:
+ return QSize(72, 72);
+ case MediumDPI:
+ return QSize(48, 48);
+ case LowDPI:
+ return QSize(32, 32);
+ }
+ return QSize(72, 72);
+}
+
+void AndroidManifestEditorWidget::updateIconPath(const QString &newPath, IconDPI dpi)
+{
+ switch (dpi) {
+ case HighDPI:
+ m_hIconPath = newPath;
+ break;
+ case MediumDPI:
+ m_mIconPath = newPath;
+ break;
+ case LowDPI:
+ m_lIconPath = newPath;
+ break;
+ }
+}
+
QIcon AndroidManifestEditorWidget::icon(const QString &baseDir, IconDPI dpi)
{
@@ -1250,90 +1300,177 @@ QIcon AndroidManifestEditorWidget::icon(const QString &baseDir, IconDPI dpi)
void AndroidManifestEditorWidget::copyIcon(IconDPI dpi, const QString &baseDir, const QString &filePath)
{
- if (!QFileInfo::exists(filePath))
+ const QString targetPath = baseDir + iconPath(dpi);
+ if (targetPath.isEmpty()) {
+ qCDebug(androidManifestEditorLog) << "Icon target path empty, cannot copy icon.";
+ return;
+ }
+ QFileInfo targetFile(targetPath);
+ if (filePath == targetPath)
return;
+ removeIcon(dpi, baseDir);
+ QImage original(filePath);
+ if (!targetPath.isEmpty() && !original.isNull()) {
+ QDir dir;
+ dir.mkpath(QFileInfo(targetPath).absolutePath());
+ QSize targetSize = iconSize(dpi);
+ QImage scaled = original.scaled(targetSize.width(), targetSize.height(),
+ Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ toggleIconScaleWarning(dpi, scaled.width() > original.width() || scaled.height() > original.height());
+ scaled.save(targetPath);
+ updateIconPath(targetPath, dpi);
+ }
+}
+void AndroidManifestEditorWidget::removeIcon(IconDPI dpi, const QString &baseDir)
+{
const QString targetPath = baseDir + iconPath(dpi);
- QFile::remove(targetPath);
- QDir dir;
- dir.mkpath(QFileInfo(targetPath).absolutePath());
- QFile::copy(filePath, targetPath);
+ if (targetPath.isEmpty()) {
+ qCDebug(androidManifestEditorLog) << "Icon target path empty, cannot remove icon.";
+ return;
+ }
+ QFileInfo targetFile(targetPath);
+ if (targetFile.exists()) {
+ QDir rmRf(targetFile.absoluteDir());
+ rmRf.removeRecursively();
+ }
+ toggleIconScaleWarning(dpi, false);
+}
+
+void AndroidManifestEditorWidget::toggleIconScaleWarning(IconDPI dpi, bool visible)
+{
+ switch (dpi) {
+ case HighDPI:
+ m_hIconScaleWarningLabel->setVisible(visible);
+ break;
+ case MediumDPI:
+ m_mIconScaleWarningLabel->setVisible(visible);
+ break;
+ case LowDPI:
+ m_lIconScaleWarningLabel->setVisible(visible);
+ break;
+ }
+}
+
+const auto fileDialogIconFiles = QWidget::tr("Images (*.png *.jpg *.webp *.svg)");
+
+void AndroidManifestEditorWidget::setMasterIcon()
+{
+ QString file = QFileDialog::getOpenFileName(this, tr("Choose Master Icon"), QDir::homePath(), fileDialogIconFiles);
+ if (file.isEmpty())
+ return;
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ copyIcon(LowDPI, baseDir, file);
+ copyIcon(MediumDPI, baseDir, file);
+ copyIcon(HighDPI, baseDir, file);
+ m_lIconButton->setIcon(icon(baseDir, LowDPI));
+ m_mIconButton->setIcon(icon(baseDir, MediumDPI));
+ m_hIconButton->setIcon(icon(baseDir, HighDPI));
}
void AndroidManifestEditorWidget::setLDPIIcon()
{
- QString file = QFileDialog::getOpenFileName(this, tr("Choose Low DPI Icon"), QDir::homePath(), tr("PNG images (*.png)"));
+ QString file = QFileDialog::getOpenFileName(this, tr("Choose Low DPI Icon"), QDir::homePath(), fileDialogIconFiles);
if (file.isEmpty())
return;
m_lIconPath = file;
- m_lIconButton->setIcon(QIcon(file));
- setDirty(true);
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ copyIcon(LowDPI, baseDir, m_lIconPath);
+ m_lIconButton->setIcon(icon(baseDir, LowDPI));
}
void AndroidManifestEditorWidget::setMDPIIcon()
{
- QString file = QFileDialog::getOpenFileName(this, tr("Choose Medium DPI Icon"), QDir::homePath(), tr("PNG images (*.png)"));
+ QString file = QFileDialog::getOpenFileName(this, tr("Choose Medium DPI Icon"), QDir::homePath(), fileDialogIconFiles);
if (file.isEmpty())
return;
m_mIconPath = file;
- m_mIconButton->setIcon(QIcon(file));
- setDirty(true);
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ copyIcon(MediumDPI, baseDir, m_mIconPath);
+ m_mIconButton->setIcon(icon(baseDir, MediumDPI));
}
void AndroidManifestEditorWidget::setHDPIIcon()
{
- QString file = QFileDialog::getOpenFileName(this, tr("Choose High DPI Icon"), QDir::homePath(), tr("PNG images (*.png)"));
+ QString file = QFileDialog::getOpenFileName(this, tr("Choose High DPI Icon"), QDir::homePath(), fileDialogIconFiles);
if (file.isEmpty())
return;
m_hIconPath = file;
- m_hIconButton->setIcon(QIcon(file));
- setDirty(true);
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ copyIcon(HighDPI, baseDir, m_hIconPath);
+ m_hIconButton->setIcon(icon(baseDir, HighDPI));
}
void AndroidManifestEditorWidget::clearLDPIIcon()
{
m_lIconPath.clear();
m_lIconButton->setIcon(QIcon());
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ removeIcon(LowDPI, baseDir);
}
void AndroidManifestEditorWidget::clearMDPIIcon()
{
m_mIconPath.clear();
m_mIconButton->setIcon(QIcon());
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ removeIcon(MediumDPI, baseDir);
}
void AndroidManifestEditorWidget::clearHDPIIcon()
{
m_hIconPath.clear();
m_hIconButton->setIcon(QIcon());
+ QString baseDir = m_textEditorWidget->textDocument()->filePath().toFileInfo().absolutePath();
+ removeIcon(HighDPI, baseDir);
}
void AndroidManifestEditorWidget::createDPIButton(QHBoxLayout *layout,
QWidget *parent,
QToolButton *&button,
- QToolButton *&clearButton,
+ const QSize &buttonSize,
const QString &title,
- const QString &tooltip)
+ const QString &tooltip,
+ QToolButton **clearButton,
+ QLabel **scaleWarningLabel)
{
auto iconLayout = new QVBoxLayout();
auto iconTitle = new QLabel(title, parent);
auto iconButtonLayout = new QGridLayout();
button = new QToolButton(parent);
- button->setMinimumSize(QSize(48, 48));
- button->setMaximumSize(QSize(48, 48));
+ button->setMinimumSize(buttonSize);
+ button->setMaximumSize(buttonSize);
button->setToolTip(tooltip);
- clearButton = new QToolButton(parent);
- clearButton->setMinimumSize(QSize(16, 16));
- clearButton->setMaximumSize(QSize(16, 16));
- clearButton->setIcon(Utils::Icons::CLOSE_FOREGROUND.icon());
+ button->setIconSize(buttonSize);
+ QSize clearAndWarningSize(16, 16);
+ if (clearButton) {
+ *clearButton = new QToolButton(parent);
+ (*clearButton)->setMinimumSize(clearAndWarningSize);
+ (*clearButton)->setMaximumSize(clearAndWarningSize);
+ (*clearButton)->setIcon(Utils::Icons::CLOSE_FOREGROUND.icon());
+ }
+ if (scaleWarningLabel) {
+ *scaleWarningLabel = new QLabel(parent);
+ (*scaleWarningLabel)->setMinimumSize(clearAndWarningSize);
+ (*scaleWarningLabel)->setMaximumSize(clearAndWarningSize);
+ (*scaleWarningLabel)->setPixmap(Utils::Icons::WARNING.icon().pixmap(clearAndWarningSize));
+ (*scaleWarningLabel)->setToolTip(tr("Icon scaled up"));
+ (*scaleWarningLabel)->setVisible(false);
+ }
auto label = new QLabel(tr("Click to select"), parent);
iconLayout->addWidget(iconTitle);
iconLayout->setAlignment(iconTitle, Qt::AlignHCenter);
iconButtonLayout->setColumnMinimumWidth(0, 16);
iconButtonLayout->addWidget(button, 0, 1, 1, 3);
iconButtonLayout->setAlignment(button, Qt::AlignVCenter);
- iconButtonLayout->addWidget(clearButton, 0, 4, 1, 1);
- iconButtonLayout->setAlignment(clearButton, Qt::AlignTop);
+ if (clearButton) {
+ iconButtonLayout->addWidget(*clearButton, 0, 4, 1, 1);
+ iconButtonLayout->setAlignment(*clearButton, Qt::AlignTop);
+ }
+ if (scaleWarningLabel) {
+ iconButtonLayout->addWidget(*scaleWarningLabel, 0, 0, 1, 1);
+ iconButtonLayout->setAlignment(*scaleWarningLabel, Qt::AlignTop);
+ }
iconLayout->addLayout(iconButtonLayout);
iconLayout->setAlignment(iconButtonLayout, Qt::AlignHCenter);
iconLayout->addWidget(label);
diff --git a/src/plugins/android/androidmanifesteditorwidget.h b/src/plugins/android/androidmanifesteditorwidget.h
index 48349cd8684..efbc2b529a4 100644
--- a/src/plugins/android/androidmanifesteditorwidget.h
+++ b/src/plugins/android/androidmanifesteditorwidget.h
@@ -116,6 +116,8 @@ protected:
void focusInEvent(QFocusEvent *event) override;
private:
+ void setMasterIcon();
+ void clearMasterIcon();
void setLDPIIcon();
void setMDPIIcon();
void setHDPIIcon();
@@ -124,8 +126,11 @@ private:
void clearHDPIIcon();
void createDPIButton(QHBoxLayout *layout,
QWidget *parent,
- QToolButton *&button, QToolButton *&clearButton,
- const QString &title, const QString &tooltip);
+ QToolButton *&button, const QSize &buttonSize,
+ const QString &title, const QString &tooltip,
+ QToolButton **clearButton = nullptr,
+ QLabel **scaleWarningLabel = nullptr
+ );
void defaultPermissionOrFeatureCheckBoxClicked();
void addPermission();
void removePermission();
@@ -146,7 +151,11 @@ private:
enum IconDPI { LowDPI, MediumDPI, HighDPI };
QIcon icon(const QString &baseDir, IconDPI dpi);
QString iconPath(IconDPI dpi);
+ QSize iconSize(IconDPI dpi);
+ void updateIconPath(const QString &newPath, IconDPI dpi);
void copyIcon(IconDPI dpi, const QString &baseDir, const QString &filePath);
+ void removeIcon(IconDPI dpi, const QString &baseDir);
+ void toggleIconScaleWarning(IconDPI dpi, bool visible);
void updateInfoBar(const QString &errorMessage, int line, int column);
void hideInfoBar();
@@ -180,13 +189,17 @@ private:
QLineEdit *m_appNameLineEdit;
QLineEdit *m_activityNameLineEdit;
QComboBox *m_targetLineEdit;
+ QToolButton *m_masterIconButton;
QToolButton *m_lIconButton;
QToolButton *m_lIconClearButton;
+ QLabel *m_lIconScaleWarningLabel;
QToolButton *m_mIconButton;
QToolButton *m_mIconClearButton;
+ QLabel *m_mIconScaleWarningLabel;
QToolButton *m_hIconButton;
QToolButton *m_hIconClearButton;
- QString m_lIconPath; // only set if the user changed the icon
+ QLabel *m_hIconScaleWarningLabel;
+ QString m_lIconPath;
QString m_mIconPath;
QString m_hIconPath;
diff --git a/src/plugins/android/androidsdkdownloader.cpp b/src/plugins/android/androidsdkdownloader.cpp
index 48d8bf9e840..fdefe3ea35d 100644
--- a/src/plugins/android/androidsdkdownloader.cpp
+++ b/src/plugins/android/androidsdkdownloader.cpp
@@ -149,7 +149,7 @@ void AndroidSdkDownloader::cancel()
m_reply->deleteLater();
}
if (m_progressDialog)
- m_progressDialog->hide();
+ m_progressDialog->cancel();
}
void AndroidSdkDownloader::cancelWithError(const QString &error)
diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp
index 1987a284ffb..e3ea6860890 100644
--- a/src/plugins/android/androidsdkmanager.cpp
+++ b/src/plugins/android/androidsdkmanager.cpp
@@ -69,15 +69,19 @@ using SdkCmdFutureInterface = QFutureInterface<AndroidSdkManager::OperationOutpu
int platformNameToApiLevel(const QString &platformName)
{
int apiLevel = -1;
- QRegularExpression re("(android-)(?<apiLevel>[0-9Q]{1,})",
+ QRegularExpression re("(android-)(?<apiLevel>[0-9A-Z]{1,})",
QRegularExpression::CaseInsensitiveOption);
QRegularExpressionMatch match = re.match(platformName);
if (match.hasMatch()) {
QString apiLevelStr = match.captured("apiLevel");
- if (apiLevelStr == 'Q')
- apiLevel = 29;
- else
- apiLevel = apiLevelStr.toInt();
+ bool isUInt;
+ apiLevel = apiLevelStr.toUInt(&isUInt);
+ if (!isUInt) {
+ if (apiLevelStr == 'Q')
+ apiLevel = 29;
+ else if (apiLevelStr == 'R')
+ apiLevel = 30;
+ }
}
return apiLevel;
}
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index e70a7ce34fb..5cb44faeb5d 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -132,6 +132,7 @@ private:
bool allEssentialsInstalled();
bool sdkToolsOk() const;
Utils::FilePath getDefaultSdkPath();
+ void showEvent(QShowEvent *event) override;
Ui_AndroidSettingsWidget *m_ui;
AndroidSdkManagerWidget *m_sdkManagerWidget = nullptr;
@@ -143,6 +144,7 @@ private:
QString m_lastAddedAvd;
std::unique_ptr<AndroidAvdManager> m_avdManager;
std::unique_ptr<AndroidSdkManager> m_sdkManager;
+ bool m_isInitialReloadDone = false;
};
enum JavaValidation {
@@ -330,7 +332,19 @@ Utils::FilePath AndroidSettingsWidget::getDefaultSdkPath()
}
return Utils::FilePath::fromString(
- QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Android/Sdk");
+ QStandardPaths::writableLocation(QStandardPaths::HomeLocation) + "/Android/Sdk");
+}
+
+void AndroidSettingsWidget::showEvent(QShowEvent *event)
+{
+ Q_UNUSED(event)
+ if (!m_isInitialReloadDone) {
+ // Reloading SDK packages (force) is still synchronous. Use zero timer
+ // to let settings dialog open first.
+ QTimer::singleShot(0, std::bind(&AndroidSdkManager::reloadPackages,
+ m_sdkManager.get(), true));
+ m_isInitialReloadDone = true;
+ }
}
void AndroidSettingsWidget::updateNdkList()
@@ -398,8 +412,6 @@ AndroidSettingsWidget::AndroidSettingsWidget()
m_ui->OpenJDKLocationPathChooser->setFileName(currentJdkPath);
m_ui->OpenJDKLocationPathChooser->setPromptDialogTitle(tr("Select JDK Path"));
- connect(m_ui->SDKLocationPathChooser, &Utils::PathChooser::rawPathChanged,
- this, &AndroidSettingsWidget::onSdkPathChanged);
Utils::FilePath currentSDKPath = m_androidConfig.sdkLocation();
if (currentSDKPath.isEmpty())
currentSDKPath = getDefaultSdkPath();
@@ -421,6 +433,8 @@ AndroidSettingsWidget::AndroidSettingsWidget()
m_ui->downloadOpenJDKToolButton->setIcon(downloadIcon);
m_ui->sdkToolsAutoDownloadButton->setIcon(Utils::Icons::RELOAD.icon());
+ connect(m_ui->SDKLocationPathChooser, &Utils::PathChooser::rawPathChanged,
+ this, &AndroidSettingsWidget::onSdkPathChanged);
connect(m_ui->ndkListComboBox, QOverload<const QString &>::of(&QComboBox::currentIndexChanged),
[this](const QString) { validateNdk(); });
connect(&m_virtualDevicesWatcher, &QFutureWatcherBase::finished,
@@ -464,20 +478,6 @@ AndroidSettingsWidget::AndroidSettingsWidget()
}
downloadSdk();
});
-
- auto startOneShot = QSharedPointer<QMetaObject::Connection>::create();
- *startOneShot = connect(m_sdkManager.get(),
- &AndroidSdkManager::packageReloadFinished, [this, startOneShot] {
- QObject::disconnect(*startOneShot);
- if (!sdkToolsOk())
- downloadSdk();
- });
-
- // Reloading SDK packages (force) is still synchronous. Use zero timer to let settings dialog open
- // first.
- QTimer::singleShot(0, std::bind(&AndroidSdkManager::reloadPackages, m_sdkManager.get(), true));
-
- startUpdateAvd();
}
AndroidSettingsWidget::~AndroidSettingsWidget()
@@ -648,6 +648,7 @@ void AndroidSettingsWidget::validateSdk()
}
}
+ startUpdateAvd();
updateNdkList();
validateNdk();
}
@@ -769,9 +770,8 @@ void AndroidSettingsWidget::manageAVD()
void AndroidSettingsWidget::downloadSdk()
{
- QString message(tr("Android SDK Tools package is not installed. Do you want to download it?\n"
- "The final location: ")
- + QDir::toNativeSeparators(m_ui->SDKLocationPathChooser->rawPath()));
+ QString message(tr("Do you want to download and install Android SDK Tools to: %1?")
+ .arg(QDir::toNativeSeparators(m_ui->SDKLocationPathChooser->rawPath())));
auto userInput = QMessageBox::information(this, AndroidSdkDownloader::dialogTitle(),
message, QMessageBox::Yes | QMessageBox::No);
if (userInput == QMessageBox::Yes) {
@@ -786,6 +786,7 @@ void AndroidSettingsWidget::downloadSdk()
connect(sdkDownloader, &AndroidSdkDownloader::sdkExtracted, this, [this]() {
m_sdkManager->reloadPackages(true);
+ updateUI();
apply();
});
diff --git a/src/plugins/autotest/boost/boosttestsettingspage.cpp b/src/plugins/autotest/boost/boosttestsettingspage.cpp
index 64cd4cc91df..28afad5c159 100644
--- a/src/plugins/autotest/boost/boosttestsettingspage.cpp
+++ b/src/plugins/autotest/boost/boosttestsettingspage.cpp
@@ -36,7 +36,7 @@ namespace Internal {
class BoostTestSettingsWidget : public Core::IOptionsPageWidget
{
- QT_DECLARE_DEPRECATED_TR_FUNCTIONS(Autotest::Internal::BoostTestSettingsWidget)
+ Q_DECLARE_TR_FUNCTIONS(Autotest::Internal::BoostTestSettingsWidget)
public:
explicit BoostTestSettingsWidget(QSharedPointer<BoostTestSettings> settings);
diff --git a/src/plugins/autotest/qtest/qttestparser.cpp b/src/plugins/autotest/qtest/qttestparser.cpp
index 162fed7ec35..564be5df267 100644
--- a/src/plugins/autotest/qtest/qttestparser.cpp
+++ b/src/plugins/autotest/qtest/qttestparser.cpp
@@ -319,7 +319,7 @@ static bool handleQtTest(QFutureInterface<TestParseResultPtr> futureInterface,
QHash<QString, QtTestCodeLocationList> dataTags;
for (const QString &file : files)
- dataTags.unite(checkForDataTags(file, snapshot));
+ Utils::addToHash(&dataTags, checkForDataTags(file, snapshot));
QtTestParseResult *parseResult = new QtTestParseResult(id);
parseResult->itemType = TestTreeItem::TestCase;
diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp
index c1632b5c20b..fa529a902b0 100644
--- a/src/plugins/autotest/testrunner.cpp
+++ b/src/plugins/autotest/testrunner.cpp
@@ -746,7 +746,6 @@ RunConfigurationSelectionDialog::RunConfigurationSelectionDialog(const QString &
QWidget *parent)
: QDialog(parent)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Select Run Configuration"));
QString details = tr("Could not determine which run configuration to choose for running tests");
diff --git a/src/plugins/bazaar/bazaareditor.cpp b/src/plugins/bazaar/bazaareditor.cpp
index 4087bd987c7..ac811b16aa0 100644
--- a/src/plugins/bazaar/bazaareditor.cpp
+++ b/src/plugins/bazaar/bazaareditor.cpp
@@ -29,7 +29,6 @@
#include <utils/qtcassert.h>
-#include <QRegExp>
#include <QString>
#include <QTextCursor>
@@ -46,30 +45,9 @@ BazaarEditorWidget::BazaarEditorWidget() :
setAnnotatePreviousRevisionTextFormat(tr("Annotate &parent revision %1"));
// Diff format:
// === <change> <file|dir> 'mainwindow.cpp'
- setDiffFilePattern(QRegExp(QLatin1String("^=== [a-z]+ [a-z]+ '(.+)'\\s*")));
- setLogEntryPattern(QRegExp(QLatin1String("^revno: (\\d+)")));
-}
-
-QSet<QString> BazaarEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- const QString txt = toPlainText();
- if (txt.isEmpty())
- return changes;
-
- QRegExp changeNumRx(QLatin1String("^(" BZR_CHANGE_PATTERN ") "));
- QTC_ASSERT(changeNumRx.isValid(), return changes);
- if (changeNumRx.indexIn(txt) != -1) {
- changes.insert(changeNumRx.cap(1));
- changeNumRx.setPattern(QLatin1String("\n(" BZR_CHANGE_PATTERN ") "));
- QTC_ASSERT(changeNumRx.isValid(), return changes);
- int pos = 0;
- while ((pos = changeNumRx.indexIn(txt, pos)) != -1) {
- pos += changeNumRx.matchedLength();
- changes.insert(changeNumRx.cap(1));
- }
- }
- return changes;
+ setDiffFilePattern("^=== [a-z]+ [a-z]+ '(.+)'\\s*");
+ setLogEntryPattern("^revno: (\\d+)");
+ setAnnotationEntryPattern("^(" BZR_CHANGE_PATTERN ") ");
}
QString BazaarEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const
diff --git a/src/plugins/bazaar/bazaareditor.h b/src/plugins/bazaar/bazaareditor.h
index 09584462a15..96a9f1610f9 100644
--- a/src/plugins/bazaar/bazaareditor.h
+++ b/src/plugins/bazaar/bazaareditor.h
@@ -40,7 +40,6 @@ public:
BazaarEditorWidget();
private:
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &cursor) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(
const QSet<QString> &changes) const override;
diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp
index 06506cd8bc1..c21f530ade1 100644
--- a/src/plugins/bineditor/bineditorplugin.cpp
+++ b/src/plugins/bineditor/bineditorplugin.cpp
@@ -472,7 +472,7 @@ BinEditorFactory::BinEditorFactory()
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_BINEDITOR_DISPLAY_NAME));
addMimeType(Constants::C_BINEDITOR_MIMETYPE);
- setEditorCreator([] {
+ setEditorCreator([this] {
auto widget = new BinEditorWidget();
auto editor = new BinEditor(widget);
diff --git a/src/plugins/boot2qt/device-detection/qdbwatcher.cpp b/src/plugins/boot2qt/device-detection/qdbwatcher.cpp
index ee2b091fd35..2435dbaea7f 100644
--- a/src/plugins/boot2qt/device-detection/qdbwatcher.cpp
+++ b/src/plugins/boot2qt/device-detection/qdbwatcher.cpp
@@ -62,11 +62,17 @@ void QdbWatcher::start(RequestType requestType)
void QdbWatcher::startPrivate()
{
+ constexpr void (QLocalSocket::*LocalSocketErrorFunction)(QLocalSocket::LocalSocketError)
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ = &QLocalSocket::error;
+#else
+ = &QLocalSocket::errorOccurred;
+#endif
+
m_socket = std::unique_ptr<QLocalSocket>(new QLocalSocket());
connect(m_socket.get(), &QLocalSocket::connected,
this, &QdbWatcher::handleWatchConnection);
- connect(m_socket.get(), static_cast<void (QLocalSocket::*)
- (QLocalSocket::LocalSocketError)>(&QLocalSocket::error),
+ connect(m_socket.get(), LocalSocketErrorFunction,
this, &QdbWatcher::handleWatchError);
m_socket->connectToServer(qdbSocketName);
}
diff --git a/src/plugins/boot2qt/qdbplugin.cpp b/src/plugins/boot2qt/qdbplugin.cpp
index 08ce4785d5b..49aebc378df 100644
--- a/src/plugins/boot2qt/qdbplugin.cpp
+++ b/src/plugins/boot2qt/qdbplugin.cpp
@@ -72,7 +72,7 @@ static void startFlashingWizard()
if (Utils::HostOsInfo::isWindowsHost()) {
if (QProcess::startDetached(QLatin1String("explorer.exe"), {filePath}))
return;
- } else if (QProcess::startDetached(filePath)) {
+ } else if (QProcess::startDetached(filePath, {})) {
return;
}
const QString message =
diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp
index f087f77a948..0a32d3a9297 100644
--- a/src/plugins/clangformat/clangformatutils.cpp
+++ b/src/plugins/clangformat/clangformatutils.cpp
@@ -57,7 +57,11 @@ static clang::format::FormatStyle qtcStyle()
style.AlignOperands = true;
style.AlignTrailingComments = true;
style.AllowAllParametersOfDeclarationOnNextLine = true;
+#if LLVM_VERSION_MAJOR >= 10
+ style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
+#else
style.AllowShortBlocksOnASingleLine = false;
+#endif
style.AllowShortCaseLabelsOnASingleLine = false;
style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
#if LLVM_VERSION_MAJOR >= 9
@@ -72,7 +76,11 @@ static clang::format::FormatStyle qtcStyle()
style.BinPackArguments = false;
style.BinPackParameters = false;
style.BraceWrapping.AfterClass = true;
+#if LLVM_VERSION_MAJOR >= 10
+ style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never;
+#else
style.BraceWrapping.AfterControlStatement = false;
+#endif
style.BraceWrapping.AfterEnum = false;
style.BraceWrapping.AfterFunction = true;
style.BraceWrapping.AfterNamespace = false;
diff --git a/src/plugins/clearcase/clearcaseeditor.cpp b/src/plugins/clearcase/clearcaseeditor.cpp
index bcac505c484..3996d616177 100644
--- a/src/plugins/clearcase/clearcaseeditor.cpp
+++ b/src/plugins/clearcase/clearcaseeditor.cpp
@@ -47,29 +47,11 @@ ClearCaseEditorWidget::ClearCaseEditorWidget() :
// Diff formats:
// "+++ D:\depot\...\mainwindow.cpp@@\main\3" (versioned)
// "+++ D:\depot\...\mainwindow.cpp[TAB]Sun May 01 14:22:37 2011" (local)
- QRegExp diffFilePattern(QLatin1String("^[-+]{3} ([^\\t]+)(?:@@|\\t)"));
- diffFilePattern.setMinimal(true);
- setDiffFilePattern(diffFilePattern);
- setLogEntryPattern(QRegExp(QLatin1String("version \"([^\"]+)\"")));
+ setDiffFilePattern("^[-+]{3} ([^\\t]+?)(?:@@|\\t)");
+ setLogEntryPattern("version \"([^\"]+)\"");
setAnnotateRevisionTextFormat(tr("Annotate version \"%1\""));
-}
-
-QSet<QString> ClearCaseEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- QString txt = toPlainText();
- if (txt.isEmpty())
- return changes;
- // search until header
- int separator = txt.indexOf(QRegExp(QLatin1String("\n-{30}")));
- QRegExp r(QLatin1String("([^|]*)\\|[^\n]*\n"));
- QTC_ASSERT(r.isValid(), return changes);
- int pos = r.indexIn(txt, 0);
- while (pos != -1 && pos < separator) {
- changes.insert(r.cap(1));
- pos = r.indexIn(txt, pos + r.matchedLength());
- }
- return changes;
+ setAnnotationEntryPattern("([^|]*)\\|[^\\n]*\\n");
+ setAnnotationSeparatorPattern("\\n-{30}");
}
QString ClearCaseEditorWidget::changeUnderCursor(const QTextCursor &c) const
@@ -82,8 +64,9 @@ QString ClearCaseEditorWidget::changeUnderCursor(const QTextCursor &c) const
QString change = cursor.selectedText();
// Annotation output has number, log output has revision numbers
// as r1, r2...
- if (m_versionNumberPattern.indexIn(change) != -1)
- return m_versionNumberPattern.cap();
+ const QRegularExpressionMatch match = m_versionNumberPattern.match(change);
+ if (match.hasMatch())
+ return match.captured();
return QString();
}
diff --git a/src/plugins/clearcase/clearcaseeditor.h b/src/plugins/clearcase/clearcaseeditor.h
index 3c9d95fa095..3bab6b13a0a 100644
--- a/src/plugins/clearcase/clearcaseeditor.h
+++ b/src/plugins/clearcase/clearcaseeditor.h
@@ -28,7 +28,7 @@
#include <vcsbase/vcsbaseeditor.h>
-#include <QRegExp>
+#include <QRegularExpression>
namespace ClearCase {
namespace Internal {
@@ -41,12 +41,11 @@ public:
ClearCaseEditorWidget();
private:
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(
const QSet<QString> &changes) const override;
- QRegExp m_versionNumberPattern;
+ const QRegularExpression m_versionNumberPattern;
};
} // namespace Internal
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
index cc8f4a2cf5b..6a7e5196e15 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
@@ -158,7 +158,7 @@ bool CMakeBuildStep::init()
QTC_ASSERT(bc, return false);
if (!bc->isEnabled()) {
emit addTask(BuildSystemTask(Task::Error,
- tr("CMakeProjectManager::CMakeBuildStep")));
+ tr("The build configuration is currently disabled.")));
canInit = false;
}
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
index 9f175a635fb..493939dd89a 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
@@ -26,6 +26,7 @@
#include "cmakebuildsystem.h"
#include "cmakebuildconfiguration.h"
+#include "cmakekitinformation.h"
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
#include "cmakeprojectnodes.h"
@@ -204,10 +205,13 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
connect(project(), &Project::projectFileIsDirty, this, [this]() {
if (m_buildConfiguration->isActive()) {
- qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
- m_buildDirManager
- .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration),
- BuildDirManager::REPARSE_DEFAULT);
+ const auto cmake = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
+ if (cmake && cmake->isAutoRun()) {
+ qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
+ m_buildDirManager.setParametersAndRequestParse(BuildDirParameters(
+ m_buildConfiguration),
+ BuildDirManager::REPARSE_DEFAULT);
+ }
}
});
@@ -269,7 +273,7 @@ QStringList CMakeBuildSystem::filesGeneratedFrom(const QString &sourceFile) cons
QDir srcDirRoot = QDir(project.toString());
QString relativePath = srcDirRoot.relativeFilePath(baseDirectory.toString());
- QDir buildDir = QDir(target()->activeBuildConfiguration()->buildDirectory().toString());
+ QDir buildDir = QDir(buildConfiguration()->buildDirectory().toString());
QString generatedFilePath = buildDir.absoluteFilePath(relativePath);
if (fi.suffix() == "ui") {
diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
index 38cffc30331..dc14c647194 100644
--- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp
@@ -368,7 +368,6 @@ private:
// Disable help button in titlebar on windows:
Qt::WindowFlags flags = changeDialog->windowFlags();
- flags &= ~Qt::WindowContextHelpButtonHint;
flags |= Qt::MSWindowsFixedSizeDialogHint;
changeDialog->setWindowFlags(flags);
diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp
index 13c90abf7c2..83a81f2a70e 100644
--- a/src/plugins/cmakeprojectmanager/fileapireader.cpp
+++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp
@@ -63,18 +63,7 @@ using namespace FileApiDetails;
// FileApiReader:
// --------------------------------------------------------------------
-FileApiReader::FileApiReader()
-{
- connect(Core::EditorManager::instance(),
- &Core::EditorManager::aboutToSave,
- this,
- [this](const Core::IDocument *document) {
- if (m_cmakeFiles.contains(document->filePath())) {
- qCDebug(cmakeFileApiMode) << "FileApiReader: DIRTY SIGNAL";
- emit dirty();
- }
- });
-}
+FileApiReader::FileApiReader() {}
FileApiReader::~FileApiReader()
{
diff --git a/src/plugins/cmakeprojectmanager/servermode.cpp b/src/plugins/cmakeprojectmanager/servermode.cpp
index f9d3c4566e6..ce57e9d9790 100644
--- a/src/plugins/cmakeprojectmanager/servermode.cpp
+++ b/src/plugins/cmakeprojectmanager/servermode.cpp
@@ -207,8 +207,15 @@ void ServerMode::connectToServer()
auto socket = new QLocalSocket(m_cmakeProcess.get());
connect(socket, &QLocalSocket::readyRead, this, &ServerMode::handleRawCMakeServerData);
- connect(socket, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error),
- this, [this, socket]() {
+
+ constexpr void (QLocalSocket::*LocalSocketErrorFunction)(QLocalSocket::LocalSocketError)
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ = &QLocalSocket::error;
+#else
+ = &QLocalSocket::errorOccurred;
+#endif
+
+ connect(socket, LocalSocketErrorFunction, this, [this, socket]() {
reportError(socket->errorString());
m_cmakeSocket = nullptr;
socket->disconnect();
diff --git a/src/plugins/cmakeprojectmanager/servermodereader.cpp b/src/plugins/cmakeprojectmanager/servermodereader.cpp
index 72c85bf271c..f86081bd382 100644
--- a/src/plugins/cmakeprojectmanager/servermodereader.cpp
+++ b/src/plugins/cmakeprojectmanager/servermodereader.cpp
@@ -73,12 +73,6 @@ const int MAX_PROGRESS = 1400;
ServerModeReader::ServerModeReader()
{
- connect(Core::EditorManager::instance(), &Core::EditorManager::aboutToSave,
- this, [this](const Core::IDocument *document) {
- if (m_cmakeFiles.contains(document->filePath()))
- emit dirty();
- });
-
connect(&m_parser, &CMakeParser::addOutput,
this, [](const QString &m) { Core::MessageManager::write(m); });
connect(&m_parser, &CMakeParser::addTask, this, [this](const Task &t) {
@@ -466,10 +460,9 @@ void ServerModeReader::handleProgress(int min, int cur, int max, const QString &
void ServerModeReader::handleSignal(const QString &signal, const QVariantMap &data)
{
+ Q_UNUSED(signal)
Q_UNUSED(data)
- // CMake on Windows sends false dirty signals on each edit (QTCREATORBUG-17944)
- if (!HostOsInfo::isWindowsHost() && signal == "dirty")
- emit dirty();
+ // We do not need to act on fileChanged signals nor on dirty signals!
}
void ServerModeReader::handleServerConnected()
diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
index 7737128f46e..63ea5a66e5b 100644
--- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
+++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp
@@ -64,13 +64,13 @@ namespace Core {
You can specify whether the menu represented by this action container should
be automatically disabled or hidden whenever it only contains disabled items
- and submenus by setting the corresponding
- \l{ActionContainer::setOnAllDisabledBehavior()}{OnAllDisabledBehavior}. The default is
- ActionContainer::Disable for menus, and ActionContainer::Show for menu bars.
+ and submenus by setting the corresponding \l setOnAllDisabledBehavior(). The
+ default is ActionContainer::Disable for menus, and ActionContainer::Show for
+ menu bars.
*/
/*!
- \enum ActionContainer::OnAllDisabledBehavior
+ \enum Core::ActionContainer::OnAllDisabledBehavior
Defines what happens when the represented menu is empty or contains only
disabled or invisible items.
\value Disable
@@ -82,7 +82,7 @@ namespace Core {
*/
/*!
- \fn ActionContainer::setOnAllDisabledBehavior(OnAllDisabledBehavior behavior)
+ \fn Core::ActionContainer::setOnAllDisabledBehavior(OnAllDisabledBehavior behavior)
Defines the \a behavior of the menu represented by this action container for the case
whenever it only contains disabled items and submenus.
The default is ActionContainer::Disable for menus, and ActionContainer::Show for menu bars.
@@ -91,39 +91,39 @@ namespace Core {
*/
/*!
- \fn ActionContainer::onAllDisabledBehavior() const
+ \fn Core::ActionContainer::onAllDisabledBehavior() const
Returns the behavior of the menu represented by this action container for the case
whenever it only contains disabled items and submenus.
The default is ActionContainer::Disable for menus, and ActionContainer::Show for menu bars.
- \sa ActionContainer::OnAllDisabledBehavior
- \sa ActionContainer::setOnAllDisabledBehavior()
+ \sa OnAllDisabledBehavior
+ \sa setOnAllDisabledBehavior()
*/
/*!
- \fn int ActionContainer::id() const
+ \fn int Core::ActionContainer::id() const
\internal
*/
/*!
- \fn QMenu *ActionContainer::menu() const
+ \fn QMenu *Core::ActionContainer::menu() const
Returns the QMenu instance that is represented by this action container, or
0 if this action container represents a menu bar.
*/
/*!
- \fn QMenuBar *ActionContainer::menuBar() const
+ \fn QMenuBar *Core::ActionContainer::menuBar() const
Returns the QMenuBar instance that is represented by this action container, or
0 if this action container represents a menu.
*/
/*!
- \fn QAction *ActionContainer::insertLocation(Id group) const
+ \fn QAction *Core::ActionContainer::insertLocation(Core::Id group) const
Returns an action representing the \a group,
that could be used with \c{QWidget::insertAction}.
*/
/*!
- \fn void ActionContainer::appendGroup(Id group)
+ \fn void Core::ActionContainer::appendGroup(Core::Id group)
Adds \a group to the action container.
Use groups to segment your action container into logical parts. You can add
@@ -133,7 +133,7 @@ namespace Core {
*/
/*!
- \fn void ActionContainer::addAction(Command *action, Id group = Id())
+ \fn void Core::ActionContainer::addAction(Core::Command *action, Core::Id group = Id())
Add the \a action as a menu item to this action container. The action is added as the
last item of the specified \a group.
\sa appendGroup()
@@ -141,7 +141,7 @@ namespace Core {
*/
/*!
- \fn void ActionContainer::addMenu(ActionContainer *menu, Id group = Id())
+ \fn void Core::ActionContainer::addMenu(Core::ActionContainer *menu, Core::Id group = Core::Id())
Add the \a menu as a submenu to this action container. The menu is added as the
last item of the specified \a group.
\sa appendGroup()
@@ -149,7 +149,7 @@ namespace Core {
*/
/*!
- \fn void ActionContainer::addMenu(ActionContainer *before, ActionContainer *menu)
+ \fn void Core::ActionContainer::addMenu(Core::ActionContainer *before, Core::ActionContainer *menu)
Add \a menu as a submenu to this action container before the menu specified
by \a before.
\sa appendGroup()
@@ -157,7 +157,7 @@ namespace Core {
*/
/*!
- \fn ActionContainer::clear()
+ \fn Core::ActionContainer::clear()
Clears this menu and submenus from all actions and submenus. However, does
does not destroy the submenus and commands, just removes them from their
@@ -165,20 +165,20 @@ namespace Core {
*/
/*!
- \fn ActionContainer::insertGroup(Id before, Id group)
+ \fn Core::ActionContainer::insertGroup(Core::Id before, Core::Id group)
Inserts \a group to the action container before the group specified by
\a before.
*/
/*!
- \fn virtual Utils::TouchBar *ActionContainer::touchBar() const
+ \fn virtual Utils::TouchBar *Core::ActionContainer::touchBar() const
Returns the touch bar that is represented by this action container.
*/
/*!
- \fn ActionContainer::addSeparator(const Context &context, Id group, QAction **outSeparator)
+ \fn Core::ActionContainer::addSeparator(const Core::Context &context, Core::Id group, QAction **outSeparator)
Adds a separator to the end of the given \a group to the action container,
which is enabled for a given \a context. Returns the created separator
diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
index 0f25fc4a192..449a0040bcb 100644
--- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp
+++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp
@@ -70,7 +70,7 @@ using namespace Core::Internal;
All actions that are registered with the same Id (but different context lists)
are considered to be overloads of the same command, represented by an instance
- of the Command class.
+ of the Core::Command class.
Exactly only one of the registered actions with the same ID is active at any time.
Which action this is, is defined by the context list that the actions were registered
with:
@@ -141,13 +141,13 @@ using namespace Core::Internal;
*/
/*!
- \fn void ActionManager::commandListChanged()
+ \fn void Core::ActionManager::commandListChanged()
Emitted when the command list has changed.
*/
/*!
- \fn void ActionManager::commandAdded(Core::Id id)
+ \fn void Core::ActionManager::commandAdded(Core::Id id)
Emitted when a command (with the \a id) is added.
*/
diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp
index 2d2eba652db..cd801c1ec2f 100644
--- a/src/plugins/coreplugin/actionmanager/command.cpp
+++ b/src/plugins/coreplugin/actionmanager/command.cpp
@@ -67,7 +67,7 @@
*/
/*!
- \enum Command::CommandAttribute
+ \enum Core::Command::CommandAttribute
This enum defines how the user visible action is updated when the active action changes.
The default is to update the enabled and visible state, and to disable the
user visible action when there is no active action.
@@ -84,37 +84,37 @@
*/
/*!
- \fn void Command::setDefaultKeySequence(const QKeySequence &key)
+ \fn void Core::Command::setDefaultKeySequence(const QKeySequence &key)
Sets the default keyboard shortcut that can be used to activate this command to \a key.
This is used if the user didn't customize the shortcut, or resets the shortcut
to the default one.
*/
/*!
- \fn void Command::defaultKeySequence() const
+ \fn void Core::Command::defaultKeySequence() const
Returns the default keyboard shortcut that can be used to activate this command.
\sa setDefaultKeySequence()
*/
/*!
- \fn void Command::keySequenceChanged()
+ \fn void Core::Command::keySequenceChanged()
Sent when the keyboard shortcut assigned to this Command changes, e.g.
when the user sets it in the keyboard shortcut settings dialog.
*/
/*!
- \fn QKeySequence Command::keySequence() const
+ \fn QKeySequence Core::Command::keySequence() const
Returns the current keyboard shortcut assigned to this Command.
\sa defaultKeySequence()
*/
/*!
- \fn void Command::setKeySequence(const QKeySequence &key)
+ \fn void Core::Command::setKeySequence(const QKeySequence &key)
\internal
*/
/*!
- \fn void Command::setDescription(const QString &text)
+ \fn void Core::Command::setDescription(const QString &text)
Sets the \a text that is used to represent the Command in the
keyboard shortcut settings dialog. If you do not set this,
the current text from the user visible action is taken (which
@@ -122,24 +122,24 @@
*/
/*!
- \fn QString Command::description() const
+ \fn QString Core::Command::description() const
Returns the text that is used to present this Command to the user.
\sa setDescription()
*/
/*!
- \fn int Command::id() const
+ \fn int Core::Command::id() const
\internal
*/
/*!
- \fn QString Command::stringWithAppendedShortcut(const QString &string) const
+ \fn QString Core::Command::stringWithAppendedShortcut(const QString &string) const
Returns the \a string with an appended representation of the keyboard shortcut
that is currently assigned to this Command.
*/
/*!
- \fn QAction *Command::action() const
+ \fn QAction *Core::Command::action() const
Returns the user visible action for this Command.
If the Command represents a shortcut, it returns null.
Use this action to put it on e.g. tool buttons. The action
@@ -152,13 +152,13 @@
*/
/*!
- \fn Context Command::context() const
+ \fn Core::Context Core::Command::context() const
Returns the context for this command.
*/
/*!
- \fn void Command::setAttribute(CommandAttribute attribute)
+ \fn void Core::Command::setAttribute(Core::Command::CommandAttribute attribute)
Adds \a attribute to the attributes of this Command.
\sa CommandAttribute
\sa removeAttribute()
@@ -166,14 +166,14 @@
*/
/*!
- \fn void Command::removeAttribute(CommandAttribute attribute)
+ \fn void Core::Command::removeAttribute(Core::Command::CommandAttribute attribute)
Removes \a attribute from the attributes of this Command.
\sa CommandAttribute
\sa setAttribute()
*/
/*!
- \fn bool Command::hasAttribute(CommandAttribute attribute) const
+ \fn bool Core::Command::hasAttribute(Core::Command::CommandAttribute attribute) const
Returns whether the Command has the \a attribute set.
\sa CommandAttribute
\sa removeAttribute()
@@ -181,54 +181,54 @@
*/
/*!
- \fn bool Command::isActive() const
+ \fn bool Core::Command::isActive() const
Returns whether the Command has an active action or shortcut for the current
context.
*/
/*!
- \fn bool Command::isScriptable() const
+ \fn bool Core::Command::isScriptable() const
Returns whether the Command is scriptable. A scriptable command can be called
from a script without the need for the user to interact with it.
*/
/*!
- \fn bool Command::isScriptable(const Context &) const
+ \fn bool Core::Command::isScriptable(const Core::Context &) const
\internal
Returns whether the Command is scriptable.
*/
/*!
- \fn void Command::activeStateChanged()
+ \fn void Core::Command::activeStateChanged()
This signal is emitted when the active state of the command changes.
*/
/*!
- \fn virtual void Command::setTouchBarText(const QString &text)
+ \fn virtual void Core::Command::setTouchBarText(const QString &text)
Sets the text for the action on the touch bar to \a text.
*/
/*!
- \fn virtual QString Command::touchBarText() const
+ \fn virtual QString Core::Command::touchBarText() const
Returns the text for the action on the touch bar.
*/
/*!
- \fn virtual void Command::setTouchBarIcon(const QIcon &icon)
+ \fn virtual void Core::Command::setTouchBarIcon(const QIcon &icon)
Sets the icon for the action on the touch bar to \a icon.
*/
-/*! \fn virtual QIcon Command::touchBarIcon() const
+/*! \fn virtual QIcon Core::Command::touchBarIcon() const
Returns the icon for the action on the touch bar.
*/
-/*! \fn virtual QAction *Command::touchBarAction() const
+/*! \fn virtual QAction *Core::Command::touchBarAction() const
Adds an action to the touch bar.
*/
diff --git a/src/plugins/coreplugin/basefilewizardfactory.cpp b/src/plugins/coreplugin/basefilewizardfactory.cpp
index 633980bf39c..1abef7c06ff 100644
--- a/src/plugins/coreplugin/basefilewizardfactory.cpp
+++ b/src/plugins/coreplugin/basefilewizardfactory.cpp
@@ -58,20 +58,11 @@ static int indexOfFile(const GeneratedFiles &f, const QString &path)
/*!
\class Core::BaseFileWizard
- \brief The BaseFileWizard class implements a generic wizard for
+ \inmodule QtCreator
+ \brief The BaseFileWizard class implements a is a convenience class for
creating files.
- The following abstract functions must be implemented:
- \list
- \li create(): Called to create the QWizard dialog to be shown.
- \li generateFiles(): Generates file content.
- \endlist
-
- The behaviour can be further customized by overwriting the virtual function \c postGenerateFiles(),
- which is called after generating the files.
-
- \sa Core::GeneratedFile, Core::BaseFileWizardParameters, Core::StandardFileWizard
- \sa Core::Internal::WizardEventLoop
+ \sa Core::BaseFileWizardFactory
*/
Utils::Wizard *BaseFileWizardFactory::runWizardImpl(const QString &path, QWidget *parent,
@@ -98,25 +89,54 @@ Utils::Wizard *BaseFileWizardFactory::runWizardImpl(const QString &path, QWidget
}
/*!
- \fn virtual QWizard *Core::BaseFileWizard::create(QWidget *parent,
- const WizardDialogParameters &parameters) const
+ \class Core::BaseFileWizardFactory
+ \inmodule QtCreator
+ \brief The BaseFileWizardFactory class implements a generic wizard for
+ creating files.
+
+ The following abstract functions must be implemented:
+ \list
+ \li create(): Called to create the QWizard dialog to be shown.
+ \li generateFiles(): Generates file content.
+ \endlist
+
+ The behavior can be further customized by overwriting the virtual function
+ postGenerateFiles(), which is called after generating the files.
+
+ \note Instead of using this class, we recommend that you create JSON-based
+ wizards, as instructed in \l{https://doc.qt.io/qtcreator/creator-project-wizards.html}
+ {Adding New Custom Wizards}.
+
+ \sa Core::GeneratedFile, Core::WizardDialogParameters, Core::BaseFileWizard
+*/
+
+/*!
+ \fn Core::BaseFileWizard *Core::BaseFileWizardFactory::create(QWidget *parent,
+ const Core::WizardDialogParameters &parameters) const
Creates the wizard on the \a parent with the \a parameters.
*/
/*!
- \fn virtual Core::GeneratedFiles Core::BaseFileWizard::generateFiles(const QWizard *w,
- QString *errorMessage) const = 0
- Overwrite to query the parameters from the dialog and generate the files.
+ \fn virtual Core::GeneratedFiles Core::BaseFileWizardFactory::generateFiles(const QWizard *w,
+ QString *errorMessage) const
+ Overwrite to query the parameters from the wizard \a w and generate the
+ files.
+
+ Possible errors are held in \a errorMessage.
\note This does not generate physical files, but merely the list of
Core::GeneratedFile.
*/
/*!
- Physically writes files.
+ Physically writes \a files.
- Re-implement (calling the base implementation) to create files with CustomGeneratorAttribute set.
+ If the files cannot be written, returns \c false and sets \a errorMessage
+ to the message that is displayed to users.
+
+ Re-implement (calling the base implementation) to create files with
+ GeneratedFile::CustomGeneratorAttribute set.
*/
bool BaseFileWizardFactory::writeFiles(const GeneratedFiles &files, QString *errorMessage) const
@@ -131,9 +151,13 @@ bool BaseFileWizardFactory::writeFiles(const GeneratedFiles &files, QString *err
}
/*!
- Overwrite to perform steps to be done after files are actually created.
+ Overwrite to perform steps to be done by the wizard \a w after the files
+ specified by \a l are actually created.
+
+ The default implementation opens editors with the newly generated files
+ that have GeneratedFile::OpenEditorAttribute set.
- The default implementation opens editors with the newly generated files.
+ Returns \a errorMessage if errors occur.
*/
bool BaseFileWizardFactory::postGenerateFiles(const QWizard *, const GeneratedFiles &l,
@@ -143,7 +167,12 @@ bool BaseFileWizardFactory::postGenerateFiles(const QWizard *, const GeneratedFi
}
/*!
- Opens the editors for the files whose attribute is set accordingly.
+ Opens the editors for the files \a l if their
+ GeneratedFile::OpenEditorAttribute attribute
+ is set accordingly.
+
+ If the editorrs cannot be opened, returns \c false and dand sets
+ \a errorMessage to the message that is displayed to users.
*/
bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage)
@@ -163,6 +192,8 @@ bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QSt
/*!
Performs an overwrite check on a set of \a files. Checks if the file exists and
can be overwritten at all, and then prompts the user with a summary.
+
+ Returns \a errorMessage if the file cannot be overwritten.
*/
BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(GeneratedFiles *files,
@@ -243,8 +274,8 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge
}
/*!
- Constructs a file name, adding the \a extension unless \a baseName already has
- one.
+ Constructs a file name including \a path, adding the \a extension unless
+ \a baseName already has one.
*/
QString BaseFileWizardFactory::buildFileName(const QString &path,
@@ -285,14 +316,18 @@ QString BaseFileWizardFactory::preferredSuffix(const QString &mimeType)
}
/*!
- \class Core::StandardFileWizard
- \brief The StandardFileWizard class is a convenience class for
- creating one file.
+ \class Core::WizardDialogParameters
+ \inmodule QtCreator
+ \brief The WizardDialogParameters class holds parameters for the new file
+ wizard dialog.
- It uses Utils::FileWizardDialog and introduces a new virtual to generate the
- files from path and name.
+ \sa Core::GeneratedFile, Core::BaseFileWizardFactory
+*/
- \sa Core::GeneratedFile, Core::BaseFileWizardParameters, Core::BaseFileWizard
+/*!
+ \enum Core::WizardDialogParameters::DialogParameterEnum
+ This enum type holds whether to force capital letters for file names.
+ \value ForceCapitalLetterForFileName Forces capital letters for file names.
*/
} // namespace Core
diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp
index e2d2ea5e9ce..be700875ad4 100644
--- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp
+++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp
@@ -62,26 +62,26 @@ using namespace Utils;
/*!
- \fn Id IOptionsPage::id() const
+ \fn Core::Id Core::IOptionsPage::id() const
Returns a unique identifier for referencing the options page.
*/
/*!
- \fn QString IOptionsPage::displayName() const
+ \fn QString Core::IOptionsPage::displayName() const
Returns the translated display name of the options page.
*/
/*!
- \fn Id IOptionsPage::category() const
+ \fn Core::Id Core::IOptionsPage::category() const
Returns the unique id for the category that the options page should be displayed in. This id is
used for sorting the list on the left side of the \uicontrol Options dialog.
*/
/*!
- \fn QString IOptionsPage::displayCategory() const
+ \fn QString Core::IOptionsPage::displayCategory() const
Returns the translated category name of the options page. This name is displayed in the list on
the left side of the \uicontrol Options dialog.
@@ -168,31 +168,31 @@ void Core::IOptionsPage::setCategoryIconPath(const QString &categoryIconPath)
}
/*!
- \fn void IOptionsPage::setId(Id id)
+ \fn void Core::IOptionsPage::setId(Core::Id id)
Sets the \a id of the options page.
*/
/*!
- \fn void IOptionsPage::setDisplayName(const QString &displayName)
+ \fn void Core::IOptionsPage::setDisplayName(const QString &displayName)
Sets \a displayName as the display name of the options page.
*/
/*!
- \fn void IOptionsPage::setCategory(Id category)
+ \fn void Core::IOptionsPage::setCategory(Core::Id category)
Uses \a category to sort the options pages.
*/
/*!
- \fn void IOptionsPage::setDisplayCategory(const QString &displayCategory)
+ \fn void Core::IOptionsPage::setDisplayCategory(const QString &displayCategory)
Sets \a displayCategory as the display category of the options page.
*/
/*!
- \fn void IOptionsPage::setCategoryIcon(const Utils::Icon &categoryIcon)
+ \fn void Core::IOptionsPage::setCategoryIcon(const Utils::Icon &categoryIcon)
Sets \a categoryIcon as the category icon of the options page.
*/
diff --git a/src/plugins/coreplugin/dialogs/newdialog.cpp b/src/plugins/coreplugin/dialogs/newdialog.cpp
index 261f975cc40..8cb8f1770e8 100644
--- a/src/plugins/coreplugin/dialogs/newdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/newdialog.cpp
@@ -181,8 +181,6 @@ NewDialog::NewDialog(QWidget *parent) :
m_currentDialog = this;
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
- setWindowFlags(windowFlags());
setAttribute(Qt::WA_DeleteOnClose);
ICore::registerWindow(this, Context("Core.NewDialog"));
m_ui->setupUi(this);
diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.cpp b/src/plugins/coreplugin/dialogs/openwithdialog.cpp
index 526a32f7e59..bd3e700a56e 100644
--- a/src/plugins/coreplugin/dialogs/openwithdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/openwithdialog.cpp
@@ -36,7 +36,6 @@ OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent)
: QDialog(parent)
{
setupUi(this);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
label->setText(tr("Open file \"%1\" with:").arg(Utils::FilePath::fromString(fileName).fileName()));
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
diff --git a/src/plugins/coreplugin/dialogs/promptoverwritedialog.cpp b/src/plugins/coreplugin/dialogs/promptoverwritedialog.cpp
index d29c56aef01..ef696df28b6 100644
--- a/src/plugins/coreplugin/dialogs/promptoverwritedialog.cpp
+++ b/src/plugins/coreplugin/dialogs/promptoverwritedialog.cpp
@@ -64,7 +64,6 @@ PromptOverwriteDialog::PromptOverwriteDialog(QWidget *parent) :
{
setWindowTitle(tr("Overwrite Existing Files"));
setModal(true);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto mainLayout = new QVBoxLayout(this);
mainLayout->addWidget(m_label);
m_view->setRootIsDecorated(false);
diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp
index d41445d8f79..697e0a33c2f 100644
--- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp
@@ -163,7 +163,6 @@ ReadOnlyFilesDialog::ReadOnlyFilesDialog(const Utils::FilePaths &filePaths, QWid
: QDialog(parent)
, d(new ReadOnlyFilesDialogPrivate(this))
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
d->initDialog(filePaths);
}
diff --git a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp
index 94c0bbddc16..efeca722731 100644
--- a/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/saveitemsdialog.cpp
@@ -49,7 +49,6 @@ SaveItemsDialog::SaveItemsDialog(QWidget *parent,
: QDialog(parent)
{
m_ui.setupUi(this);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
// QDialogButtonBox's behavior for "destructive" is wrong, the "do not save" should be left-aligned
const QDialogButtonBox::ButtonRole discardButtonRole = Utils::HostOsInfo::isMacHost()
diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp
index 302a5042170..459af08a4ae 100644
--- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp
@@ -450,7 +450,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
m_filterLineEdit->setFiltering(true);
createGui();
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (Utils::HostOsInfo::isMacHost())
setWindowTitle(QCoreApplication::translate("Core::Internal::SettingsDialog", "Preferences"));
else
diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp
index c51dc81a674..aa18827b049 100644
--- a/src/plugins/coreplugin/editormanager/documentmodel.cpp
+++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp
@@ -414,6 +414,18 @@ void DocumentModelPrivate::addEditor(IEditor *editor, bool *isNewDocument)
}
}
+/*!
+ \class Core::DocumentModel
+ \inmodule QtCreator
+ \internal
+*/
+
+/*!
+ \class Core::DocumentModel::Entry
+ \inmodule QtCreator
+ \internal
+*/
+
DocumentModel::Entry *DocumentModelPrivate::addSuspendedDocument(const QString &fileName,
const QString &displayName,
Id id)
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index bae2df0e392..ac4296aea2a 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -133,6 +133,12 @@ using namespace Utils;
//===================EditorManager=====================
+/*!
+ \class Core::EditorManagerPlaceHolder
+ \inmodule QtCreator
+ \internal
+*/
+
EditorManagerPlaceHolder::EditorManagerPlaceHolder(QWidget *parent)
: QWidget(parent)
{
@@ -165,6 +171,68 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *)
// ---------------- EditorManager
+/*!
+ \class Core::EditorManager
+ \inmodule QtCreator
+ \brief The EditorManager class manages the editors created for files
+ according to their MIME type.
+
+ Whenever a user wants to edit or create a file, the EditorManager scans all
+ IEditorFactory interfaces for suitable editors. The selected IEditorFactory
+ is then asked to create an editor, as determined by the MIME type of the
+ file.
+
+ Users can split the editor view or open the editor in a new window when
+ to work on and view multiple files on the same screen or on multiple
+ screens. For more information, see
+ \l{https://doc.qt.io/qtcreator/creator-coding-navigating.html#splitting-the-editor-view}
+ {Splitting the Editor View}.
+*/
+
+/*!
+ \enum Core::MakeWritableResult
+ \internal
+
+ This enum holds whether the document has successfully been made writable.
+
+ \value OpenedWithVersionControl
+ The document was opened under version control.
+ \value MadeWritable
+ The document was made writable.
+ \value SavedAs
+ The document was saved under another name.
+ \value Failed
+ The document cannot be made writable.
+*/
+
+/*!
+ \enum EditorManager::OpenEditorFlag
+
+ This enum holds settings for opening a file in an editor.
+
+ \value NoFlags
+ Does not use any settings.
+ \value DoNotChangeCurrentEditor
+ Does not switch focus to the newly opened editor.
+ \value IgnoreNavigationHistory
+ Does not add an entry to the navigation history for the
+ opened editor.
+ \value DoNotMakeVisible
+ Does not force the editor to become visible.
+ \value CanContainLineAndColumnNumber
+ If the file path contains line and column numbers, opens
+ the file in an editor and jumps to the line and column.
+ \value OpenInOtherSplit
+ Opens the document in another split of the window.
+ \value DoNotSwitchToDesignMode
+ Opens the document in the current mode.
+ \value DoNotSwitchToEditMode
+ Opens the document in the current mode.
+ \value SwitchSplitIfAlreadyVisible
+ Switches to another split if the document is already
+ visible there.
+*/
+
static EditorManager *m_instance = nullptr;
static EditorManagerPrivate *d;
@@ -1634,7 +1702,7 @@ void EditorManagerPrivate::closeView(EditorView *view)
Removes all editors from the view and from the document model, taking care of
the handling of editors that are the last ones for the document.
Returns the list of editors that were actually removed from the document model and
- need to be deleted with EditorManagerPrivate::deleteEditors.
+ need to be deleted with \c EditorManagerPrivate::deleteEditors.
\internal
*/
const QList<IEditor *> EditorManagerPrivate::emptyView(EditorView *view)
@@ -1664,7 +1732,7 @@ const QList<IEditor *> EditorManagerPrivate::emptyView(EditorView *view)
}
/*!
- Signals editorsClosed and deletes the editors.
+ Signals editorsClosed() and deletes the editors.
\internal
*/
void EditorManagerPrivate::deleteEditors(const QList<IEditor *> &editors)
@@ -2412,6 +2480,9 @@ EditorView *EditorManagerPrivate::currentEditorView()
EditorManager *EditorManager::instance() { return m_instance; }
+/*!
+ \internal
+*/
EditorManager::EditorManager(QObject *parent) :
QObject(parent)
{
@@ -2420,28 +2491,46 @@ EditorManager::EditorManager(QObject *parent) :
d->init();
}
+/*!
+ \internal
+*/
EditorManager::~EditorManager()
{
delete d;
m_instance = nullptr;
}
+/*!
+ Returns the document of the currently active editor.
+*/
IDocument *EditorManager::currentDocument()
{
return d->m_currentEditor ? d->m_currentEditor->document() : nullptr;
}
+/*!
+ Returns the currently active editor.
+*/
IEditor *EditorManager::currentEditor()
{
return d->m_currentEditor;
}
+/*!
+ Closes all open editors. If \a askAboutModifiedEditors is \c true, prompts
+ users to save their changes before closing the editors.
+
+ Returns whether all editors were closed.
+*/
bool EditorManager::closeAllEditors(bool askAboutModifiedEditors)
{
DocumentModelPrivate::removeAllSuspendedEntries();
return closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors);
}
+/*!
+ Closes all open documents except \a document and pinned files.
+*/
void EditorManager::closeOtherDocuments(IDocument *document)
{
DocumentModelPrivate::removeAllSuspendedEntries(DocumentModelPrivate::DoNotRemovePinnedFiles);
@@ -2455,6 +2544,11 @@ void EditorManager::closeOtherDocuments(IDocument *document)
closeDocuments(documentsToClose, true);
}
+/*!
+ Closes all open documents except pinned files.
+
+ Returns whether all editors were closed.
+*/
bool EditorManager::closeAllDocuments()
{
// Only close the files that aren't pinned.
@@ -2472,6 +2566,9 @@ void EditorManager::slotCloseCurrentEditorOrDocument()
d->closeEditorOrDocument(d->m_currentEditor);
}
+/*!
+ Closes all open documents except the current document.
+*/
void EditorManager::closeOtherDocuments()
{
closeOtherDocuments(currentDocument());
@@ -2486,6 +2583,10 @@ static void assignAction(QAction *self, QAction *other)
self->setIconVisibleInMenu(other->isIconVisibleInMenu());
}
+/*!
+ Adds save, close and other editor context menu items for the document
+ \a entry and editor \a editor to the context menu \a contextMenu.
+*/
void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentModel::Entry *entry,
IEditor *editor)
{
@@ -2544,6 +2645,10 @@ void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentMod
contextMenu->addAction(d->m_closeAllEditorsExceptVisibleContextAction);
}
+/*!
+ Adds the pin editor menu items for the document \a entry to the context menu
+ \a contextMenu.
+*/
void EditorManager::addPinEditorActions(QMenu *contextMenu, DocumentModel::Entry *entry)
{
const QString quotedDisplayName = entry ? Utils::quoteAmpersands(entry->displayName()) : QString();
@@ -2558,6 +2663,10 @@ void EditorManager::addPinEditorActions(QMenu *contextMenu, DocumentModel::Entry
contextMenu->addAction(d->m_pinAction);
}
+/*!
+ Adds the native directory handling and open with menu items for the document
+ \a entry to the context menu \a contextMenu.
+*/
void EditorManager::addNativeDirAndOpenWithActions(QMenu *contextMenu, DocumentModel::Entry *entry)
{
QTC_ASSERT(contextMenu, return);
@@ -2577,6 +2686,10 @@ void EditorManager::addNativeDirAndOpenWithActions(QMenu *contextMenu, DocumentM
populateOpenWithMenu(openWith, entry->fileName().toString());
}
+/*!
+ Populates the \uicontrol {Open With} menu \a menu with editors that are
+ suitable for opening the document \a fileName.
+*/
void EditorManager::populateOpenWithMenu(QMenu *menu, const QString &fileName)
{
using EditorFactoryList = QList<IEditorFactory*>;
@@ -2616,37 +2729,59 @@ void EditorManager::populateOpenWithMenu(QMenu *menu, const QString &fileName)
menu->setEnabled(anyMatches);
}
+/*!
+ Returns reload behavior settings.
+*/
IDocument::ReloadSetting EditorManager::reloadSetting()
{
return d->m_reloadSetting;
}
+/*!
+ Sets editor reaload behavior settings to \a behavior.
+*/
void EditorManager::setReloadSetting(IDocument::ReloadSetting behavior)
{
d->m_reloadSetting = behavior;
}
+/*!
+ Saves the current document.
+*/
void EditorManager::saveDocument()
{
EditorManagerPrivate::saveDocument(currentDocument());
}
+/*!
+ Saves the current document under a different file name.
+*/
void EditorManager::saveDocumentAs()
{
EditorManagerPrivate::saveDocumentAs(currentDocument());
}
+/*!
+ Reverts the current document to its last saved state.
+*/
void EditorManager::revertToSaved()
{
EditorManagerPrivate::revertToSaved(currentDocument());
}
+/*!
+ Closes \a editor. If \a askAboutModifiedEditors is \c true, prompts
+ users to save their changes before closing the editor.
+*/
void EditorManager::closeEditor(IEditor *editor, bool askAboutModifiedEditors)
{
if (editor)
closeEditors({editor}, askAboutModifiedEditors);
}
+/*!
+ Closes the document specified by \a entry.
+*/
void EditorManager::closeDocument(DocumentModel::Entry *entry)
{
if (!entry)
@@ -2657,6 +2792,11 @@ void EditorManager::closeDocument(DocumentModel::Entry *entry)
closeDocuments({entry->document});
}
+/*!
+ Closes the documents specified by \a entries.
+
+ Returns whether all documents were closed.
+*/
bool EditorManager::closeDocuments(const QList<DocumentModel::Entry *> &entries)
{
QList<IDocument *> documentsToClose;
@@ -2671,6 +2811,13 @@ bool EditorManager::closeDocuments(const QList<DocumentModel::Entry *> &entries)
return closeDocuments(documentsToClose);
}
+/*!
+ Closes the editors specified by \a editorsToClose. If
+ \a askAboutModifiedEditors is \c true, prompts users
+ to save their changes before closing the editor.
+
+ Returns whether all editors were closed.
+*/
bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool askAboutModifiedEditors)
{
return EditorManagerPrivate::closeEditors(editorsToClose,
@@ -2678,12 +2825,20 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask
: EditorManagerPrivate::CloseFlag::CloseWithoutAsking);
}
+/*!
+ Activates the editor for the document specified by \a entry using the editor
+ settings specified by \a flags.
+*/
void EditorManager::activateEditorForEntry(DocumentModel::Entry *entry, OpenEditorFlags flags)
{
EditorManagerPrivate::activateEditorForEntry(EditorManagerPrivate::currentEditorView(),
entry, flags);
}
+/*!
+ Activates the editor \a editor using the editor settings specified by
+ \a flags.
+*/
void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags)
{
QTC_ASSERT(editor, return);
@@ -2694,11 +2849,23 @@ void EditorManager::activateEditor(IEditor *editor, OpenEditorFlags flags)
EditorManagerPrivate::activateEditor(view, editor, flags);
}
+/*!
+ Activates the editor for the document specified by \a document in the
+ current view using the editor settings specified by \a flags.
+*/
IEditor *EditorManager::activateEditorForDocument(IDocument *document, OpenEditorFlags flags)
{
return EditorManagerPrivate::activateEditorForDocument(EditorManagerPrivate::currentEditorView(), document, flags);
}
+/*!
+ Opens the document specified by \a fileName using the editor type specified
+ by \a editorId and the settings specified by \a flags.
+
+ If \a newEditor is not \c nullptr, and a new editor instance was created,
+ it is set to \c true. If an existing editor instance was used, it is set
+ to \c false.
+*/
IEditor *EditorManager::openEditor(const QString &fileName, Id editorId,
OpenEditorFlags flags, bool *newEditor)
{
@@ -2709,6 +2876,15 @@ IEditor *EditorManager::openEditor(const QString &fileName, Id editorId,
fileName, editorId, flags, newEditor);
}
+/*!
+ Opens the document specified by \a fileName to \a line and \a column using
+ the editor type specified by \a editorId and the settings specified by
+ \a flags.
+
+ If \a newEditor is not \c nullptr, and a new editor instance was created,
+ it is set to \c true. If an existing editor instance was used, it is set
+ to \c false.
+*/
IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int column,
Id editorId, OpenEditorFlags flags, bool *newEditor)
{
@@ -2719,6 +2895,10 @@ IEditor *EditorManager::openEditorAt(const QString &fileName, int line, int colu
fileName, line, column, editorId, flags, newEditor);
}
+/*!
+ Opens the document at the position of the search hit \a item in the editor
+ using the settings specified by \a flags.
+*/
void EditorManager::openEditorAtSearchResult(const SearchResultItem &item, OpenEditorFlags flags)
{
if (item.path.empty()) {
@@ -2730,6 +2910,14 @@ void EditorManager::openEditorAtSearchResult(const SearchResultItem &item, OpenE
item.mainRange.begin.column, Id(), flags);
}
+/*!
+ Returns the file path \a fullFilePath with appended line and column
+ information split into file path, line, and column components.
+
+ The following patterns are supported: \c {filepath.txt:19},
+ \c{filepath.txt:19:12}, \c {filepath.txt+19},
+ \c {filepath.txt+19+12}, and \c {filepath.txt(19)}.
+*/
EditorManager::FilePathInfo EditorManager::splitLineAndColumnNumber(const QString &fullFilePath)
{
// :10:2 GCC/Clang-style
@@ -2760,11 +2948,21 @@ EditorManager::FilePathInfo EditorManager::splitLineAndColumnNumber(const QStrin
return {filePath, postfix, line, column};
}
+/*!
+ Returns whether \a fileName is an auto-save file created by \QC.
+*/
bool EditorManager::isAutoSaveFile(const QString &fileName)
{
return fileName.endsWith(".autosave");
}
+/*!
+ Opens the document specified by \a fileName in the external editor specified
+ by \a editorId.
+
+ If \a editorId is not the ID of an external editor or the external editor
+ cannot be opened, returns \c false and displays an error message.
+*/
bool EditorManager::openExternalEditor(const QString &fileName, Id editorId)
{
IExternalEditor *ee = Utils::findOrDefault(IExternalEditor::allExternalEditors(),
@@ -2781,21 +2979,23 @@ bool EditorManager::openExternalEditor(const QString &fileName, Id editorId)
}
/*!
- \fn EditorManager::addCloseEditorListener
-
- \brief The \c EditorManager::addCloseEditorListener function provides
- a hook for plugins to veto on closing editors.
+ Provides a hook for plugins to veto on closing editors.
- When an editor requests a close, all listeners are called. If one of these
- calls returns \c false, the process is aborted and the event is ignored.
- If all calls return \c true, \c EditorManager::editorAboutToClose()
- is emitted and the event is accepted.
+ When an editor requests a close, all listeners are called. If one of the
+ \a listener calls returns \c false, the process is aborted and the event is ignored.
+ If all calls return \c true, editorAboutToClose() is emitted and the event
+ is accepted.
*/
void EditorManager::addCloseEditorListener(const std::function<bool (IEditor *)> &listener)
{
d->m_closeEditorListeners.append(listener);
}
+/*!
+ Asks the user for a list of files to open and returns the choice.
+
+ \sa QFileDialog::getOpenFileNames()
+*/
QStringList EditorManager::getOpenFileNames()
{
QString selectedFilter;
@@ -2836,6 +3036,17 @@ static QString makeTitleUnique(QString *titlePattern)
return title;
}
+/*!
+ Opens \a contents in an editor of the type \a editorId using the settings
+ specified by \a flags.
+
+ The editor is given a display name based on \a titlePattern. If a
+ non-empty \a uniqueId is specified and an editor with that unique
+ ID is found, it is re-used. Otherwise, a new editor with that
+ unique ID is created.
+
+ Returns the new or re-used editor.
+*/
IEditor *EditorManager::openEditorWithContents(Id editorId,
QString *titlePattern,
const QByteArray &contents,
@@ -2894,21 +3105,41 @@ IEditor *EditorManager::openEditorWithContents(Id editorId,
return edt;
}
+/*!
+ Returns whether the document specified by \a filePath should be opened even
+ though it is big. Depending on the settings, might ask the user to decide
+ whether the file should be opened.
+
+ Returns the path to the file that was skipped.
+*/
bool EditorManager::skipOpeningBigTextFile(const QString &filePath)
{
return EditorManagerPrivate::skipOpeningBigTextFile(filePath);
}
+/*!
+ Clears the unique ID of \a document.
+
+ \sa openEditorWithContents()
+*/
void EditorManager::clearUniqueId(IDocument *document)
{
document->setProperty(scratchBufferKey, QVariant());
}
+/*!
+ Saves the changes in \a document.
+
+ Returns whether the operation was successful.
+*/
bool EditorManager::saveDocument(IDocument *document)
{
return EditorManagerPrivate::saveDocument(document);
}
+/*!
+ \internal
+*/
bool EditorManager::hasSplitter()
{
EditorView *view = EditorManagerPrivate::currentEditorView();
@@ -2918,6 +3149,9 @@ bool EditorManager::hasSplitter()
return area->isSplitter();
}
+/*!
+ Returns the list of visible editors.
+*/
QList<IEditor*> EditorManager::visibleEditors()
{
QList<IEditor *> editors;
@@ -2941,22 +3175,41 @@ QList<IEditor*> EditorManager::visibleEditors()
return editors;
}
+/*!
+ Closes \a document. If \a askAboutModifiedEditors is \c true, prompts
+ users to save their changes before closing the document.
+
+ Returns whether the document was closed.
+*/
bool EditorManager::closeDocument(IDocument *document, bool askAboutModifiedEditors)
{
return closeDocuments({document}, askAboutModifiedEditors);
}
+/*!
+ Closes \a documents. If \a askAboutModifiedEditors is \c true, prompts
+ users to save their changes before closing the documents.
+
+ Returns whether the documents were closed.
+*/
bool EditorManager::closeDocuments(const QList<IDocument *> &documents, bool askAboutModifiedEditors)
{
return m_instance->closeEditors(DocumentModel::editorsForDocuments(documents), askAboutModifiedEditors);
}
+/*!
+ Adds the current cursor position to the navigation history specified by
+ \a saveState.
+*/
void EditorManager::addCurrentPositionToNavigationHistory(const QByteArray &saveState)
{
EditorManagerPrivate::currentEditorView()->addCurrentPositionToNavigationHistory(saveState);
EditorManagerPrivate::updateActions();
}
+/*!
+ Sets the location that was last modified to \a editor.
+*/
void EditorManager::setLastEditLocation(const IEditor* editor)
{
IDocument *document = editor->document();
@@ -2973,12 +3226,18 @@ void EditorManager::setLastEditLocation(const IEditor* editor)
d->m_globalLastEditLocation = location;
}
+/*!
+ Cuts forward in the navigation history.
+*/
void EditorManager::cutForwardNavigationHistory()
{
EditorManagerPrivate::currentEditorView()->cutForwardNavigationHistory();
EditorManagerPrivate::updateActions();
}
+/*!
+ Goes back in the navigation history.
+*/
void EditorManager::goBackInNavigationHistory()
{
EditorManagerPrivate::currentEditorView()->goBackInNavigationHistory();
@@ -2986,6 +3245,9 @@ void EditorManager::goBackInNavigationHistory()
return;
}
+/*!
+ Goes forward in the navigation history.
+*/
void EditorManager::goForwardInNavigationHistory()
{
EditorManagerPrivate::currentEditorView()->goForwardInNavigationHistory();
@@ -3006,7 +3268,9 @@ QVector<EditorWindow *> editorWindows(const QList<EditorArea *> &areas)
return result;
}
-// Save state of all non-temporary editors.
+/*!
+ Returns the serialized state of all non-temporary editors.
+*/
QByteArray EditorManager::saveState()
{
QByteArray bytes;
@@ -3053,6 +3317,11 @@ QByteArray EditorManager::saveState()
return bytes;
}
+/*!
+ Restores the editor to \a state.
+
+ Returns \c true if the editor state can be restored.
+*/
bool EditorManager::restoreState(const QByteArray &state)
{
closeAllEditors(true);
@@ -3132,6 +3401,10 @@ bool EditorManager::restoreState(const QByteArray &state)
return true;
}
+/*!
+ Shows the editor status bar \a object with the \a id, \a infoText,
+ \a buttonText, and \a function.
+*/
void EditorManager::showEditorStatusBar(const QString &id,
const QString &infoText,
const QString &buttonText,
@@ -3143,12 +3416,18 @@ void EditorManager::showEditorStatusBar(const QString &id,
id, infoText, buttonText, object, function);
}
+/*!
+ Hides the editor status bar specified by \a id.
+*/
void EditorManager::hideEditorStatusBar(const QString &id)
{
// TODO: what if the current editor view betwenn show and hideEditorStatusBar changed?
EditorManagerPrivate::currentEditorView()->hideEditorStatusBar(id);
}
+/*!
+ Returns the default text codec for the locale.
+*/
QTextCodec *EditorManager::defaultTextCodec()
{
QSettings *settings = ICore::settings();
@@ -3167,6 +3446,9 @@ QTextCodec *EditorManager::defaultTextCodec()
return QTextCodec::codecForLocale();
}
+/*!
+ Returns the default line ending as the user specified in the settings.
+*/
TextFileFormat::LineTerminationMode EditorManager::defaultLineEnding()
{
QSettings *settings = ICore::settings();
@@ -3176,13 +3458,16 @@ TextFileFormat::LineTerminationMode EditorManager::defaultLineEnding()
return static_cast<TextFileFormat::LineTerminationMode>(defaultLineTerminator);
}
+/*!
+ Splits the editor view horizontally into adjacent views.
+*/
void EditorManager::splitSideBySide()
{
EditorManagerPrivate::split(Qt::Horizontal);
}
/*!
- * Moves focus to "other" split, possibly creating a split if necessary.
+ * Moves focus to another split, creating it if necessary.
* If there's no split and no other window, a side-by-side split is created.
* If the current window is split, focus is moved to the next split within this window, cycling.
* If the current window is not split, focus is moved to the next window.
@@ -3227,16 +3512,25 @@ void EditorManager::gotoOtherSplit()
EditorManagerPrivate::activateView(nextView);
}
+/*!
+ Returns the maximum file size.
+*/
qint64 EditorManager::maxTextFileSize()
{
return qint64(3) << 24;
}
+/*!
+ Sets the window title addition handler to \a handler.
+*/
void EditorManager::setWindowTitleAdditionHandler(WindowTitleHandler handler)
{
d->m_titleAdditionHandler = handler;
}
+/*!
+ Sets the session title addition handler to \a handler.
+*/
void EditorManager::setSessionTitleHandler(WindowTitleHandler handler)
{
d->m_sessionTitleHandler = handler;
diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h
index 205bd7a82d3..0cf3412442f 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.h
+++ b/src/plugins/coreplugin/editormanager/editormanager.h
@@ -149,7 +149,7 @@ public:
const QString &infoText,
const QString &buttonText = QString(),
QObject *object = nullptr,
- const std::function<void()> &function = nullptr);
+ const std::function<void()> &function = {});
static void hideEditorStatusBar(const QString &id);
static bool isAutoSaveFile(const QString &fileName);
diff --git a/src/plugins/coreplugin/editormanager/ieditor.cpp b/src/plugins/coreplugin/editormanager/ieditor.cpp
index 6df855ad517..c79fa6ade09 100644
--- a/src/plugins/coreplugin/editormanager/ieditor.cpp
+++ b/src/plugins/coreplugin/editormanager/ieditor.cpp
@@ -27,43 +27,95 @@
/*!
\class Core::IEditor
- \brief The IEditor class is an interface for providing different editors for
- different file types.
+ \inmodule QtCreator
+ \brief The IEditor class is an interface for providing suitable editors for
+ documents according to their MIME type.
Classes that implement this interface are for example the editors for
- C++ files, UI files and resource files.
-
- Whenever a user wants to edit or create a file, the EditorManager scans all
- EditorFactoryInterfaces for suitable editors. The selected EditorFactory
- is then asked to create an editor, which must implement this interface.
-
- Guidelines for implementing:
- \list
- \li \c displayName() is used as a user visible description of the document
- (usually filename w/o path).
- \li \c kind() must be the same value as the \c kind() of the corresponding
- EditorFactory.
- \li If duplication is supported, you need to ensure that all duplicates
- return the same \c file().
- \li QString \c preferredMode() const is the mode the editor manager should
- activate. Some editors use a special mode (such as \gui Design mode).
- \endlist
-
- \sa Core::EditorFactoryInterface Core::IContext
+ C++ files, UI files, and resource files.
+ Whenever a user wants to edit or create a document, the EditorManager
+ scans all IEditorFactory interfaces for suitable editors. The selected
+ IEditorFactory is then asked to create an editor, which must implement
+ this interface.
+
+ \sa Core::IEditorFactory, Core::EditorManager
+*/
+
+/*!
+ \fn Core::IDocument *Core::IEditor::document() const
+ Returns the document to open in an editor.
+*/
+
+/*!
+ \fn Core::IEditor *Core::IEditor::duplicate()
+ Duplicates the editor.
+
+ \sa duplicateSupported()
+*/
+
+/*!
+ \fn QByteArray Core::IEditor::saveState() const
+ Saves the state of the document.
+*/
+
+/*!
+ \fn bool Core::IEditor::restoreState(const QByteArray &state)
+ Restores the \a state of the document.
+
+ Returns \c true on success.
+*/
+
+/*!
+ \fn int Core::IEditor::currentLine() const
+ Returns the current line in the document.
+*/
+
+/*!
+ \fn int Core::IEditor::currentColumn() const
+ Returns the current column in the document.
+*/
+
+/*!
+ \fn void Core::IEditor::gotoLine(int line, int column = 0, bool centerLine = true)
+ Goes to \a line and \a column in the document. If \a centerLine is
+ \c true, centers the line in the editor.
+*/
+
+/*!
+ \fn QWidget Core::IEditor::toolBar()
+ Returns the toolbar for the editor.
+
+ The editor toolbar is located at the top of the editor view. The editor
+ toolbar is context sensitive and shows items relevant to the document
+ currently open in the editor.
+*/
+
+/*! \fn bool Core::IEditor::isDesignModePreferred() const
+ Indicates whether the document should be opened in the Design mode.
+ Returns \c false unless Design mode is preferred.
*/
namespace Core {
+/*!
+ \internal
+*/
IEditor::IEditor(QObject *parent)
: IContext(parent), m_duplicateSupported(false)
{}
+/*!
+ Returns whether duplication is supported.
+*/
bool IEditor::duplicateSupported() const
{
return m_duplicateSupported;
}
+/*!
+ Sets whether duplication is supported to \a duplicatesSupported.
+*/
void IEditor::setDuplicateSupported(bool duplicatesSupported)
{
m_duplicateSupported = duplicatesSupported;
diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp
index 85cceacc03b..69704527952 100644
--- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp
+++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp
@@ -34,19 +34,86 @@
namespace Core {
+/*!
+ \class Core::IEditorFactory
+ \inmodule QtCreator
+ \brief The IEditorFactory class creates suitable editors for documents
+ according to their MIME type.
+
+ Whenever a user wants to edit or create a document, the EditorManager
+ scans all IEditorFactory interfaces for suitable editors. The selected
+ IEditorFactory is then asked to create an editor.
+
+ Guidelines for the implementation:
+
+ \list
+ \li displayName() is used as a user visible description of the editor
+ type that is created. For example, the name displayed in the
+ \uicontrol {Open With} menu.
+ \li If duplication is supported (IEditor::duplicateSupported()), you
+ need to ensure that all duplicates return the same document().
+ \endlist
+
+ \sa Core::IEditor, Core::EditorManager
+*/
+
+/*!
+ \fn void Core::IEditorFactory::addMimeType(const QString &mimeType)
+ Adds \a mimeType to the list of MIME types supported by this editor type.
+*/
+
+/*!
+ \fn QString Core::IEditorFactory::displayName() const
+ Returns a user-visible description of the editor type.
+*/
+
+/*!
+ \fn Core::Id Core::IEditorFactory::id() const
+ Returns the ID of the factory or editor type.
+*/
+
+/*!
+ \fn QString Core::IEditorFactory::mimeTypes() const
+ Returns a list of MIME types that the editor supports.
+*/
+
+/*!
+ \fn void Core::IEditorFactory::setDisplayName(const QString &displayName)
+ Sets the \a displayName of the factory or editor type.
+*/
+
+/*!
+ \fn void Core::IEditorFactory::setId(Id id)
+ Sets the \a id of the factory or editor type.
+*/
+
+/*!
+ \fn void Core::IEditorFactory::setMimeTypes(const QStringList &mimeTypes)
+ Sets the MIME types supported by the editor to \a mimeTypes.
+*/
+
static QList<IEditorFactory *> g_editorFactories;
static QHash<Utils::MimeType, IEditorFactory *> g_userPreferredEditorFactories;
+/*!
+ \internal
+*/
IEditorFactory::IEditorFactory()
{
g_editorFactories.append(this);
}
+/*!
+ \internal
+*/
IEditorFactory::~IEditorFactory()
{
g_editorFactories.removeOne(this);
}
+/*!
+ \internal
+*/
const EditorFactoryList IEditorFactory::allEditorFactories()
{
return g_editorFactories;
@@ -54,7 +121,7 @@ const EditorFactoryList IEditorFactory::allEditorFactories()
/*!
Returns all available editors for this \a mimeType in the default order
- (editors ordered by mime type hierarchy).
+ (editors ordered by MIME type hierarchy).
*/
const EditorFactoryList IEditorFactory::defaultEditorFactories(const Utils::MimeType &mimeType)
{
@@ -66,9 +133,9 @@ const EditorFactoryList IEditorFactory::defaultEditorFactories(const Utils::Mime
/*!
Returns the available editors for \a fileName in order of preference.
- That is the default order for the file's MIME type but with a user overridden default
- editor first, and if the file is a too large text file, with the binary editor as the
- very first.
+ That is the default order for the document's MIME type but with a user
+ overridden default editor first, and if the document is a too large
+ text file, with the binary editor as the very first.
*/
const EditorFactoryList IEditorFactory::preferredEditorFactories(const QString &fileName)
{
@@ -95,22 +162,38 @@ const EditorFactoryList IEditorFactory::preferredEditorFactories(const QString &
return factories;
}
+/*!
+ Creates an editor.
+
+ Either override this in a subclass, or set the function to use for
+ creating an editor instance with setEditorCreator().
+*/
IEditor *IEditorFactory::createEditor() const
{
QTC_ASSERT(m_creator, return nullptr);
return m_creator();
}
+/*!
+ Sets the function that is used to create an editor instance in
+ createEditor() by default to \a creator.
+*/
void IEditorFactory::setEditorCreator(const std::function<IEditor *()> &creator)
{
m_creator = creator;
}
+/*!
+ \internal
+*/
QHash<Utils::MimeType, Core::IEditorFactory *> Core::Internal::userPreferredEditorFactories()
{
return g_userPreferredEditorFactories;
}
+/*!
+ \internal
+*/
void Internal::setUserPreferredEditorFactories(const QHash<Utils::MimeType, IEditorFactory *> &factories)
{
g_userPreferredEditorFactories = factories;
diff --git a/src/plugins/coreplugin/editormanager/iexternaleditor.cpp b/src/plugins/coreplugin/editormanager/iexternaleditor.cpp
index 9fdb561587f..dd9ef3c309e 100644
--- a/src/plugins/coreplugin/editormanager/iexternaleditor.cpp
+++ b/src/plugins/coreplugin/editormanager/iexternaleditor.cpp
@@ -31,25 +31,31 @@ namespace Core {
/*!
\class Core::IExternalEditor
- \mainclass
+ \inmodule QtCreator
+ \ingroup mainclasses
\brief The IExternalEditor class enables registering an external
- editor in the \gui{Open With} dialog.
+ editor in the \uicontrol{Open With} dialog.
*/
/*!
- \fn IExternalEditor::IExternalEditor(QObject *parent)
- \internal
+ \fn QString Core::IExternalEditor::displayName() const
+ Returns a user-visible description of the editor type.
+*/
+
+/*!
+ \fn Core::Id Core::IExternalEditor::id() const
+ Returns the ID of the factory or editor type.
*/
/*!
- \fn QStringList IExternalEditor::mimeTypes() const
- Returns the mime type the editor supports
+ \fn QStringList Core::IExternalEditor::mimeTypes() const
+ Returns a list of MIME types that the editor supports
*/
/*!
- \fn bool IExternalEditor::startEditor(const QString &fileName, QString *errorMessage) = 0;
+ \fn bool Core::IExternalEditor::startEditor(const QString &fileName, QString *errorMessage) = 0;
Opens the editor with \a fileName. Returns \c true on success or \c false
on failure along with the error in \a errorMessage.
@@ -57,22 +63,35 @@ namespace Core {
static QList<IExternalEditor *> g_externalEditors;
+/*!
+ \internal
+*/
IExternalEditor::IExternalEditor(QObject *parent)
: QObject(parent)
{
g_externalEditors.append(this);
}
+/*!
+ \internal
+*/
IExternalEditor::~IExternalEditor()
{
g_externalEditors.removeOne(this);
}
+/*!
+ Returns all available external editors.
+*/
const ExternalEditorList IExternalEditor::allExternalEditors()
{
return g_externalEditors;
}
+/*!
+ Returns all external editors available for this \a mimeType in the default
+ order (editors ordered by MIME type hierarchy).
+*/
const ExternalEditorList IExternalEditor::externalEditors(const Utils::MimeType &mimeType)
{
ExternalEditorList rc;
diff --git a/src/plugins/coreplugin/externaltool.cpp b/src/plugins/coreplugin/externaltool.cpp
index 97e0e003be1..f6e8b039787 100644
--- a/src/plugins/coreplugin/externaltool.cpp
+++ b/src/plugins/coreplugin/externaltool.cpp
@@ -666,8 +666,8 @@ void ExternalToolRunner::run()
const CommandLine cmd{m_resolvedExecutable, m_resolvedArguments, CommandLine::Raw};
m_process->setCommand(cmd);
m_process->setEnvironment(m_resolvedEnvironment);
- MessageManager::write(tr("Starting external tool \"%1\"")
- .arg(cmd.toUserOutput()), MessageManager::Silent);
+ MessageManager::writeWithTime(tr("Starting external tool \"%1\"")
+ .arg(cmd.toUserOutput()), MessageManager::Silent);
m_process->start();
}
@@ -687,8 +687,8 @@ void ExternalToolRunner::finished(int exitCode, QProcess::ExitStatus status)
}
if (m_tool->modifiesCurrentDocument())
DocumentManager::unexpectFileChange(m_expectedFileName);
- MessageManager::write(tr("\"%1\" finished")
- .arg(m_resolvedExecutable.toUserOutput()), MessageManager::Silent);
+ MessageManager::writeWithTime(tr("\"%1\" finished")
+ .arg(m_resolvedExecutable.toUserOutput()), MessageManager::Silent);
deleteLater();
}
diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp
index 2d3cb7de0b5..71bc7687e8a 100644
--- a/src/plugins/coreplugin/find/basetextfind.cpp
+++ b/src/plugins/coreplugin/find/basetextfind.cpp
@@ -92,7 +92,7 @@ BaseTextFindPrivate::BaseTextFindPrivate(QPlainTextEdit *editor)
*/
/*!
- \fn void BaseTextFind::findScopeChanged(const QTextCursor &start,
+ \fn void Core::BaseTextFind::findScopeChanged(const QTextCursor &start,
const QTextCursor &end,
int verticalBlockSelectionFirstColumn,
int verticalBlockSelectionLastColumn)
@@ -104,7 +104,7 @@ BaseTextFindPrivate::BaseTextFindPrivate(QPlainTextEdit *editor)
*/
/*!
- \fn void BaseTextFind::highlightAllRequested(const QString &txt, Core::FindFlags findFlags)
+ \fn void Core::BaseTextFind::highlightAllRequested(const QString &txt, Core::FindFlags findFlags)
This signal is emitted when the search results for \a txt using the given
\a findFlags should be highlighted in the editor widget.
diff --git a/src/plugins/coreplugin/find/ifindfilter.cpp b/src/plugins/coreplugin/find/ifindfilter.cpp
index fef203a1f8c..b61d935e607 100644
--- a/src/plugins/coreplugin/find/ifindfilter.cpp
+++ b/src/plugins/coreplugin/find/ifindfilter.cpp
@@ -99,14 +99,14 @@
/*!
- \fn QString IFindFilter::id() const
+ \fn QString Core::IFindFilter::id() const
Returns the unique string identifier for this find filter.
Usually should be something like "MyPlugin.MyFindFilter".
*/
/*!
- \fn QString IFindFilter::displayName() const
+ \fn QString Core::IFindFilter::displayName() const
Returns the name of the find filter or scope as presented to the user.
This is the name that appears in the scope selection combo box, for example.
@@ -115,7 +115,7 @@
*/
/*!
- \fn bool IFindFilter::isEnabled() const
+ \fn bool Core::IFindFilter::isEnabled() const
Returns whether the user should be able to select this find filter
at the moment.
@@ -127,14 +127,14 @@
*/
/*!
- \fn bool IFindFilter::isValid() const
+ \fn bool Core::IFindFilter::isValid() const
Returns whether the find filter is valid.
\sa validChanged()
*/
/*!
- \fn bool IFindFilter::isReplaceSupported() const
+ \fn bool Core::IFindFilter::isReplaceSupported() const
Returns whether the find filter supports search and replace.
The default value is false, override this function to return \c true, if
@@ -142,7 +142,7 @@
*/
/*!
- \fn bool IFindFilter::showSearchTermInput() const
+ \fn bool Core::IFindFilter::showSearchTermInput() const
Returns whether the find filter wants to show the search term line edit.
The default value is \c true, override this function to return \c false, if
@@ -150,7 +150,7 @@
*/
/*!
- \fn void IFindFilter::findAll(const QString &txt, FindFlags findFlags)
+ \fn void Core::IFindFilter::findAll(const QString &txt, Core::FindFlags findFlags)
This function is called when the user selected this find scope and
initiated a search.
@@ -167,7 +167,7 @@
*/
/*!
- \fn void IFindFilter::replaceAll(const QString &txt, FindFlags findFlags)
+ \fn void Core::IFindFilter::replaceAll(const QString &txt, Core::FindFlags findFlags)
Override this function if you want to support search and replace.
This function is called when the user selected this find scope and
@@ -187,7 +187,7 @@
*/
/*!
- \fn QWidget *IFindFilter::createConfigWidget()
+ \fn QWidget *Core::IFindFilter::createConfigWidget()
Returns a widget that contains additional controls for options
for this find filter.
@@ -196,32 +196,32 @@
*/
/*!
- \fn void IFindFilter::writeSettings(QSettings *settings)
+ \fn void Core::IFindFilter::writeSettings(QSettings *settings)
Called at shutdown to write the state of the additional options
for this find filter to the \a settings.
*/
/*!
- \fn void IFindFilter::readSettings(QSettings *settings)
+ \fn void Core::IFindFilter::readSettings(QSettings *settings)
Called at startup to read the state of the additional options
for this find filter from the \a settings.
*/
/*!
- \fn void IFindFilter::enabledChanged(bool enabled)
+ \fn void Core::IFindFilter::enabledChanged(bool enabled)
This signal is emitted when the \a enabled state of this find filter
changes.
*/
/*!
- \fn void IFindFilter::validChanged(bool valid)
+ \fn void Core::IFindFilter::validChanged(bool valid)
This signal is emitted when the \a valid state of this find filter changes.
*/
/*!
- \fn void IFindFilter::displayNameChanged()
+ \fn void Core::IFindFilter::displayNameChanged()
This signal is emitted when the display name of this find filter changes.
*/
diff --git a/src/plugins/coreplugin/find/ifindsupport.cpp b/src/plugins/coreplugin/find/ifindsupport.cpp
index f36bea2146d..ffd671e94be 100644
--- a/src/plugins/coreplugin/find/ifindsupport.cpp
+++ b/src/plugins/coreplugin/find/ifindsupport.cpp
@@ -40,7 +40,7 @@ using namespace Core;
*/
/*!
- \enum IFindSupport::Result
+ \enum Core::IFindSupport::Result
This enum holds whether the search term was found within the search scope
using the find flags.
@@ -50,22 +50,22 @@ using namespace Core;
*/
/*!
- \fn IFindSupport::IFindSupport()
+ \fn Core::IFindSupport::IFindSupport()
\internal
*/
/*!
- \fn IFindSupport::~IFindSupport()
+ \fn Core::IFindSupport::~IFindSupport()
\internal
*/
/*!
- \fn bool IFindSupport::supportsReplace() const
+ \fn bool Core::IFindSupport::supportsReplace() const
Returns whether the find filter supports search and replace.
*/
/*!
- \fn FindFlags IFindSupport::supportedFindFlags() const
+ \fn Core::FindFlags Core::IFindSupport::supportedFindFlags() const
Returns the find flags, such as whole words or regular expressions,
that this find filter supports.
@@ -78,52 +78,52 @@ using namespace Core;
*/
/*!
- \fn void IFindSupport::resetIncrementalSearch()
+ \fn void Core::IFindSupport::resetIncrementalSearch()
Resets incremental search to start position.
*/
/*!
- \fn void IFindSupport::clearHighlights()
+ \fn void Core::IFindSupport::clearHighlights()
Clears highlighting of search results in the searched widget.
*/
/*!
- \fn QString IFindSupport::currentFindString() const
+ \fn QString Core::IFindSupport::currentFindString() const
Returns the current search string.
*/
/*!
- \fn QString IFindSupport::completedFindString() const
+ \fn QString Core::IFindSupport::completedFindString() const
Returns the complete search string.
*/
/*!
- \fn void IFindSupport::highlightAll(const QString &txt, FindFlags findFlags)
+ \fn void Core::IFindSupport::highlightAll(const QString &txt, Core::FindFlags findFlags)
Highlights all search hits for \a txt when using \a findFlags.
*/
/*!
- \fn Result IFindSupport::findIncremental(const QString &txt, FindFlags findFlags)
+ \fn Core::IFindSupport::Result Core::IFindSupport::findIncremental(const QString &txt, Core::FindFlags findFlags)
Performs an incremental search of the search term \a txt using \a findFlags.
*/
/*!
- \fn Result IFindSupport::findStep(const QString &txt, FindFlags findFlags)
+ \fn Core::IFindSupport::Result Core::IFindSupport::findStep(const QString &txt, Core::FindFlags findFlags)
Searches for \a txt using \a findFlags.
*/
/*!
- \fn void IFindSupport::defineFindScope()
+ \fn void Core::IFindSupport::defineFindScope()
Defines the find scope.
*/
/*!
- \fn void IFindSupport::clearFindScope()
+ \fn void Core::IFindSupport::clearFindScope()
Clears the find scope.
*/
/*!
- \fn void IFindSupport::changed()
+ \fn void Core::IFindSupport::changed()
This signal is emitted when the search changes.
*/
diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp
index a9895f720c8..8f973dbe4c4 100644
--- a/src/plugins/coreplugin/find/searchresultwindow.cpp
+++ b/src/plugins/coreplugin/find/searchresultwindow.cpp
@@ -270,13 +270,13 @@ using namespace Core::Internal;
*/
/*!
- \fn void SearchResult::activated(const Core::SearchResultItem &item)
+ \fn void Core::SearchResult::activated(const Core::SearchResultItem &item)
Indicates that the user activated the search result \a item by
double-clicking it, for example.
*/
/*!
- \fn void SearchResult::replaceButtonClicked(const QString &replaceText,
+ \fn void Core::SearchResult::replaceButtonClicked(const QString &replaceText,
const QList<Core::SearchResultItem> &checkedItems,
bool preserveCase)
@@ -303,36 +303,36 @@ using namespace Core::Internal;
*/
/*!
- \fn void SearchResult::cancelled()
+ \fn void Core::SearchResult::cancelled()
This signal is emitted if the user cancels the search.
*/
/*!
- \fn void SearchResult::countChanged(int count)
+ \fn void Core::SearchResult::countChanged(int count)
This signal is emitted when the number of search hits changes to \a count.
*/
/*!
- \fn void SearchResult::paused(bool paused)
+ \fn void Core::SearchResult::paused(bool paused)
This signal is emitted when the search status is set to \a paused.
*/
/*!
- \fn void SearchResult::requestEnabledCheck()
+ \fn void Core::SearchResult::requestEnabledCheck()
This signal is emitted when the enabled status of search results is
requested.
*/
/*!
- \fn void SearchResult::searchAgainRequested()
+ \fn void Core::SearchResult::searchAgainRequested()
This signal is emitted when the \uicontrol {Search Again} button is
selected.
*/
/*!
- \fn void SearchResult::visibilityChanged(bool visible)
+ \fn void Core::SearchResult::visibilityChanged(bool visible)
This signal is emitted when the visibility of the search results changes
to \a visible.
@@ -372,12 +372,12 @@ using namespace Core::Internal;
*/
/*!
- \fn QString SearchResultWindow::displayName() const
+ \fn QString Core::SearchResultWindow::displayName() const
\internal
*/
/*!
- \enum SearchResultWindow::PreserveCaseMode
+ \enum Core::SearchResultWindow::PreserveCaseMode
This enum type specifies whether a search and replace should preserve the
case of the replaced strings:
diff --git a/src/plugins/coreplugin/iwizardfactory.cpp b/src/plugins/coreplugin/iwizardfactory.cpp
index ce784e9e797..cecbec3f511 100644
--- a/src/plugins/coreplugin/iwizardfactory.cpp
+++ b/src/plugins/coreplugin/iwizardfactory.cpp
@@ -41,18 +41,23 @@
/*!
\class Core::IWizardFactory
- \mainclass
+ \inmodule QtCreator
+ \ingroup mainclasses
- \brief The class IWizardFactory is the base class for all wizard factories
- (for example shown in \gui {File | New}).
+ \brief The IWizardFactory class is the base class for all wizard factories.
- The wizard interface is a very thin abstraction for the \gui{New...} wizards.
- Basically it defines what to show to the user in the wizard selection dialogs,
+ \note Instead of using this class, we recommend that you create JSON-based
+ wizards, as instructed in \l{https://doc.qt.io/qtcreator/creator-project-wizards.html}
+ {Adding New Custom Wizards}.
+
+ The wizard interface is a very thin abstraction for the wizards in
+ \uicontrol File > \uicontrol {New File or Project}.
+ Basically, it defines what to show to the user in the wizard selection dialogs,
and a hook that is called if the user selects the wizard.
Wizards can then perform any operations they like, including showing dialogs and
- creating files. Often it is not necessary to create your own wizard from scratch,
- instead use one of the predefined wizards and adapt it to your needs.
+ creating files. Often it is not necessary to create your own wizard from scratch.
+ Use one of the predefined wizards and adapt it to your needs.
To make your wizard known to the system, add your IWizardFactory instance to the
plugin manager's object pool in your plugin's initialize function:
@@ -64,86 +69,60 @@
// ... do more setup
}
\endcode
- \sa Core::BaseFileWizard
- \sa Core::StandardFileWizard
+
+ \sa Core::BaseFileWizardFactory, Core::BaseFileWizard
*/
/*!
\enum Core::IWizardFactory::WizardKind
Used to specify what kind of objects the wizard creates. This information is used
- to show e.g. only wizards that create projects when selecting a \gui{New Project}
+ to show e.g. only wizards that create projects when selecting a \uicontrol{New Project}
menu item.
\value FileWizard
The wizard creates one or more files.
- \value ClassWizard
- The wizard creates a new class (e.g. source+header files).
\value ProjectWizard
The wizard creates a new project.
*/
/*!
- \fn IWizardFactory::IWizardFactory(QObject *parent)
- \internal
-*/
-
-/*!
- \fn IWizardFactory::~IWizardFactory()
- \internal
-*/
-
-/*!
- \fn Kind IWizardFactory::kind() const
+ \fn Core::IWizardFactory::WizardKind Core::IWizardFactory::kind() const
Returns what kind of objects are created by the wizard.
- \sa Kind
*/
/*!
- \fn QIcon IWizardFactory::icon() const
+ \fn QIcon Core::IWizardFactory::icon() const
Returns an icon to show in the wizard selection dialog.
*/
/*!
- \fn QString IWizardFactory::description() const
+ \fn QString Core::IWizardFactory::description() const
Returns a translated description to show when this wizard is selected
in the dialog.
*/
/*!
- \fn QString IWizardFactory::displayName() const
+ \fn QString Core::IWizardFactory::displayName() const
Returns the translated name of the wizard, how it should appear in the
dialog.
*/
/*!
- \fn QString IWizardFactory::id() const
+ \fn QString Core::IWizardFactory::id() const
Returns an arbitrary id that is used for sorting within the category.
*/
/*!
- \fn QString IWizardFactory::category() const
+ \fn QString Core::IWizardFactory::category() const
Returns a category ID to add the wizard to.
*/
/*!
- \fn QString IWizardFactory::displayCategory() const
+ \fn QString Core::IWizardFactory::displayCategory() const
Returns the translated string of the category, how it should appear
in the dialog.
*/
-/*!
- \fn void IWizardFactory::runWizard(const QString &path,
- QWidget *parent,
- const QString &platform,
- const QVariantMap &variables)
-
- This function is executed when the wizard has been selected by the user
- for execution. Any dialogs the wizard opens should use the given \a parent.
- The \a path argument is a suggestion for the location where files should be
- created. The wizard should fill this in its path selection elements as a
- default path.
-*/
-
using namespace Core;
@@ -268,6 +247,15 @@ QString IWizardFactory::runPath(const QString &defaultPath)
return path;
}
+/*!
+ Creates the wizard that the user selected for execution on the operating
+ system \a platform with \a variables.
+
+ Any dialogs the wizard opens should use the given \a parent.
+ The \a path argument is a suggestion for the location where files should be
+ created. The wizard should fill this in its path selection elements as a
+ default path.
+*/
Utils::Wizard *IWizardFactory::runWizard(const QString &path, QWidget *parent, Id platform, const QVariantMap &variables)
{
QTC_ASSERT(!s_isWizardRunning, return nullptr);
diff --git a/src/plugins/coreplugin/locator/executefilter.cpp b/src/plugins/coreplugin/locator/executefilter.cpp
index f98beae687c..ea983a34f56 100644
--- a/src/plugins/coreplugin/locator/executefilter.cpp
+++ b/src/plugins/coreplugin/locator/executefilter.cpp
@@ -134,7 +134,7 @@ void ExecuteFilter::finished(int exitCode, QProcess::ExitStatus status)
message = tr("Command \"%1\" finished.").arg(commandName);
else
message = tr("Command \"%1\" failed.").arg(commandName);
- MessageManager::write(message);
+ MessageManager::writeWithTime(message);
m_taskQueue.dequeue();
if (!m_taskQueue.isEmpty())
@@ -162,18 +162,18 @@ void ExecuteFilter::runHeadCommand()
const ExecuteData &d = m_taskQueue.head();
const Utils::FilePath fullPath = Utils::Environment::systemEnvironment().searchInPath(d.executable);
if (fullPath.isEmpty()) {
- MessageManager::write(tr("Could not find executable for \"%1\".").arg(d.executable));
+ MessageManager::writeWithTime(tr("Could not find executable for \"%1\".").arg(d.executable));
m_taskQueue.dequeue();
runHeadCommand();
return;
}
- MessageManager::write(tr("Starting command \"%1\".").arg(headCommand()));
+ MessageManager::writeWithTime(tr("Starting command \"%1\".").arg(headCommand()));
m_process->setWorkingDirectory(d.workingDirectory);
m_process->setCommand({fullPath, d.arguments, Utils::CommandLine::Raw});
m_process->start();
m_process->closeWriteChannel();
if (!m_process->waitForStarted(1000)) {
- MessageManager::write(tr("Could not start process: %1.").arg(m_process->errorString()));
+ MessageManager::writeWithTime(tr("Could not start process: %1.").arg(m_process->errorString()));
m_taskQueue.dequeue();
runHeadCommand();
}
diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp
index 1d1b8213f8d..e0df3e242d9 100644
--- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp
+++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp
@@ -455,7 +455,7 @@ void ILocatorFilter::setConfigurable(bool configurable)
}
/*!
- \fn QList<LocatorFilterEntry> ILocatorFilter::matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry)
+ \fn QList<Core::LocatorFilterEntry> Core::ILocatorFilter::matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry)
Returns the list of results of this filter for the search term \a entry.
This is run in a separate thread, but is guaranteed to only run in a single
@@ -471,7 +471,7 @@ void ILocatorFilter::setConfigurable(bool configurable)
*/
/*!
- \fn void ILocatorFilter::accept(LocatorFilterEntry selection, QString *newText, int *selectionStart, int *selectionLength) const
+ \fn void Core::ILocatorFilter::accept(Core::LocatorFilterEntry selection, QString *newText, int *selectionStart, int *selectionLength) const
Called with the entry specified by \a selection when the user activates it
in the result list.
@@ -480,7 +480,7 @@ void ILocatorFilter::setConfigurable(bool configurable)
*/
/*!
- \fn void ILocatorFilter::refresh(QFutureInterface<void> &future)
+ \fn void Core::ILocatorFilter::refresh(QFutureInterface<void> &future)
Refreshes cached data asynchronously.
@@ -488,7 +488,7 @@ void ILocatorFilter::setConfigurable(bool configurable)
*/
/*!
- \enum ILocatorFilter::Priority
+ \enum Core::ILocatorFilter::Priority
This enum value holds the priority that is used for ordering the results
when multiple filters are used.
@@ -505,7 +505,7 @@ void ILocatorFilter::setConfigurable(bool configurable)
*/
/*!
- \enum ILocatorFilter::MatchLevel
+ \enum Core::ILocatorFilter::MatchLevel
This enum value holds the level for ordering the results based on how well
they match the search criteria.
diff --git a/src/plugins/coreplugin/messagemanager.cpp b/src/plugins/coreplugin/messagemanager.cpp
index 75b2e81531c..e5eadc40ec8 100644
--- a/src/plugins/coreplugin/messagemanager.cpp
+++ b/src/plugins/coreplugin/messagemanager.cpp
@@ -32,6 +32,7 @@
#include <QFont>
#include <QThread>
+#include <QTime>
#include <QTimer>
using namespace Core;
@@ -106,6 +107,12 @@ void MessageManager::write(const QString &text, PrintToOutputPaneFlags flags)
QTimer::singleShot(0, instance(), [text, flags] { doWrite(text, flags); });
}
+void MessageManager::writeWithTime(const QString &text, PrintToOutputPaneFlags flags)
+{
+ const QString timeStamp = QTime::currentTime().toString("HH:mm:ss ");
+ write(timeStamp + text, flags);
+}
+
void MessageManager::doWrite(const QString &text, PrintToOutputPaneFlags flags)
{
QTC_ASSERT(m_messageOutputWindow, return);
diff --git a/src/plugins/coreplugin/messagemanager.h b/src/plugins/coreplugin/messagemanager.h
index 386001bc43c..b3efc99e86d 100644
--- a/src/plugins/coreplugin/messagemanager.h
+++ b/src/plugins/coreplugin/messagemanager.h
@@ -65,6 +65,7 @@ public:
static void writeMessages(const QStringList &messages,
PrintToOutputPaneFlags flags = NoModeSwitch);
static void write(const QString &text, PrintToOutputPaneFlags flags = NoModeSwitch);
+ static void writeWithTime(const QString &text, PrintToOutputPaneFlags flags = NoModeSwitch);
private:
MessageManager();
diff --git a/src/plugins/coreplugin/plugindialog.cpp b/src/plugins/coreplugin/plugindialog.cpp
index fa523fa318b..f3dceb73a8e 100644
--- a/src/plugins/coreplugin/plugindialog.cpp
+++ b/src/plugins/coreplugin/plugindialog.cpp
@@ -55,8 +55,6 @@ PluginDialog::PluginDialog(QWidget *parent)
: QDialog(parent),
m_view(new ExtensionSystem::PluginView(this))
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
auto vl = new QVBoxLayout(this);
auto filterLayout = new QHBoxLayout;
diff --git a/src/plugins/coreplugin/progressmanager/futureprogress.cpp b/src/plugins/coreplugin/progressmanager/futureprogress.cpp
index b39738bed47..9803ad86860 100644
--- a/src/plugins/coreplugin/progressmanager/futureprogress.cpp
+++ b/src/plugins/coreplugin/progressmanager/futureprogress.cpp
@@ -83,8 +83,9 @@ FutureProgressPrivate::FutureProgressPrivate(FutureProgress *q) :
}
/*!
- \mainclass
+ \ingroup mainclasses
\class Core::FutureProgress
+ \inmodule QtCreator
\brief The FutureProgress class is used to adapt the appearance of
progress indicators that were created through the ProgressManager class.
@@ -98,28 +99,27 @@ FutureProgressPrivate::FutureProgressPrivate(FutureProgress *q) :
*/
/*!
- \fn void FutureProgress::clicked()
+ \fn void Core::FutureProgress::clicked()
Connect to this signal to get informed when the user clicks on the
progress indicator.
*/
/*!
- \fn void FutureProgress::canceled()
+ \fn void Core::FutureProgress::canceled()
Connect to this signal to get informed when the operation is canceled.
*/
/*!
- \fn void FutureProgress::finished()
+ \fn void Core::FutureProgress::finished()
Another way to get informed when the task has finished.
*/
/*!
- \fn QWidget FutureProgress::widget() const
+ \fn QWidget Core::FutureProgress::widget() const
Returns the custom widget that is shown below the progress indicator.
*/
/*!
- \fn FutureProgress::FutureProgress(QWidget *parent)
\internal
*/
FutureProgress::FutureProgress(QWidget *parent) :
diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp
index 84ca73cc306..ef4458969f3 100644
--- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp
+++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp
@@ -63,13 +63,14 @@ using namespace Core::Internal;
using namespace Utils;
/*!
- \mainclass
+ \ingroup mainclasses
+ \inmodule QtCreator
\class Core::ProgressManager
\brief The ProgressManager class is used to show a user interface
for running tasks in Qt Creator.
- It tracks the progress of a task that it is told
- about, and shows a progress indicator in the lower right
+ The progress manager tracks the progress of a task that it is told
+ about, and shows a progress indicator in the lower right corner
of Qt Creator's main window to the user.
The progress indicator also allows the user to cancel the task.
@@ -88,7 +89,7 @@ using namespace Utils;
\row
\li Task abstraction
\li \c QFuture<void>
- \li A \c QFuture object that represents the task which is
+ \li A \l QFuture object that represents the task which is
responsible for reporting the state of the task. See below
for coding patterns how to create this object for your
specific task.
@@ -132,7 +133,7 @@ using namespace Utils;
ProgressManager in the addTask() function.
Have a look at e.g Core::ILocatorFilter. Locator filters implement
- a function \c refresh which takes a \c QFutureInterface object
+ a function \c refresh() which takes a \c QFutureInterface object
as a parameter. These functions look something like:
\code
void Filter::refresh(QFutureInterface<void> &future) {
@@ -209,50 +210,6 @@ using namespace Utils;
*/
/*!
- \fn Core::ProgressManager::ProgressManager(QObject *parent = 0)
- \internal
-*/
-
-/*!
- \fn Core::ProgressManager::~ProgressManager()
- \internal
-*/
-
-/*!
- \fn FutureProgress *Core::ProgressManager::addTask(const QFuture<void> &future, const QString &title, const QString &type, ProgressFlags flags = 0)
-
- Shows a progress indicator for task given by the QFuture object \a future.
- The progress indicator shows the specified \a title along with the progress bar.
- The \a type of a task will specify a logical grouping with other
- running tasks. Via the \a flags parameter you can e.g. let the
- progress indicator stay visible after the task has finished.
- Returns an object that represents the created progress indicator,
- which can be used to further customize. The FutureProgress object's
- life is managed by the ProgressManager and is guaranteed to live only until
- the next event loop cycle, or until the next call of addTask.
- If you want to use the returned FutureProgress later than directly after calling this function,
- you will need to use protective functions (like wrapping the returned object in QPointer and
- checking for 0 whenever you use it).
-*/
-
-/*!
- \fn void Core::ProgressManager::setApplicationLabel(const QString &text)
-
- Shows the given \a text in a platform dependent way in the application
- icon in the system's task bar or dock. This is used
- to show the number of build errors on Windows 7 and Mac OS X.
-*/
-
-/*!
- \fn void Core::ProgressManager::cancelTasks(Core::Id type)
-
- Schedules a cancel for all running tasks of the given \a type.
- Please note that the cancel functionality depends on the
- running task to actually check the \c QFutureInterface::isCanceled
- property.
-*/
-
-/*!
\fn void Core::ProgressManager::taskStarted(Core::Id type)
Sent whenever a task of a given \a type is started.
@@ -708,27 +665,59 @@ void ProgressManagerPrivate::progressDetailsToggled(bool checked)
settings->endGroup();
}
+/*!
+ \internal
+*/
ProgressManager::ProgressManager() = default;
+/*!
+ \internal
+*/
ProgressManager::~ProgressManager() = default;
+/*!
+ Returns a single progress manager instance.
+*/
ProgressManager *ProgressManager::instance()
{
return m_instance;
}
+/*!
+ Shows a progress indicator for the task given by the QFuture object
+ \a future.
+
+ The progress indicator shows the specified \a title along with the progress
+ bar. The \a type of a task will specify a logical grouping with other
+ running tasks. Via the \a flags parameter you can e.g. let the progress
+ indicator stay visible after the task has finished.
+
+ Returns an object that represents the created progress indicator, which
+ can be used to further customize. The FutureProgress object's life is
+ managed by the ProgressManager and is guaranteed to live only until
+ the next event loop cycle, or until the next call of addTask.
+
+ If you want to use the returned FutureProgress later than directly after
+ calling this function, you will need to use protective functions (like
+ wrapping the returned object in QPointer and checking for 0 whenever you
+ use it).
+*/
FutureProgress *ProgressManager::addTask(const QFuture<void> &future, const QString &title, Id type, ProgressFlags flags)
{
return m_instance->doAddTask(future, title, type, flags);
}
/*!
- Shows a progress indicator for task given by the QFuture given by
- the QFutureInterface \a futureInterface.
+ Shows a progress indicator for task given by the QFutureInterface object
+ \a futureInterface.
The progress indicator shows the specified \a title along with the progress bar.
The progress indicator will increase monotonically with time, at \a expectedSeconds
it will reach about 80%, and continue to increase with a decreasingly slower rate.
+ The \a type of a task will specify a logical grouping with other
+ running tasks. Via the \a flags parameter you can e.g. let the
+ progress indicator stay visible after the task has finished.
+
\sa addTask
*/
@@ -741,11 +730,22 @@ FutureProgress *ProgressManager::addTimedTask(const QFutureInterface<void> &futu
return fp;
}
+/*!
+ Shows the given \a text in a platform dependent way in the application
+ icon in the system's task bar or dock. This is used to show the number
+ of build errors on Windows 7 and \macos.
+*/
void ProgressManager::setApplicationLabel(const QString &text)
{
m_instance->doSetApplicationLabel(text);
}
+/*!
+ Schedules the cancellation of all running tasks of the given \a type.
+ The cancellation functionality depends on the running task actually
+ checking the \l QFuture::isCanceled property.
+*/
+
void ProgressManager::cancelTasks(Id type)
{
if (m_instance)
diff --git a/src/plugins/coreplugin/systemsettings.cpp b/src/plugins/coreplugin/systemsettings.cpp
index 3917db7f7fd..a0627359d83 100644
--- a/src/plugins/coreplugin/systemsettings.cpp
+++ b/src/plugins/coreplugin/systemsettings.cpp
@@ -52,7 +52,7 @@ namespace Internal {
class SystemSettingsWidget : public IOptionsPageWidget
{
- QT_DECLARE_DEPRECATED_TR_FUNCTIONS(Core::Internal::SystemSettingsWidget)
+ Q_DECLARE_TR_FUNCTIONS(Core::Internal::SystemSettingsWidget)
public:
SystemSettingsWidget()
diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp
index b1ef2edb10c..3ef40cb8199 100644
--- a/src/plugins/coreplugin/versiondialog.cpp
+++ b/src/plugins/coreplugin/versiondialog.cpp
@@ -52,7 +52,6 @@ VersionDialog::VersionDialog(QWidget *parent)
setWindowIcon(Icons::QTCREATORLOGO_BIG.icon());
setWindowTitle(tr("About %1").arg(Core::Constants::IDE_DISPLAY_NAME));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto layout = new QGridLayout(this);
layout->setSizeConstraint(QLayout::SetFixedSize);
diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp
index b0edff0fc0f..03b01a05b27 100644
--- a/src/plugins/cppeditor/cpppreprocessordialog.cpp
+++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp
@@ -39,8 +39,6 @@ CppPreProcessorDialog::CppPreProcessorDialog(const QString &filePath, QWidget *p
, m_ui(new Ui::CppPreProcessorDialog())
, m_filePath(filePath)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
m_ui->setupUi(this);
m_ui->editorLabel->setText(m_ui->editorLabel->text().arg(Utils::FilePath::fromString(m_filePath).fileName()));
m_ui->editWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index e836fba5905..a4523a6065f 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -971,8 +971,6 @@ void CppModelManager::recalculateProjectPartMappings()
void CppModelManager::watchForCanceledProjectIndexer(const QVector<QFuture<void>> &futures,
ProjectExplorer::Project *project)
{
- d->m_projectToIndexerCanceled.insert(project, false);
-
for (const QFuture<void> &future : futures) {
if (future.isCanceled() || future.isFinished())
continue;
@@ -983,7 +981,8 @@ void CppModelManager::watchForCanceledProjectIndexer(const QVector<QFuture<void>
d->m_projectToIndexerCanceled.insert(project, true);
watcher->deleteLater();
});
- connect(watcher, &QFutureWatcher<void>::finished, this, [watcher]() {
+ connect(watcher, &QFutureWatcher<void>::finished, this, [this, project, watcher]() {
+ d->m_projectToIndexerCanceled.remove(project);
watcher->deleteLater();
});
watcher->setFuture(future);
@@ -1114,6 +1113,9 @@ QFuture<void> CppModelManager::updateProjectInfo(QFutureInterface<void> &futureI
// Trigger reindexing
const QFuture<void> indexingFuture = updateSourceFiles(futureInterface, filesToReindex,
ForcedProgressNotification);
+ if (!filesToReindex.isEmpty()) {
+ d->m_projectToIndexerCanceled.insert(project, false);
+ }
watchForCanceledProjectIndexer({futureInterface.future(), indexingFuture}, project);
return indexingFuture;
}
diff --git a/src/plugins/cpptools/symbolsearcher_test.cpp b/src/plugins/cpptools/symbolsearcher_test.cpp
index 0e9f5a5804c..65228f39025 100644
--- a/src/plugins/cpptools/symbolsearcher_test.cpp
+++ b/src/plugins/cpptools/symbolsearcher_test.cpp
@@ -63,7 +63,7 @@ public:
static ResultDataList fromSearchResultList(const QList<Core::SearchResultItem> &entries)
{
ResultDataList result;
- foreach (const Core::SearchResultItem &entry, entries)
+ for (const Core::SearchResultItem &entry : entries)
result << ResultData(entry.text, entry.path.join(QLatin1String("::")));
return result;
}
@@ -72,9 +72,9 @@ public:
static void printFilterEntries(const ResultDataList &entries)
{
QTextStream out(stdout);
- foreach (const ResultData entry, entries) {
+ for (const ResultData &entry : entries) {
out << "<< ResultData(_(\"" << entry.m_symbolName << "\"), _(\""
- << entry.m_scope << "\"))" << endl;
+ << entry.m_scope << "\"))" << '\n';
}
}
diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp
index 8e0b0bbb2ca..8cdcd1e2f0d 100644
--- a/src/plugins/cvs/cvseditor.cpp
+++ b/src/plugins/cvs/cvseditor.cpp
@@ -43,8 +43,8 @@ namespace Internal {
#define CVS_REVISION_AT_START_PATTERN "^(" CVS_REVISION_PATTERN ") "
CvsEditorWidget::CvsEditorWidget() :
- m_revisionAnnotationPattern(QLatin1String(CVS_REVISION_AT_START_PATTERN ".*$")),
- m_revisionLogPattern(QLatin1String("^revision *(" CVS_REVISION_PATTERN ")$"))
+ m_revisionAnnotationPattern(CVS_REVISION_AT_START_PATTERN),
+ m_revisionLogPattern("^revision *(" CVS_REVISION_PATTERN ")$")
{
QTC_ASSERT(m_revisionAnnotationPattern.isValid(), return);
QTC_ASSERT(m_revisionLogPattern.isValid(), return);
@@ -56,31 +56,10 @@ CvsEditorWidget::CvsEditorWidget() :
@@ -6,6 +6,5 @@
\endcode
*/
- setDiffFilePattern(QRegExp(QLatin1String("^[-+]{3} ([^\\t]+)")));
- setLogEntryPattern(QRegExp(QLatin1String("^revision (.+)$")));
+ setDiffFilePattern("^[-+]{3} ([^\\t]+)");
+ setLogEntryPattern("^revision (.+)$");
setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\""));
-}
-
-QSet<QString> CvsEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- const QString txt = toPlainText();
- if (txt.isEmpty())
- return changes;
- // Hunt for first change number in annotation: "1.1 (author)"
- QRegExp r(QLatin1String(CVS_REVISION_AT_START_PATTERN));
- QTC_ASSERT(r.isValid(), return changes);
- if (r.indexIn(txt) != -1) {
- changes.insert(r.cap(1));
- r.setPattern(QLatin1String("\n(" CVS_REVISION_PATTERN ") "));
- QTC_ASSERT(r.isValid(), return changes);
- int pos = 0;
- while ((pos = r.indexIn(txt, pos)) != -1) {
- pos += r.matchedLength();
- changes.insert(r.cap(1));
- }
- }
- return changes;
+ setAnnotationEntryPattern("^(" CVS_REVISION_PATTERN ") ");
}
QString CvsEditorWidget::changeUnderCursor(const QTextCursor &c) const
@@ -99,15 +78,19 @@ QString CvsEditorWidget::changeUnderCursor(const QTextCursor &c) const
const QTextBlock block = c.block();
if (c.atBlockStart() || (c.position() - block.position() < 3)) {
const QString line = block.text();
- if (m_revisionAnnotationPattern.exactMatch(line))
- return m_revisionAnnotationPattern.cap(1);
+ const QRegularExpressionMatch match = m_revisionAnnotationPattern.match(line);
+ if (match.hasMatch())
+ return match.captured(1);
}
}
break;
case VcsBase::LogOutput: {
const QTextBlock block = c.block();
- if (c.position() - block.position() > 8 && m_revisionLogPattern.exactMatch(block.text()))
- return m_revisionLogPattern.cap(1);
+ if (c.position() - block.position() > 8) {
+ const QRegularExpressionMatch match = m_revisionLogPattern.match(block.text());
+ if (match.hasMatch())
+ return match.captured(1);
+ }
}
break;
}
diff --git a/src/plugins/cvs/cvseditor.h b/src/plugins/cvs/cvseditor.h
index f7ce08fd0b0..b92ebeae325 100644
--- a/src/plugins/cvs/cvseditor.h
+++ b/src/plugins/cvs/cvseditor.h
@@ -27,7 +27,7 @@
#include <vcsbase/vcsbaseeditor.h>
-#include <QRegExp>
+#include <QRegularExpression>
namespace Cvs {
namespace Internal {
@@ -40,14 +40,13 @@ public:
CvsEditorWidget();
private:
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(
const QSet<QString> &changes) const override;
QStringList annotationPreviousVersions(const QString &revision) const override;
- mutable QRegExp m_revisionAnnotationPattern;
- mutable QRegExp m_revisionLogPattern;
+ const QRegularExpression m_revisionAnnotationPattern;
+ const QRegularExpression m_revisionLogPattern;
QString m_diffBaseDir;
};
diff --git a/src/plugins/debugger/analyzer/startremotedialog.cpp b/src/plugins/debugger/analyzer/startremotedialog.cpp
index 084ab82bee5..e34d0df38df 100644
--- a/src/plugins/debugger/analyzer/startremotedialog.cpp
+++ b/src/plugins/debugger/analyzer/startremotedialog.cpp
@@ -58,7 +58,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
: QDialog(parent)
, d(new Internal::StartRemoteDialogPrivate)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Remote Analysis"));
d->kitChooser = new KitChooser(this);
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index df2f62dd847..ae840e772c6 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -874,7 +874,6 @@ private:
MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned int enabledParts, QWidget *parent) :
QDialog(parent)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Edit Breakpoint Properties"));
m_lineEditCondition = new QLineEdit(this);
diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp
index 49ebc219e50..f47dc289370 100644
--- a/src/plugins/debugger/debuggeractions.cpp
+++ b/src/plugins/debugger/debuggeractions.cpp
@@ -498,12 +498,6 @@ DebuggerSettings::DebuggerSettings()
insertItem(IntelFlavor, item);
item = new SavedAction;
- item->setSettingsKey(debugModeGroup, "IdentifyDebugInfoPackages");
- item->setCheckable(true);
- item->setDefaultValue(false);
- insertItem(IdentifyDebugInfoPackages, item);
-
- item = new SavedAction;
item->setSettingsKey(debugModeGroup, "UseToolTips");
item->setText(tr("Use tooltips in main editor when debugging"));
item->setToolTip(tr("<p>Checking this will enable tooltips for variable "
diff --git a/src/plugins/debugger/debuggeractions.h b/src/plugins/debugger/debuggeractions.h
index 05d9855b34d..61f5df39aa9 100644
--- a/src/plugins/debugger/debuggeractions.h
+++ b/src/plugins/debugger/debuggeractions.h
@@ -133,7 +133,6 @@ enum DebuggerActionCode
WarnOnReleaseBuilds,
MultiInferior,
IntelFlavor,
- IdentifyDebugInfoPackages,
// Stack
MaximalStackDepth,
diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h
index dcb36f0fb9c..03c2b16224d 100644
--- a/src/plugins/debugger/debuggercore.h
+++ b/src/plugins/debugger/debuggercore.h
@@ -80,7 +80,6 @@ void addHideColumnActions(QMenu *menu, QWidget *widget);
// Qt's various build paths for unpatched versions
QStringList qtBuildPaths();
-void addDebugInfoTask(unsigned id, const QString &cmd);
QWidget *addSearch(Utils::BaseTreeView *treeView);
} // namespace Internal
diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index 599d2382a9b..226026f99ca 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -49,6 +49,7 @@
#include <QFormLayout>
#include <QGroupBox>
#include <QLabel>
+#include <QPlainTextEdit>
#include <QPushButton>
#include <QRadioButton>
#include <QRegExp>
@@ -85,6 +86,10 @@ public:
PathChooser *debuginfoPathChooser;
QLabel *serverStartScriptLabel;
PathChooser *serverStartScriptPathChooser;
+ QLabel *serverInitCommandsLabel;
+ QPlainTextEdit *serverInitCommandsTextEdit;
+ QLabel *serverResetCommandsLabel;
+ QPlainTextEdit *serverResetCommandsTextEdit;
QComboBox *historyComboBox;
QDialogButtonBox *buttonBox;
};
@@ -121,6 +126,8 @@ public:
bool breakAtMain = false;
bool runInTerminal = false;
FilePath serverStartScript;
+ QString serverInitCommands;
+ QString serverResetCommands;
QString debugInfoLocation;
};
@@ -133,6 +140,8 @@ bool StartApplicationParameters::equals(const StartApplicationParameters &rhs) c
&& breakAtMain == rhs.breakAtMain
&& runInTerminal == rhs.runInTerminal
&& serverStartScript == rhs.serverStartScript
+ && serverInitCommands == rhs.serverInitCommands
+ && serverResetCommands == rhs.serverResetCommands
&& kitId == rhs.kitId
&& debugInfoLocation == rhs.debugInfoLocation
&& serverAddress == rhs.serverAddress;
@@ -169,6 +178,8 @@ void StartApplicationParameters::toSettings(QSettings *settings) const
settings->setValue("LastExternalBreakAtMain", breakAtMain);
settings->setValue("LastExternalRunInTerminal", runInTerminal);
settings->setValue("LastServerStartScript", serverStartScript.toVariant());
+ settings->setValue("LastServerInitCommands", serverInitCommands);
+ settings->setValue("LastServerResetCommands", serverResetCommands);
settings->setValue("LastDebugInfoLocation", debugInfoLocation);
}
@@ -183,6 +194,8 @@ void StartApplicationParameters::fromSettings(const QSettings *settings)
breakAtMain = settings->value("LastExternalBreakAtMain").toBool();
runInTerminal = settings->value("LastExternalRunInTerminal").toBool();
serverStartScript = FilePath::fromVariant(settings->value("LastServerStartScript"));
+ serverInitCommands = settings->value("LastServerInitCommands").toString();
+ serverResetCommands = settings->value("LastServerResetCommands").toString();
debugInfoLocation = settings->value("LastDebugInfoLocation").toString();
}
@@ -195,7 +208,6 @@ void StartApplicationParameters::fromSettings(const QSettings *settings)
StartApplicationDialog::StartApplicationDialog(QWidget *parent)
: QDialog(parent), d(new StartApplicationDialogPrivate)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Debugger"));
d->kitChooser = new KitChooser(this);
@@ -247,6 +259,22 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->serverStartScriptLabel->setBuddy(d->serverStartScriptPathChooser);
d->serverStartScriptLabel->setToolTip(d->serverStartScriptPathChooser->toolTip());
+ d->serverInitCommandsTextEdit = new QPlainTextEdit(this);
+ d->serverInitCommandsTextEdit->setToolTip(tr(
+ "This option can be used to send the target init commands."));
+
+ d->serverInitCommandsLabel = new QLabel(tr("&Init commands:"), this);
+ d->serverInitCommandsLabel->setBuddy(d->serverInitCommandsTextEdit);
+ d->serverInitCommandsLabel->setToolTip(d->serverInitCommandsTextEdit->toolTip());
+
+ d->serverResetCommandsTextEdit = new QPlainTextEdit(this);
+ d->serverResetCommandsTextEdit->setToolTip(tr(
+ "This option can be used to send the target reset commands."));
+
+ d->serverResetCommandsLabel = new QLabel(tr("&Reset commands:"), this);
+ d->serverResetCommandsLabel->setBuddy(d->serverResetCommandsTextEdit);
+ d->serverResetCommandsLabel->setToolTip(d->serverResetCommandsTextEdit->toolTip());
+
d->debuginfoPathChooser = new PathChooser(this);
d->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information"));
d->debuginfoPathChooser->setToolTip(tr(
@@ -278,6 +306,8 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
formLayout->addRow(tr("Run in &terminal:"), d->runInTerminalCheckBox);
formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox);
formLayout->addRow(d->serverStartScriptLabel, d->serverStartScriptPathChooser);
+ formLayout->addRow(d->serverInitCommandsLabel, d->serverInitCommandsTextEdit);
+ formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit);
formLayout->addRow(tr("Debug &information:"), d->debuginfoPathChooser);
formLayout->addRow(d->channelOverrideHintLabel);
formLayout->addRow(d->channelOverrideLabel, d->channelOverrideEdit);
@@ -366,6 +396,10 @@ void StartApplicationDialog::run(bool attachRemote)
if (!attachRemote) {
dialog.d->serverStartScriptPathChooser->setVisible(false);
dialog.d->serverStartScriptLabel->setVisible(false);
+ dialog.d->serverInitCommandsTextEdit->setVisible(false);
+ dialog.d->serverInitCommandsLabel->setVisible(false);
+ dialog.d->serverResetCommandsTextEdit->setVisible(false);
+ dialog.d->serverResetCommandsLabel->setVisible(false);
dialog.d->serverPortSpinBox->setVisible(false);
dialog.d->serverPortLabel->setVisible(false);
dialog.d->channelOverrideHintLabel->setVisible(false);
@@ -408,6 +442,8 @@ void StartApplicationDialog::run(bool attachRemote)
debugger->setDebugInfoLocation(newParameters.debugInfoLocation);
debugger->setInferior(inferior);
debugger->setServerStartScript(newParameters.serverStartScript); // Note: This requires inferior.
+ debugger->setCommandsAfterConnect(newParameters.serverInitCommands);
+ debugger->setCommandsForReset(newParameters.serverResetCommands);
debugger->setUseTerminal(newParameters.runInTerminal);
bool isLocal = !dev || (dev->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE);
@@ -445,6 +481,8 @@ StartApplicationParameters StartApplicationDialog::parameters() const
result.serverAddress = d->channelOverrideEdit->text();
result.runnable.executable = d->localExecutablePathChooser->fileName();
result.serverStartScript = d->serverStartScriptPathChooser->fileName();
+ result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText();
+ result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText();
result.kitId = d->kitChooser->currentKitId();
result.debugInfoLocation = d->debuginfoPathChooser->path();
result.runnable.commandLineArguments = d->arguments->text();
@@ -461,6 +499,8 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p)
d->channelOverrideEdit->setText(p.serverAddress);
d->localExecutablePathChooser->setFileName(p.runnable.executable);
d->serverStartScriptPathChooser->setFileName(p.serverStartScript);
+ d->serverInitCommandsTextEdit->setPlainText(p.serverInitCommands);
+ d->serverResetCommandsTextEdit->setPlainText(p.serverResetCommands);
d->debuginfoPathChooser->setPath(p.debugInfoLocation);
d->arguments->setText(p.runnable.commandLineArguments);
d->workingDirectory->setPath(p.runnable.workingDirectory);
@@ -486,7 +526,6 @@ AttachToQmlPortDialog::AttachToQmlPortDialog(QWidget *parent)
: QDialog(parent),
d(new AttachToQmlPortDialogPrivate)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Debugger"));
d->kitChooser = new KitChooser(this);
@@ -570,7 +609,6 @@ StartRemoteCdbDialog::StartRemoteCdbDialog(QWidget *parent) :
QDialog(parent), m_lineEdit(new QLineEdit)
{
setWindowTitle(tr("Start a CDB Remote Session"));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto groupBox = new QGroupBox;
@@ -642,7 +680,6 @@ AddressDialog::AddressDialog(QWidget *parent) :
m_box(new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel))
{
setWindowTitle(tr("Select Start Address"));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto hLayout = new QHBoxLayout;
hLayout->addWidget(new QLabel(tr("Enter an address:") + ' '));
@@ -720,7 +757,6 @@ public:
StartRemoteEngineDialog::StartRemoteEngineDialog(QWidget *parent)
: QDialog(parent), d(new StartRemoteEngineDialogPrivate)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start Remote Engine"));
d->host = new FancyLineEdit(this);
@@ -874,7 +910,6 @@ TypeFormatsDialog::TypeFormatsDialog(QWidget *parent)
: QDialog(parent), m_ui(new TypeFormatsDialogUi(this))
{
setWindowTitle(tr("Type Formats"));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->addPage(tr("Qt Types"));
m_ui->addPage(tr("Standard Types"));
m_ui->addPage(tr("Misc Types"));
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 69573db219a..a1c2aad6aba 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -2138,6 +2138,10 @@ void DebuggerEngine::createSnapshot()
void DebuggerEngine::updateLocals()
{
+ // if the engine is not running - do nothing
+ if (state() == DebuggerState::DebuggerFinished || state() == DebuggerState::DebuggerNotReady)
+ return;
+
watchHandler()->resetValueCache();
doUpdateLocals(UpdateParameters());
}
diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h
index 0d8a61695c0..bc7df160af9 100644
--- a/src/plugins/debugger/debuggerengine.h
+++ b/src/plugins/debugger/debuggerengine.h
@@ -392,9 +392,8 @@ public:
void handleReverseDirection(bool);
// Convenience
- Q_SLOT virtual void showMessage(const QString &msg, int channel = LogDebug,
- int timeout = -1) const;
- Q_SLOT void showStatusMessage(const QString &msg, int timeout = -1) const;
+ void showMessage(const QString &msg, int channel = LogDebug, int timeout = -1) const;
+ void showStatusMessage(const QString &msg, int timeout = -1) const;
virtual void resetLocation();
virtual void gotoLocation(const Internal::Location &location);
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index bb84ac2a853..5fdf0015e1b 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -585,43 +585,6 @@ static Kit *findUniversalCdbKit()
///////////////////////////////////////////////////////////////////////
//
-// Debuginfo Taskhandler
-//
-///////////////////////////////////////////////////////////////////////
-
-class DebugInfoTaskHandler : public ITaskHandler
-{
-public:
- bool canHandle(const Task &task) const final
- {
- return m_debugInfoTasks.contains(task.taskId);
- }
-
- void handle(const Task &task) final
- {
- QString cmd = m_debugInfoTasks.value(task.taskId);
- QProcess::startDetached(cmd);
- }
-
- void addTask(unsigned id, const QString &cmd)
- {
- m_debugInfoTasks[id] = cmd;
- }
-
- QAction *createAction(QObject *parent) const final
- {
- QAction *action = new QAction(DebuggerPlugin::tr("Install &Debug Information"), parent);
- action->setToolTip(DebuggerPlugin::tr("Tries to install missing debug information."));
- return action;
- }
-
-private:
- QHash<unsigned, QString> m_debugInfoTasks;
-};
-
-
-///////////////////////////////////////////////////////////////////////
-//
// DebuggerPluginPrivate
//
///////////////////////////////////////////////////////////////////////
@@ -677,7 +640,7 @@ public:
}
QInputDialog dialog; // Create wide input dialog.
dialog.setWindowFlags(dialog.windowFlags()
- & ~(Qt::WindowContextHelpButtonHint|Qt::MSWindowsFixedSizeDialogHint));
+ & ~(Qt::MSWindowsFixedSizeDialogHint));
dialog.resize(600, dialog.height());
dialog.setWindowTitle(tr("Add Message Tracepoint"));
dialog.setLabelText (tr("Message:"));
@@ -765,7 +728,6 @@ public:
QList<IOptionsPage *> m_optionPages;
IContext m_debugModeContext;
- DebugInfoTaskHandler m_debugInfoTaskHandler;
Perspective m_perspective{Constants::PRESET_PERSPECTIVE_ID, tr("Debugger")};
DebuggerKitAspect debuggerKitAspect;
@@ -2048,11 +2010,6 @@ void DebuggerPluginPrivate::remoteCommand(const QStringList &options)
runScheduled();
}
-void addDebugInfoTask(unsigned id, const QString &cmd)
-{
- dd->m_debugInfoTaskHandler.addTask(id, cmd);
-}
-
void DebuggerPluginPrivate::extensionsInitialized()
{
// If the CppEditor or QmlJS editor plugin is there, we want to add something to
diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp
index 8d87cfde054..9c67a651a60 100644
--- a/src/plugins/debugger/gdb/gdbengine.cpp
+++ b/src/plugins/debugger/gdb/gdbengine.cpp
@@ -356,24 +356,6 @@ void GdbEngine::handleResponse(const QString &buff)
break;
}
- if (boolSetting(IdentifyDebugInfoPackages)) {
- // From SuSE's gdb: >&"Missing separate debuginfo for ...\n"
- // ">&"Try: zypper install -C \"debuginfo(build-id)=c084ee5876ed1ac12730181c9f07c3e027d8e943\"\n"
- if (data.startsWith("Missing separate debuginfo for ")) {
- m_lastMissingDebugInfo = data.mid(32);
- } else if (data.startsWith("Try: zypper")) {
- QString cmd = data.mid(4);
-
- Task task(Task::Warning,
- tr("Missing debug information for %1\nTry: %2")
- .arg(m_lastMissingDebugInfo).arg(cmd),
- FilePath(), 0, Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO);
-
- TaskHub::addTask(task);
- Internal::addDebugInfoTask(task.taskId, cmd);
- }
- }
-
break;
}
@@ -3302,6 +3284,10 @@ void GdbEngine::handlePeripheralRegisterListValues(
void GdbEngine::reloadLocals()
{
+ // if the engine is not running - do nothing
+ if (state() == DebuggerState::DebuggerFinished || state() == DebuggerState::DebuggerNotReady)
+ return;
+
setTokenBarrier();
updateLocals();
}
diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h
index 0f8495ddda8..76ca8ea1d93 100644
--- a/src/plugins/debugger/gdb/gdbengine.h
+++ b/src/plugins/debugger/gdb/gdbengine.h
@@ -366,7 +366,6 @@ private: ////////// General Interface //////////
// HACK:
QString m_currentThread;
QString m_lastWinException;
- QString m_lastMissingDebugInfo;
bool m_expectTerminalTrap = false;
bool usesExecInterrupt() const;
bool usesTargetAsync() const;
diff --git a/src/plugins/debugger/gdb/gdboptionspage.cpp b/src/plugins/debugger/gdb/gdboptionspage.cpp
index 2fd3c8de87f..ff4b503e2fb 100644
--- a/src/plugins/debugger/gdb/gdboptionspage.cpp
+++ b/src/plugins/debugger/gdb/gdboptionspage.cpp
@@ -153,14 +153,6 @@ GdbOptionsPageWidget::GdbOptionsPageWidget()
"<html><head/><body>GDB shows by default AT&&T style disassembly."
"</body></html>"));
- auto checkBoxIdentifyDebugInfoPackages = new QCheckBox(groupBoxGeneral);
- checkBoxIdentifyDebugInfoPackages->setText(GdbOptionsPage::tr("Create tasks from missing packages"));
- checkBoxIdentifyDebugInfoPackages->setToolTip(GdbOptionsPage::tr(
- "<html><head/><body><p>Attempts to identify missing debug info packages "
- "and lists them in the Issues output pane.</p><p>"
- "<b>Note:</b> This feature needs special support from the Linux "
- "distribution and GDB build and is not available everywhere.</p></body></html>"));
-
QString howToUsePython = GdbOptionsPage::tr(
"<p>To execute simple Python commands, prefix them with \"python\".</p>"
"<p>To execute sequences of Python commands spanning multiple lines "
@@ -233,7 +225,6 @@ GdbOptionsPageWidget::GdbOptionsPageWidget()
formLayout->addRow(checkBoxLoadGdbInit);
formLayout->addRow(checkBoxLoadGdbDumpers);
formLayout->addRow(checkBoxIntelFlavor);
- formLayout->addRow(checkBoxIdentifyDebugInfoPackages);
auto startLayout = new QGridLayout(groupBoxStartupCommands);
startLayout->addWidget(textEditStartupCommands, 0, 0, 1, 1);
@@ -255,7 +246,6 @@ GdbOptionsPageWidget::GdbOptionsPageWidget()
group.insert(action(AdjustBreakpointLocations), checkBoxAdjustBreakpointLocations);
group.insert(action(GdbWatchdogTimeout), spinBoxGdbWatchdogTimeout);
group.insert(action(IntelFlavor), checkBoxIntelFlavor);
- group.insert(action(IdentifyDebugInfoPackages), checkBoxIdentifyDebugInfoPackages);
group.insert(action(UseMessageBoxForSignals), checkBoxUseMessageBoxForSignals);
group.insert(action(SkipKnownFrames), checkBoxSkipKnownFrames);
diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp
index e2646146110..d4af42714d2 100644
--- a/src/plugins/debugger/loadcoredialog.cpp
+++ b/src/plugins/debugger/loadcoredialog.cpp
@@ -251,7 +251,6 @@ AttachCoreDialog::AttachCoreDialog(QWidget *parent)
: QDialog(parent), d(new AttachCoreDialogPrivate)
{
setWindowTitle(tr("Load Core File"));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
d->buttonBox = new QDialogButtonBox(this);
d->buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
diff --git a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp
index 0c86728f214..0bd667f4576 100644
--- a/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp
+++ b/src/plugins/debugger/shared/cdbsymbolpathlisteditor.cpp
@@ -51,7 +51,6 @@ CacheDirectoryDialog::CacheDirectoryDialog(QWidget *parent) :
{
setWindowTitle(tr("Select Local Cache Folder"));
setModal(true);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto formLayout = new QFormLayout;
m_chooser->setExpectedKind(Utils::PathChooser::ExistingDirectory);
diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp
index 7f20afaeef3..51d27228d18 100644
--- a/src/plugins/debugger/stackhandler.cpp
+++ b/src/plugins/debugger/stackhandler.cpp
@@ -337,7 +337,6 @@ static StackFrame inputFunctionForDisassembly()
dialog.setInputMode(QInputDialog::TextInput);
dialog.setLabelText(StackHandler::tr("Function:"));
dialog.setWindowTitle(StackHandler::tr("Disassemble Function"));
- dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
if (dialog.exec() != QDialog::Accepted)
return frame;
const QString function = dialog.textValue();
diff --git a/src/plugins/debugger/unstartedappwatcherdialog.cpp b/src/plugins/debugger/unstartedappwatcherdialog.cpp
index 423bcf46995..c27ff5f72ef 100644
--- a/src/plugins/debugger/unstartedappwatcherdialog.cpp
+++ b/src/plugins/debugger/unstartedappwatcherdialog.cpp
@@ -87,7 +87,6 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(tr("Attach to Process Not Yet Started"));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_kitChooser = new KitChooser(this);
m_kitChooser->setKitPredicate([](const Kit *k) {
diff --git a/src/plugins/debugger/uvsc/uvscclient.cpp b/src/plugins/debugger/uvsc/uvscclient.cpp
index b7bb035c524..57de522689a 100644
--- a/src/plugins/debugger/uvsc/uvscclient.cpp
+++ b/src/plugins/debugger/uvsc/uvscclient.cpp
@@ -321,7 +321,7 @@ bool UvscClient::fetchThreads(bool showNames, GdbMi &data)
return false;
std::vector<TASKENUM> taskenums(kMaximumTaskEnumsCount);
- qint32 taskenumsCount = taskenums.size();
+ qint32 taskenumsCount = qint32(taskenums.size());
const UVSC_STATUS st = ::UVSC_DBG_ENUM_TASKS(m_descriptor, taskenums.data(),
&taskenumsCount);
if (st != UVSC_STATUS_SUCCESS) {
@@ -432,7 +432,7 @@ bool UvscClient::fetchRegisters(Registers &registers)
// Enumerate the register groups names.
std::vector<SSTR> sstrs(kMaximumRegisterGroupsCount);
- qint32 sstrsCount = sstrs.size();
+ qint32 sstrsCount = qint32(sstrs.size());
UVSC_STATUS st = ::UVSC_DBG_ENUM_REGISTER_GROUPS(m_descriptor, sstrs.data(),
&sstrsCount);
if (st != UVSC_STATUS_SUCCESS) {
@@ -449,7 +449,7 @@ bool UvscClient::fetchRegisters(Registers &registers)
// Enumerate the registers.
std::vector<REGENUM> regenums(kMaximumRegisterEnumsCount);
- qint32 regenumsCount = regenums.size();
+ qint32 regenumsCount = qint32(regenums.size());
st = ::UVSC_DBG_ENUM_REGISTERS(m_descriptor, regenums.data(), &regenumsCount);
if (st != UVSC_STATUS_SUCCESS) {
setError(RuntimeError);
@@ -471,7 +471,7 @@ bool UvscClient::fetchRegisters(Registers &registers)
// Read the register values.
std::vector<qint8> values(kMaximumRegisterEnumsCount * kMaximumValueBitsSize);
- qint32 length = values.size();
+ qint32 length = qint32(values.size());
st = ::UVSC_DBG_READ_REGISTERS( m_descriptor, values.data(), &length);
if (st != UVSC_STATUS_SUCCESS) {
setError(RuntimeError);
@@ -529,7 +529,7 @@ bool UvscClient::inspectLocal(const QStringList &expandedLocalINames,
ivarenum.frame = frameId;
ivarenum.count = kMaximumVarinfosCount / 2;
std::vector<VARINFO> varinfos(kMaximumVarinfosCount);
- qint32 varinfosCount = varinfos.size();
+ qint32 varinfosCount = qint32(varinfos.size());
const UVSC_STATUS st = ::UVSC_DBG_ENUM_VARIABLES(m_descriptor, &ivarenum,
varinfos.data(), &varinfosCount);
if (st != UVSC_STATUS_SUCCESS) {
@@ -647,7 +647,7 @@ bool UvscClient::inspectWatcher(const QStringList &expandedWatcherINames,
ivarenum.id = watcherId;
ivarenum.count = kMaximumVarinfosCount / 2;
std::vector<VARINFO> varinfos(kMaximumVarinfosCount);
- qint32 varinfosCount = varinfos.size();
+ qint32 varinfosCount = qint32(varinfos.size());
const UVSC_STATUS st = ::UVSC_DBG_ENUM_VARIABLES(m_descriptor, &ivarenum,
varinfos.data(), &varinfosCount);
if (st != UVSC_STATUS_SUCCESS) {
@@ -1027,7 +1027,7 @@ bool UvscClient::enumerateStack(quint32 taskId, std::vector<STACKENUM> &stackenu
istkenum.isFull = true;
istkenum.hasExtended = true;
stackenums.resize(kMaximumStackEnumsCount);
- qint32 stackenumsCount = stackenums.size();
+ qint32 stackenumsCount = qint32(stackenums.size());
const UVSC_STATUS st = ::UVSC_DBG_ENUM_STACK(m_descriptor, &istkenum,
stackenums.data(), &stackenumsCount);
if (st != UVSC_STATUS_SUCCESS)
diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp
index 0751a46e7ca..3cac8265f18 100644
--- a/src/plugins/git/branchview.cpp
+++ b/src/plugins/git/branchview.cpp
@@ -223,8 +223,9 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
});
contextMenu.addSeparator();
}
- QAction *act = contextMenu.addAction(tr("Manage &Remotes..."));
- connect(act, &QAction::triggered, [this] { GitPlugin::manageRemotes(); });
+ contextMenu.addAction(tr("Manage &Remotes..."), this, [] {
+ GitPlugin::manageRemotes();
+ });
}
if (hasActions) {
if (!currentSelected && (isLocal || isTag))
@@ -240,6 +241,7 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
GitPlugin::client()->diffBranch(m_repository, fullName);
});
contextMenu.addAction(tr("&Log"), this, [this] { log(selectedIndex()); });
+ contextMenu.addAction(tr("Reflo&g"), this, [this] { reflog(selectedIndex()); });
contextMenu.addSeparator();
if (!currentSelected) {
auto resetMenu = new QMenu(tr("Re&set"), &contextMenu);
@@ -559,6 +561,13 @@ void BranchView::log(const QModelIndex &idx)
GitPlugin::client()->log(m_repository, QString(), false, {branchName});
}
+void BranchView::reflog(const QModelIndex &idx)
+{
+ const QString branchName = m_model->fullName(idx, true);
+ if (!branchName.isEmpty())
+ GitPlugin::client()->reflog(m_repository, branchName);
+}
+
void BranchView::push()
{
const QModelIndex selected = selectedIndex();
diff --git a/src/plugins/git/branchview.h b/src/plugins/git/branchview.h
index 9e4dfc0fd75..faceea2ef57 100644
--- a/src/plugins/git/branchview.h
+++ b/src/plugins/git/branchview.h
@@ -83,6 +83,7 @@ private:
void rebase();
bool cherryPick();
void log(const QModelIndex &idx);
+ void reflog(const QModelIndex &idx);
void push();
QToolButton *m_addButton = nullptr;
diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp
index 47a55be5c56..c1cc46ce984 100644
--- a/src/plugins/git/changeselectiondialog.cpp
+++ b/src/plugins/git/changeselectiondialog.cpp
@@ -57,7 +57,6 @@ ChangeSelectionDialog::ChangeSelectionDialog(const QString &workingDirectory, Co
QWidget *parent) :
QDialog(parent), m_ui(new Ui::ChangeSelectionDialog)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_gitExecutable = GitPlugin::client()->vcsBinary();
m_ui->setupUi(this);
m_ui->workingDirectoryChooser->setExpectedKind(PathChooser::ExistingDirectory);
diff --git a/src/plugins/git/gerrit/gerritdialog.cpp b/src/plugins/git/gerrit/gerritdialog.cpp
index 402c29763a1..875ca8b44fe 100644
--- a/src/plugins/git/gerrit/gerritdialog.cpp
+++ b/src/plugins/git/gerrit/gerritdialog.cpp
@@ -63,8 +63,6 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
, m_model(new GerritModel(p, this))
, m_queryModel(new QStringListModel(this))
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
m_ui->setupUi(this);
m_ui->remoteComboBox->setParameters(m_parameters);
m_ui->remoteComboBox->setFallbackEnabled(true);
diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp
index 9a251b5eda1..08c280fc90f 100644
--- a/src/plugins/git/gerrit/gerritpushdialog.cpp
+++ b/src/plugins/git/gerrit/gerritpushdialog.cpp
@@ -128,7 +128,6 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev
m_workingDir(workingDir),
m_ui(new Ui::GerritPushDialog)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this);
m_ui->repositoryLabel->setText(QDir::toNativeSeparators(workingDir));
m_ui->remoteComboBox->setRepository(workingDir);
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 7ba46935dba..005e0e66f86 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -560,14 +560,15 @@ public:
}
};
-class GitLogArgumentsWidget : public BaseGitDiffArgumentsWidget
+class BaseGitLogArgumentsWidget : public BaseGitDiffArgumentsWidget
{
Q_OBJECT
public:
- GitLogArgumentsWidget(VcsBaseClientSettings &settings, bool fileRelated, QToolBar *toolBar) :
- BaseGitDiffArgumentsWidget(settings, toolBar)
+ BaseGitLogArgumentsWidget(VcsBaseClientSettings &settings, GitEditorWidget *editor) :
+ BaseGitDiffArgumentsWidget(settings, editor->toolBar())
{
+ QToolBar *toolBar = editor->toolBar();
QAction *diffButton = addToggleButton("--patch", tr("Diff"),
tr("Show difference."));
mapSetting(diffButton, settings.boolPointer(GitSettings::logDiffKey));
@@ -575,6 +576,22 @@ public:
connect(diffButton, &QAction::toggled, m_ignoreWSButton, &QAction::setVisible);
m_patienceButton->setVisible(diffButton->isChecked());
m_ignoreWSButton->setVisible(diffButton->isChecked());
+ auto filterAction = new QAction(tr("Filter"), toolBar);
+ filterAction->setToolTip(tr("Filter commits by message or content."));
+ filterAction->setCheckable(true);
+ connect(filterAction, &QAction::toggled, editor, &GitEditorWidget::toggleFilters);
+ toolBar->addAction(filterAction);
+ }
+};
+
+class GitLogArgumentsWidget : public BaseGitLogArgumentsWidget
+{
+ Q_OBJECT
+
+public:
+ GitLogArgumentsWidget(VcsBaseClientSettings &settings, bool fileRelated, GitEditorWidget *editor) :
+ BaseGitLogArgumentsWidget(settings, editor)
+ {
QAction *firstParentButton =
addToggleButton({"-m", "--first-parent"},
tr("First Parent"),
@@ -599,6 +616,24 @@ public:
}
};
+class GitRefLogArgumentsWidget : public BaseGitLogArgumentsWidget
+{
+ Q_OBJECT
+
+public:
+ GitRefLogArgumentsWidget(VcsBaseClientSettings &settings, GitEditorWidget *editor) :
+ BaseGitLogArgumentsWidget(settings, editor)
+ {
+ QAction *showDateButton =
+ addToggleButton("--date=iso",
+ tr("Show Date"),
+ tr("Show date instead of sequence"));
+ mapSetting(showDateButton, settings.boolPointer(GitSettings::refLogShowDateKey));
+
+ addReloadButton();
+ }
+};
+
class ConflictHandler final : public QObject
{
Q_OBJECT
@@ -1004,7 +1039,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
codecFor(CodecLogOutput), "logTitle", msgArg));
VcsBaseEditorConfig *argWidget = editor->editorConfig();
if (!argWidget) {
- argWidget = new GitLogArgumentsWidget(settings(), !fileName.isEmpty(), editor->toolBar());
+ argWidget = new GitLogArgumentsWidget(settings(), !fileName.isEmpty(), editor);
argWidget->setBaseArguments(args);
connect(argWidget, &VcsBaseEditorConfig::commandExecutionRequested, this,
[=]() { this->log(workingDir, fileName, enableAnnotationContextMenu, args); });
@@ -1027,26 +1062,42 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
if (!pickaxeValue.isEmpty())
arguments << "-S" << pickaxeValue;
+ if ((!grepValue.isEmpty() || !pickaxeValue.isEmpty()) && !editor->caseSensitive())
+ arguments << "-i";
+
if (!fileName.isEmpty())
arguments << "--" << fileName;
vcsExec(workingDir, arguments, editor);
}
-void GitClient::reflog(const QString &workingDirectory)
+void GitClient::reflog(const QString &workingDirectory, const QString &ref)
{
const QString title = tr("Git Reflog \"%1\"").arg(workingDirectory);
- const Id editorId = Git::Constants::GIT_LOG_EDITOR_ID;
- VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, workingDirectory, codecFor(CodecLogOutput),
- "reflogRepository", workingDirectory);
- editor->setWorkingDirectory(workingDirectory);
+ const Id editorId = Git::Constants::GIT_REFLOG_EDITOR_ID;
+ // Creating document might change the referenced workingDirectory. Store a copy and use it.
+ const QString workingDir = workingDirectory;
+ GitEditorWidget *editor = static_cast<GitEditorWidget *>(
+ createVcsEditor(editorId, title, workingDir, codecFor(CodecLogOutput),
+ "reflogRepository", workingDir));
+ VcsBaseEditorConfig *argWidget = editor->editorConfig();
+ if (!argWidget) {
+ argWidget = new GitRefLogArgumentsWidget(settings(), editor);
+ if (!ref.isEmpty())
+ argWidget->setBaseArguments({ref});
+ connect(argWidget, &VcsBaseEditorConfig::commandExecutionRequested, this,
+ [=] { this->reflog(workingDir, ref); });
+ editor->setEditorConfig(argWidget);
+ }
+ editor->setWorkingDirectory(workingDir);
QStringList arguments = {"reflog", noColorOption, decorateOption};
+ arguments << argWidget->arguments();
int logCount = settings().intValue(GitSettings::logCountKey);
if (logCount > 0)
arguments << "-n" << QString::number(logCount);
- vcsExec(workingDirectory, arguments, editor);
+ vcsExec(workingDir, arguments, editor);
}
// Do not show "0000" or "^32ae4"
@@ -3076,7 +3127,7 @@ void GitClient::subversionLog(const QString &workingDirectory)
// Create a command editor, no highlighting or interaction.
const QString title = tr("Git SVN Log");
- const Id editorId = Git::Constants::GIT_COMMAND_LOG_EDITOR_ID;
+ const Id editorId = Git::Constants::GIT_SVN_LOG_EDITOR_ID;
const QString sourceFile = VcsBaseEditor::getSource(workingDirectory, QStringList());
VcsBaseEditorWidget *editor = createVcsEditor(editorId, title, sourceFile, codecFor(CodecNone),
"svnLog", sourceFile);
diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h
index f605bca767d..447238888aa 100644
--- a/src/plugins/git/gitclient.h
+++ b/src/plugins/git/gitclient.h
@@ -167,7 +167,7 @@ public:
void status(const QString &workingDirectory);
void log(const QString &workingDirectory, const QString &fileName = QString(),
bool enableAnnotationContextMenu = false, const QStringList &args = QStringList());
- void reflog(const QString &workingDirectory);
+ void reflog(const QString &workingDirectory, const QString &branch = {});
VcsBase::VcsBaseEditorWidget *annotate(
const QString &workingDir, const QString &file, const QString &revision = QString(),
int lineNumber = -1, const QStringList &extraOptions = QStringList()) override;
diff --git a/src/plugins/git/gitconstants.h b/src/plugins/git/gitconstants.h
index 9cb9ddada1f..38a8a104abe 100644
--- a/src/plugins/git/gitconstants.h
+++ b/src/plugins/git/gitconstants.h
@@ -32,10 +32,12 @@ namespace Constants {
const char GIT_PLUGIN[] = "GitPlugin";
-const char GIT_COMMAND_LOG_EDITOR_ID[] = "Git Command Log Editor";
-const char GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Git Command Log Editor");
-const char GIT_LOG_EDITOR_ID[] = "Git File Log Editor";
-const char GIT_LOG_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Git File Log Editor");
+const char GIT_SVN_LOG_EDITOR_ID[] = "Git SVN Log Editor";
+const char GIT_SVN_LOG_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Git SVN Log Editor");
+const char GIT_LOG_EDITOR_ID[] = "Git Log Editor";
+const char GIT_LOG_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Git Log Editor");
+const char GIT_REFLOG_EDITOR_ID[] = "Git Reflog Editor";
+const char GIT_REFLOG_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Git Reflog Editor");
const char GIT_BLAME_EDITOR_ID[] = "Git Annotation Editor";
const char GIT_BLAME_EDITOR_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Git Annotation Editor");
const char GIT_COMMIT_TEXT_EDITOR_ID[] = "Git Commit Editor";
diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp
index d9c29afebf4..47546d0df61 100644
--- a/src/plugins/git/giteditor.cpp
+++ b/src/plugins/git/giteditor.cpp
@@ -42,17 +42,15 @@
#include <utils/qtcassert.h>
#include <utils/temporaryfile.h>
-#include <QMenu>
-
+#include <QDir>
#include <QFileInfo>
+#include <QHBoxLayout>
+#include <QMenu>
#include <QRegExp>
#include <QSet>
+#include <QTextBlock>
#include <QTextCodec>
-#include <QDir>
-
#include <QTextCursor>
-#include <QTextBlock>
-#include <QMessageBox>
#define CHANGE_PATTERN "[a-f0-9]{7,40}"
@@ -61,6 +59,54 @@ using namespace VcsBase;
namespace Git {
namespace Internal {
+class GitLogFilterWidget : public QToolBar
+{
+ Q_DECLARE_TR_FUNCTIONS(Git::Internal::GitLogFilterWidget);
+
+public:
+ GitLogFilterWidget(GitEditorWidget *editor)
+ {
+ auto addLineEdit = [this](const QString &placeholder,
+ const QString &tooltip,
+ GitEditorWidget *editor)
+ {
+ auto lineEdit = new Utils::FancyLineEdit;
+ lineEdit->setFiltering(true);
+ lineEdit->setToolTip(tooltip);
+ lineEdit->setPlaceholderText(placeholder);
+ lineEdit->setMaximumWidth(200);
+ connect(lineEdit, &QLineEdit::returnPressed,
+ editor, &GitEditorWidget::refresh);
+ connect(lineEdit, &Utils::FancyLineEdit::rightButtonClicked,
+ editor, &GitEditorWidget::refresh);
+ return lineEdit;
+ };
+ grepLineEdit = addLineEdit(tr("Filter by message"),
+ tr("Filter log entries by text in the commit message."),
+ editor);
+ pickaxeLineEdit = addLineEdit(tr("Filter by content"),
+ tr("Filter log entries by added or removed string."),
+ editor);
+ addWidget(new QLabel(tr("Filter:")));
+ addSeparator();
+ addWidget(grepLineEdit);
+ addSeparator();
+ addWidget(pickaxeLineEdit);
+ addSeparator();
+ caseAction = new QAction(tr("Case sensitive"), this);
+ caseAction->setCheckable(true);
+ caseAction->setChecked(true);
+ connect(caseAction, &QAction::toggled, editor, &GitEditorWidget::refresh);
+ addAction(caseAction);
+ hide();
+ connect(editor, &GitEditorWidget::toggleFilters, this, &QWidget::setVisible);
+ }
+
+ Utils::FancyLineEdit *grepLineEdit;
+ Utils::FancyLineEdit *pickaxeLineEdit;
+ QAction *caseAction;
+};
+
GitEditorWidget::GitEditorWidget() :
m_changeNumberPattern(CHANGE_PATTERN)
{
@@ -71,32 +117,11 @@ GitEditorWidget::GitEditorWidget() :
--- a/src/plugins/git/giteditor.cpp
+++ b/src/plugins/git/giteditor.cpp
*/
- setDiffFilePattern(QRegExp("^(?:diff --git a/|index |[+-]{3} (?:/dev/null|[ab]/(.+$)))"));
- setLogEntryPattern(QRegExp("^commit ([0-9a-f]{8})[0-9a-f]{32}"));
+ setDiffFilePattern("^(?:diff --git a/|index |[+-]{3} (?:/dev/null|[ab]/(.+$)))");
+ setLogEntryPattern("^commit ([0-9a-f]{8})[0-9a-f]{32}");
setAnnotateRevisionTextFormat(tr("&Blame %1"));
setAnnotatePreviousRevisionTextFormat(tr("Blame &Parent Revision %1"));
-}
-
-QSet<QString> GitEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- const QString txt = toPlainText();
- if (txt.isEmpty())
- return changes;
- // Hunt for first change number in annotation: "<change>:"
- QRegExp r("^(" CHANGE_PATTERN ") ");
- QTC_ASSERT(r.isValid(), return changes);
- if (r.indexIn(txt) != -1) {
- changes.insert(r.cap(1));
- r.setPattern("\n(" CHANGE_PATTERN ") ");
- QTC_ASSERT(r.isValid(), return changes);
- int pos = 0;
- while ((pos = r.indexIn(txt, pos)) != -1) {
- pos += r.matchedLength();
- changes.insert(r.cap(1));
- }
- }
- return changes;
+ setAnnotationEntryPattern("^(" CHANGE_PATTERN ") ");
}
QString GitEditorWidget::changeUnderCursor(const QTextCursor &c) const
@@ -381,44 +406,36 @@ QString GitEditorWidget::sourceWorkingDirectory() const
return path.toString();
}
-void GitEditorWidget::lineEditChanged()
+void GitEditorWidget::refresh()
{
if (VcsBaseEditorConfig *config = editorConfig())
config->handleArgumentsChanged();
}
-void GitEditorWidget::refreshOnLineEdit(Utils::FancyLineEdit *lineEdit)
-{
- connect(lineEdit, &QLineEdit::returnPressed,
- this, &GitEditorWidget::lineEditChanged);
- connect(lineEdit, &Utils::FancyLineEdit::rightButtonClicked,
- this, &GitEditorWidget::lineEditChanged);
-}
-
-void GitEditorWidget::setGrepLineEdit(Utils::FancyLineEdit *lineEdit)
-{
- m_grepLineEdit = lineEdit;
- refreshOnLineEdit(lineEdit);
-}
-
-void GitEditorWidget::setPickaxeLineEdit(Utils::FancyLineEdit *lineEdit)
+QWidget *GitEditorWidget::addFilterWidget()
{
- m_pickaxeLineEdit = lineEdit;
- refreshOnLineEdit(lineEdit);
+ if (!m_logFilterWidget)
+ m_logFilterWidget = new GitLogFilterWidget(this);
+ return m_logFilterWidget;
}
QString GitEditorWidget::grepValue() const
{
- if (!m_grepLineEdit)
+ if (!m_logFilterWidget)
return QString();
- return m_grepLineEdit->text();
+ return m_logFilterWidget->grepLineEdit->text();
}
QString GitEditorWidget::pickaxeValue() const
{
- if (!m_pickaxeLineEdit)
+ if (!m_logFilterWidget)
return QString();
- return m_pickaxeLineEdit->text();
+ return m_logFilterWidget->pickaxeLineEdit->text();
+}
+
+bool GitEditorWidget::caseSensitive() const
+{
+ return m_logFilterWidget && m_logFilterWidget->caseAction->isChecked();
}
} // namespace Internal
diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h
index bc7df7fe9e6..18397d94975 100644
--- a/src/plugins/git/giteditor.h
+++ b/src/plugins/git/giteditor.h
@@ -34,6 +34,8 @@ namespace Utils { class FancyLineEdit; }
namespace Git {
namespace Internal {
+class GitLogFilterWidget;
+
class GitEditorWidget : public VcsBase::VcsBaseEditorWidget
{
Q_OBJECT
@@ -42,10 +44,15 @@ public:
GitEditorWidget();
void setPlainText(const QString &text) override;
- void setGrepLineEdit(Utils::FancyLineEdit *lineEdit);
+ QWidget *addFilterWidget();
void setPickaxeLineEdit(Utils::FancyLineEdit *lineEdit);
QString grepValue() const;
QString pickaxeValue() const;
+ bool caseSensitive() const;
+ void refresh();
+
+signals:
+ void toggleFilters(bool value);
private:
void applyDiffChunk(const VcsBase::DiffChunk& chunk, bool revert);
@@ -54,7 +61,6 @@ private:
void resetChange(const QByteArray &resetType);
void addDiffActions(QMenu *menu, const VcsBase::DiffChunk &chunk) override;
void aboutToOpen(const QString &fileName, const QString &realFileName) override;
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const override;
QString decorateVersion(const QString &revision) const override;
@@ -65,13 +71,10 @@ private:
bool supportChangeLinks() const override;
QString fileNameForLine(int line) const override;
QString sourceWorkingDirectory() const;
- void refreshOnLineEdit(Utils::FancyLineEdit *lineEdit);
- void lineEditChanged();
mutable QRegExp m_changeNumberPattern;
QString m_currentChange;
- Utils::FancyLineEdit *m_grepLineEdit = nullptr;
- Utils::FancyLineEdit *m_pickaxeLineEdit = nullptr;
+ GitLogFilterWidget *m_logFilterWidget = nullptr;
};
} // namespace Git
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index b04db69e94f..55f71643c42 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -60,7 +60,6 @@
#include <coreplugin/vcsmanager.h>
#include <aggregation/aggregate.h>
-#include <utils/fancylineedit.h>
#include <utils/parameteraction.h>
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
@@ -85,7 +84,6 @@
#include <QAction>
#include <QApplication>
#include <QFileDialog>
-#include <QHBoxLayout>
#include <QMenu>
#include <QVBoxLayout>
@@ -129,32 +127,32 @@ private:
GitClient *m_client;
};
+class GitReflogEditorWidget : public GitEditorWidget
+{
+public:
+ GitReflogEditorWidget()
+ {
+ setLogEntryPattern("^([0-9a-f]{8,}) [^}]*\\}: .*$");
+ }
+
+ QString revisionSubject(const QTextBlock &inBlock) const override
+ {
+ const QString text = inBlock.text();
+ return text.mid(text.indexOf(' ') + 1);
+ }
+};
+
class GitLogEditorWidget : public QWidget
{
- Q_DECLARE_TR_FUNCTIONS(Git::Internal::GitLogEditorWidget);
public:
- GitLogEditorWidget()
+ GitLogEditorWidget(GitEditorWidget *gitEditor)
{
- auto gitEditor = new GitEditorWidget;
auto vlayout = new QVBoxLayout;
- auto hlayout = new QHBoxLayout;
vlayout->setSpacing(0);
vlayout->setContentsMargins(0, 0, 0, 0);
- auto grepLineEdit = addLineEdit(tr("Filter by message"),
- tr("Filter log entries by text in the commit message."));
- auto pickaxeLineEdit = addLineEdit(tr("Filter by content"),
- tr("Filter log entries by added or removed string."));
- hlayout->setSpacing(20);
- hlayout->setContentsMargins(0, 0, 0, 0);
- hlayout->addWidget(new QLabel(tr("Filter:")));
- hlayout->addWidget(grepLineEdit);
- hlayout->addWidget(pickaxeLineEdit);
- hlayout->addStretch();
- vlayout->addLayout(hlayout);
+ vlayout->addWidget(gitEditor->addFilterWidget());
vlayout->addWidget(gitEditor);
setLayout(vlayout);
- gitEditor->setGrepLineEdit(grepLineEdit);
- gitEditor->setPickaxeLineEdit(pickaxeLineEdit);
auto textAgg = Aggregation::Aggregate::parentAggregate(gitEditor);
auto agg = textAgg ? textAgg : new Aggregation::Aggregate;
@@ -162,17 +160,13 @@ public:
agg->add(gitEditor);
setFocusProxy(gitEditor);
}
+};
-private:
- FancyLineEdit *addLineEdit(const QString &placeholder, const QString &tooltip)
- {
- auto lineEdit = new FancyLineEdit;
- lineEdit->setFiltering(true);
- lineEdit->setToolTip(tooltip);
- lineEdit->setPlaceholderText(placeholder);
- lineEdit->setMaximumWidth(200);
- return lineEdit;
- }
+template<class Editor>
+class GitLogEditorWidgetT : public GitLogEditorWidget
+{
+public:
+ GitLogEditorWidgetT() : GitLogEditorWidget(new Editor) {}
};
const unsigned minimumRequiredVersion = 0x010900;
@@ -184,11 +178,11 @@ const VcsBaseSubmitEditorParameters submitParameters {
VcsBaseSubmitEditorParameters::DiffRows
};
-const VcsBaseEditorParameters commandLogEditorParameters {
+const VcsBaseEditorParameters svnLogEditorParameters {
OtherContent,
- Git::Constants::GIT_COMMAND_LOG_EDITOR_ID,
- Git::Constants::GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME,
- "text/vnd.qtcreator.git.commandlog"
+ Git::Constants::GIT_SVN_LOG_EDITOR_ID,
+ Git::Constants::GIT_SVN_LOG_EDITOR_DISPLAY_NAME,
+ "text/vnd.qtcreator.git.svnlog"
};
const VcsBaseEditorParameters logEditorParameters {
@@ -198,6 +192,13 @@ const VcsBaseEditorParameters logEditorParameters {
"text/vnd.qtcreator.git.log"
};
+const VcsBaseEditorParameters reflogEditorParameters {
+ LogOutput,
+ Git::Constants::GIT_REFLOG_EDITOR_ID,
+ Git::Constants::GIT_REFLOG_EDITOR_DISPLAY_NAME,
+ "text/vnd.qtcreator.git.reflog"
+};
+
const VcsBaseEditorParameters blameEditorParameters {
AnnotateOutput,
Git::Constants::GIT_BLAME_EDITOR_ID,
@@ -278,6 +279,7 @@ public:
void blameFile();
void logProject();
void logRepository();
+ void reflogRepository();
void undoFileChanges(bool revertStaging);
void resetRepository();
void recoverDeletedFiles();
@@ -388,15 +390,21 @@ public:
GitGrep gitGrep{&m_gitClient};
- VcsEditorFactory commandLogEditorFactory {
- &commandLogEditorParameters,
+ VcsEditorFactory svnLogEditorFactory {
+ &svnLogEditorParameters,
[] { return new GitEditorWidget; },
std::bind(&GitPluginPrivate::describe, this, _1, _2)
};
VcsEditorFactory logEditorFactory {
&logEditorParameters,
- [] { return new GitLogEditorWidget; },
+ [] { return new GitLogEditorWidgetT<GitEditorWidget>; },
+ std::bind(&GitPluginPrivate::describe, this, _1, _2)
+ };
+
+ VcsEditorFactory reflogEditorFactory {
+ &reflogEditorParameters,
+ [] { return new GitLogEditorWidgetT<GitReflogEditorWidget>; },
std::bind(&GitPluginPrivate::describe, this, _1, _2)
};
@@ -707,7 +715,7 @@ GitPluginPrivate::GitPluginPrivate()
context, true, std::bind(&GitPluginPrivate::logRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Reflog"), "Git.ReflogRepository",
- context, true, &GitClient::reflog);
+ context, true, std::bind(&GitPluginPrivate::reflogRepository, this));
createRepositoryAction(localRepositoryMenu, tr("Clean..."), "Git.CleanRepository",
context, true, [this] { cleanRepository(); });
@@ -974,7 +982,10 @@ GitPluginPrivate::GitPluginPrivate()
this, [this](const QString &name) {
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return);
- m_gitClient.show(state.topLevel(), name);
+ if (name.contains(".."))
+ m_gitClient.log(state.topLevel(), {}, false, {name});
+ else
+ m_gitClient.show(state.topLevel(), name);
});
}
@@ -1057,6 +1068,13 @@ void GitPluginPrivate::logRepository()
m_gitClient.log(state.topLevel());
}
+void GitPluginPrivate::reflogRepository()
+{
+ const VcsBasePluginState state = currentState();
+ QTC_ASSERT(state.hasTopLevel(), return);
+ m_gitClient.reflog(state.topLevel());
+}
+
void GitPluginPrivate::undoFileChanges(bool revertStaging)
{
if (IDocument *document = EditorManager::currentDocument()) {
diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp
index 097dd276f3f..030fe848cc5 100644
--- a/src/plugins/git/gitsettings.cpp
+++ b/src/plugins/git/gitsettings.cpp
@@ -47,6 +47,7 @@ const QLatin1String GitSettings::graphLogKey("GraphLog");
const QLatin1String GitSettings::firstParentKey("FirstParent");
const QLatin1String GitSettings::followRenamesKey("FollowRenames");
const QLatin1String GitSettings::lastResetIndexKey("LastResetIndex");
+const QLatin1String GitSettings::refLogShowDateKey("RefLogShowDate");
GitSettings::GitSettings()
{
@@ -69,6 +70,7 @@ GitSettings::GitSettings()
declareKey(firstParentKey, false);
declareKey(followRenamesKey, true);
declareKey(lastResetIndexKey, 0);
+ declareKey(refLogShowDateKey, false);
}
Utils::FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const
diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h
index 73e42a3c724..8117011b2da 100644
--- a/src/plugins/git/gitsettings.h
+++ b/src/plugins/git/gitsettings.h
@@ -58,6 +58,7 @@ public:
static const QLatin1String firstParentKey;
static const QLatin1String followRenamesKey;
static const QLatin1String lastResetIndexKey;
+ static const QLatin1String refLogShowDateKey;
Utils::FilePath gitExecutable(bool *ok = nullptr, QString *errorMessage = nullptr) const;
diff --git a/src/plugins/git/gitutils.cpp b/src/plugins/git/gitutils.cpp
index c0f5ffd7544..1161d2cfcd9 100644
--- a/src/plugins/git/gitutils.cpp
+++ b/src/plugins/git/gitutils.cpp
@@ -69,7 +69,6 @@ bool Stash::parseStashLine(const QString &l)
bool inputText(QWidget *parent, const QString &title, const QString &prompt, QString *s)
{
QInputDialog dialog(parent);
- dialog.setWindowFlags(dialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog.setWindowTitle(title);
dialog.setLabelText(prompt);
dialog.setTextValue(*s);
diff --git a/src/plugins/git/logchangedialog.cpp b/src/plugins/git/logchangedialog.cpp
index e57dda49e0f..25c59bbcb7f 100644
--- a/src/plugins/git/logchangedialog.cpp
+++ b/src/plugins/git/logchangedialog.cpp
@@ -227,7 +227,6 @@ LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) :
connect(m_widget, &LogChangeWidget::activated, okButton, [okButton] { okButton->animateClick(); });
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
resize(600, 400);
}
diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp
index 50b7a994f24..b0e629f0643 100644
--- a/src/plugins/git/remotedialog.cpp
+++ b/src/plugins/git/remotedialog.cpp
@@ -53,7 +53,6 @@ public:
m_remoteNames(remoteNames)
{
m_ui.setupUi(this);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui.nameEdit->setValidationFunction([this](Utils::FancyLineEdit *edit, QString *errorMessage) {
if (!edit)
return false;
@@ -127,7 +126,6 @@ RemoteDialog::RemoteDialog(QWidget *parent) :
m_remoteModel(new RemoteModel(this))
{
setModal(false);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setAttribute(Qt::WA_DeleteOnClose, true); // Do not update unnecessarily
m_ui->setupUi(this);
diff --git a/src/plugins/git/stashdialog.cpp b/src/plugins/git/stashdialog.cpp
index e20cb6dcc89..ef1b324f58f 100644
--- a/src/plugins/git/stashdialog.cpp
+++ b/src/plugins/git/stashdialog.cpp
@@ -102,7 +102,6 @@ StashDialog::StashDialog(QWidget *parent) : QDialog(parent),
m_restoreCurrentInBranchButton(new QPushButton(tr("Restore to &Branch..."))),
m_refreshButton(new QPushButton(tr("Re&fresh")))
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setAttribute(Qt::WA_DeleteOnClose, true); // Do not update unnecessarily
ui->setupUi(this);
diff --git a/src/plugins/help/openpageswidget.cpp b/src/plugins/help/openpageswidget.cpp
index 48e2ce223f5..0704627a973 100644
--- a/src/plugins/help/openpageswidget.cpp
+++ b/src/plugins/help/openpageswidget.cpp
@@ -111,7 +111,7 @@ void OpenPagesWidget::handleActivated(const QModelIndex &index)
// work around a bug in itemviews where the delegate wouldn't get the QStyle::State_MouseOver
QWidget *vp = viewport();
const QPoint &cursorPos = QCursor::pos();
- QMouseEvent e(QEvent::MouseMove, vp->mapFromGlobal(cursorPos), cursorPos, Qt::NoButton, nullptr, nullptr);
+ QMouseEvent e(QEvent::MouseMove, vp->mapFromGlobal(cursorPos), cursorPos, Qt::NoButton, {}, {});
QCoreApplication::sendEvent(vp, &e);
}
}
diff --git a/src/plugins/imageviewer/exportdialog.cpp b/src/plugins/imageviewer/exportdialog.cpp
index 682a7dfd30f..37a59b96259 100644
--- a/src/plugins/imageviewer/exportdialog.cpp
+++ b/src/plugins/imageviewer/exportdialog.cpp
@@ -88,8 +88,6 @@ ExportDialog::ExportDialog(QWidget *parent)
, m_heightSpinBox(new QSpinBox(this))
, m_aspectRatio(1)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
auto formLayout = new QFormLayout(this);
m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5);
diff --git a/src/plugins/imageviewer/multiexportdialog.cpp b/src/plugins/imageviewer/multiexportdialog.cpp
index b47c52aaeba..b377cc72436 100644
--- a/src/plugins/imageviewer/multiexportdialog.cpp
+++ b/src/plugins/imageviewer/multiexportdialog.cpp
@@ -184,8 +184,6 @@ MultiExportDialog::MultiExportDialog(QWidget *parent)
, m_pathChooser(new Utils::PathChooser(this))
, m_sizesLineEdit(new QLineEdit)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
-
auto formLayout = new QFormLayout(this);
m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5);
diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp
index 5d62cdfeb9a..bb74a7bcab3 100644
--- a/src/plugins/languageclient/client.cpp
+++ b/src/plugins/languageclient/client.cpp
@@ -247,8 +247,8 @@ void Client::initialize()
QTC_ASSERT(m_clientInterface, return);
QTC_ASSERT(m_state == Uninitialized, return);
qCDebug(LOGLSPCLIENT) << "initializing language server " << m_displayName;
- auto initRequest = new InitializeRequest();
- auto params = initRequest->params().value_or(InitializeParams());
+ InitializeRequest initRequest;
+ auto params = initRequest.params().value_or(InitializeParams());
params.setCapabilities(generateClientCapabilities());
if (m_project) {
params.setRootUri(DocumentUri::fromFilePath(m_project->projectDirectory()));
@@ -256,13 +256,13 @@ void Client::initialize()
return WorkSpaceFolder(pro->projectDirectory().toString(), pro->displayName());
}));
}
- initRequest->setParams(params);
- initRequest->setResponseCallback([this](const InitializeRequest::Response &initResponse){
+ initRequest.setParams(params);
+ initRequest.setResponseCallback([this](const InitializeRequest::Response &initResponse){
initializeCallback(initResponse);
});
// directly send data otherwise the state check would fail;
- initRequest->registerResponseHandler(&m_responseHandlers);
- m_clientInterface->sendMessage(initRequest->toBaseMessage());
+ initRequest.registerResponseHandler(&m_responseHandlers);
+ m_clientInterface->sendMessage(initRequest.toBaseMessage());
m_state = InitializeRequested;
}
@@ -357,7 +357,7 @@ void Client::closeDocument(TextEditor::TextDocument *document)
deactivateDocument(document);
const DocumentUri &uri = DocumentUri::fromFilePath(document->filePath());
m_highlights[uri].clear();
- if (m_openedDocument.remove(document) != 0) {
+ if (m_openedDocument.remove(document) != 0 && m_state == Initialized) {
DidCloseTextDocumentParams params(TextDocumentIdentifier{uri});
sendContent(DidCloseTextDocumentNotification(params));
}
@@ -475,7 +475,7 @@ void Client::documentContentsChanged(TextEditor::TextDocument *document,
int charsRemoved,
int charsAdded)
{
- if (!m_openedDocument.contains(document))
+ if (!m_openedDocument.contains(document) || !reachable())
return;
const QString method(DidChangeTextDocumentNotification::methodName);
TextDocumentSyncKind syncKind = m_serverCapabilities.textDocumentSyncKindHelper();
@@ -912,11 +912,12 @@ bool Client::reset()
m_responseHandlers.clear();
m_clientInterface->resetBuffer();
updateEditorToolBar(m_openedDocument.keys());
- m_openedDocument.clear();
m_serverCapabilities = ServerCapabilities();
m_dynamicCapabilities.reset();
for (const DocumentUri &uri : m_diagnostics.keys())
removeDiagnostics(uri);
+ for (TextEditor::TextDocument *document : m_openedDocument.keys())
+ document->disconnect(this);
for (TextEditor::TextDocument *document : m_resetAssistProvider.keys())
resetAssistProviders(document);
return true;
diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp
index a88af2666a2..ae2eca2ff63 100644
--- a/src/plugins/languageclient/languageclientcompletionassist.cpp
+++ b/src/plugins/languageclient/languageclientcompletionassist.cpp
@@ -278,13 +278,14 @@ public:
IAssistProposal *perform(const AssistInterface *interface) override;
bool running() override;
bool needsRestart() const override { return true; }
+ void cancel() override;
private:
void handleCompletionResponse(const CompletionRequest::Response &response);
QPointer<QTextDocument> m_document;
QPointer<Client> m_client;
- bool m_running = false;
+ MessageId m_currentRequest;
int m_pos = -1;
};
@@ -336,7 +337,7 @@ IAssistProposal *LanguageClientCompletionAssistProcessor::perform(const AssistIn
});
completionRequest.setParams(params);
m_client->sendContent(completionRequest);
- m_running = true;
+ m_currentRequest = completionRequest.id();
m_document = interface->textDocument();
qCDebug(LOGLSPCOMPLETION) << QTime::currentTime()
<< " : request completions at " << m_pos
@@ -346,14 +347,22 @@ IAssistProposal *LanguageClientCompletionAssistProcessor::perform(const AssistIn
bool LanguageClientCompletionAssistProcessor::running()
{
- return m_running;
+ return m_currentRequest.isValid();
+}
+
+void LanguageClientCompletionAssistProcessor::cancel()
+{
+ if (running()) {
+ m_client->cancelRequest(m_currentRequest);
+ m_currentRequest = MessageId();
+ }
}
void LanguageClientCompletionAssistProcessor::handleCompletionResponse(
const CompletionRequest::Response &response)
{
qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : got completions";
- m_running = false;
+ m_currentRequest = MessageId();
QTC_ASSERT(m_client, return);
if (auto error = response.error()) {
m_client->log(error.value());
diff --git a/src/plugins/languageclient/languageclientfunctionhint.cpp b/src/plugins/languageclient/languageclientfunctionhint.cpp
index 5e711adec67..33618649735 100644
--- a/src/plugins/languageclient/languageclientfunctionhint.cpp
+++ b/src/plugins/languageclient/languageclientfunctionhint.cpp
@@ -65,14 +65,15 @@ class FunctionHintProcessor : public IAssistProcessor
public:
explicit FunctionHintProcessor(Client *client) : m_client(client) {}
IAssistProposal *perform(const AssistInterface *interface) override;
- bool running() override { return m_running; }
+ bool running() override { return m_currentRequest.isValid(); }
bool needsRestart() const override { return true; }
+ void cancel() override;
private:
void handleSignatureResponse(const SignatureHelpRequest::Response &response);
QPointer<Client> m_client;
- bool m_running = false;
+ MessageId m_currentRequest;
int m_pos = -1;
};
@@ -87,13 +88,21 @@ IAssistProposal *FunctionHintProcessor::perform(const AssistInterface *interface
request.setParams(TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(cursor)));
request.setResponseCallback([this](auto response) { this->handleSignatureResponse(response); });
m_client->sendContent(request);
- m_running = true;
+ m_currentRequest = request.id();
return nullptr;
}
+void FunctionHintProcessor::cancel()
+{
+ if (running()) {
+ m_client->cancelRequest(m_currentRequest);
+ m_currentRequest = MessageId();
+ }
+}
+
void FunctionHintProcessor::handleSignatureResponse(const SignatureHelpRequest::Response &response)
{
- m_running = false;
+ m_currentRequest = MessageId();
if (auto error = response.error())
m_client->log(error.value());
FunctionHintProposalModelPtr model(
diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp
index 4e2f3710247..27e74683132 100644
--- a/src/plugins/languageclient/languageclientmanager.cpp
+++ b/src/plugins/languageclient/languageclientmanager.cpp
@@ -366,6 +366,8 @@ void LanguageClientManager::clientFinished(Client *client)
client->log(tr("Unexpectedly finished. Restarting in %1 seconds.").arg(restartTimeoutS),
Core::MessageManager::Flash);
QTimer::singleShot(restartTimeoutS * 1000, client, [client]() { startClient(client); });
+ for (TextEditor::TextDocument *document : m_clientForDocument.keys(client))
+ client->deactivateDocument(document);
} else {
if (unexpectedFinish && !m_shuttingDown)
client->log(tr("Unexpectedly finished."), Core::MessageManager::Flash);
@@ -397,7 +399,8 @@ void LanguageClientManager::editorOpened(Core::IEditor *editor)
if (!widget)
return;
if (Client *client = clientForDocument(widget->textDocument()))
- client->cursorPositionChanged(widget);
+ if (client->reachable())
+ client->cursorPositionChanged(widget);
});
});
updateEditorToolBar(editor);
diff --git a/src/plugins/languageclient/languageclientquickfix.cpp b/src/plugins/languageclient/languageclientquickfix.cpp
index 90e9b23de69..f3b86377aee 100644
--- a/src/plugins/languageclient/languageclientquickfix.cpp
+++ b/src/plugins/languageclient/languageclientquickfix.cpp
@@ -84,15 +84,16 @@ class LanguageClientQuickFixAssistProcessor : public IAssistProcessor
{
public:
explicit LanguageClientQuickFixAssistProcessor(Client *client) : m_client(client) {}
- bool running() override { return m_running; }
+ bool running() override { return m_currentRequest.isValid(); }
IAssistProposal *perform(const AssistInterface *interface) override;
+ void cancel() override;
private:
void handleCodeActionResponse(const CodeActionRequest::Response &response);
QSharedPointer<const AssistInterface> m_assistInterface;
Client *m_client = nullptr; // not owned
- bool m_running = false;
+ MessageId m_currentRequest;
};
IAssistProposal *LanguageClientQuickFixAssistProcessor::perform(const AssistInterface *interface)
@@ -123,14 +124,22 @@ IAssistProposal *LanguageClientQuickFixAssistProcessor::perform(const AssistInte
});
m_client->requestCodeActions(request);
- m_running = true;
+ m_currentRequest = request.id();
return nullptr;
}
+void LanguageClientQuickFixAssistProcessor::cancel()
+{
+ if (running()) {
+ m_client->cancelRequest(m_currentRequest);
+ m_currentRequest = MessageId();
+ }
+}
+
void LanguageClientQuickFixAssistProcessor::handleCodeActionResponse(
const CodeActionRequest::Response &response)
{
- m_running = false;
+ m_currentRequest = MessageId();
if (const Utils::optional<CodeActionRequest::Response::Error> &error = response.error())
m_client->log(*error);
QuickFixOperations ops;
diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp
index cfafd86cbb7..c27a8f599a6 100644
--- a/src/plugins/languageclient/languageclientsettings.cpp
+++ b/src/plugins/languageclient/languageclientsettings.cpp
@@ -842,7 +842,6 @@ public:
connect(filter, &QLineEdit::textChanged, proxy, &QSortFilterProxyModel::setFilterWildcard);
listView->setModel(proxy);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setModal(true);
}
diff --git a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp
index 5ea78779eb3..1f9b4dbe67e 100644
--- a/src/plugins/mcusupport/mcusupportrunconfiguration.cpp
+++ b/src/plugins/mcusupport/mcusupportrunconfiguration.cpp
@@ -54,10 +54,7 @@ static QStringList flashAndRunArgs(const Target *target)
const QString projectName = target->project()->displayName();
// TODO: Hack! Implement flash target name handling, properly
- const QString targetName =
- target->kit()->value(Constants::KIT_MCUTARGET_VENDOR_KEY).toString() == "NXP"
- ? QString("flash_%1").arg(projectName)
- : QString("flash_%1_and_bootloader").arg(projectName);
+ const QString targetName = "flash_" + projectName;
return {"--build", ".", "--target", targetName};
}
diff --git a/src/plugins/mercurial/constants.h b/src/plugins/mercurial/constants.h
index 1813d16723b..7f8982d49ee 100644
--- a/src/plugins/mercurial/constants.h
+++ b/src/plugins/mercurial/constants.h
@@ -37,10 +37,10 @@ const char MERCURIALDEFAULT[] = "hg";
const char MERCURIAL_CONTEXT[] = "Mercurial Context";
// Changeset identifiers
-const char CHANGESETID12[] = " ([a-f0-9]{12,12}) "; //match 12 hex chars and capture
-const char CHANGESETID40[] = " ([a-f0-9]{40,40}) ";
-const char CHANGEIDEXACT12[] = "[a-f0-9]{12,12}"; //match 12 hex chars a
-const char CHANGEIDEXACT40[] = "[a-f0-9]{40,40}";
+const char CHANGESETID12[] = " ([a-f0-9]{12}) "; //match 12 hex chars and capture
+const char CHANGESETID40[] = " ([a-f0-9]{40}) ";
+const char CHANGEIDEXACT12[] = "[a-f0-9]{12}"; //match 12 hex chars
+const char CHANGEIDEXACT40[] = "[a-f0-9]{40}";
// match diff header. e.g. +++ b/filename
const char DIFFIDENTIFIER[] = "^(?:diff --git a/|[+-]{3} (?:/dev/null|[ab]/(.+$)))";
diff --git a/src/plugins/mercurial/mercurialeditor.cpp b/src/plugins/mercurial/mercurialeditor.cpp
index e4c313e11ab..3523d72efc1 100644
--- a/src/plugins/mercurial/mercurialeditor.cpp
+++ b/src/plugins/mercurial/mercurialeditor.cpp
@@ -42,33 +42,18 @@
namespace Mercurial {
namespace Internal {
+// use QRegularExpression::anchoredPattern() when minimum Qt is raised to 5.12+
MercurialEditorWidget::MercurialEditorWidget(MercurialClient *client) :
- exactIdentifier12(QLatin1String(Constants::CHANGEIDEXACT12)),
- exactIdentifier40(QLatin1String(Constants::CHANGEIDEXACT40)),
- changesetIdentifier12(QLatin1String(Constants::CHANGESETID12)),
- changesetIdentifier40(QLatin1String(Constants::CHANGESETID40)),
+ exactIdentifier12(QString("\\A(?:") + Constants::CHANGEIDEXACT12 + QString(")\\z")),
+ exactIdentifier40(QString("\\A(?:") + Constants::CHANGEIDEXACT40 + QString(")\\z")),
+ changesetIdentifier40(Constants::CHANGESETID40),
m_client(client)
{
- setDiffFilePattern(QRegExp(QLatin1String(Constants::DIFFIDENTIFIER)));
- setLogEntryPattern(QRegExp(QLatin1String("^changeset:\\s+(\\S+)$")));
+ setDiffFilePattern(Constants::DIFFIDENTIFIER);
+ setLogEntryPattern("^changeset:\\s+(\\S+)$");
setAnnotateRevisionTextFormat(tr("&Annotate %1"));
setAnnotatePreviousRevisionTextFormat(tr("Annotate &parent revision %1"));
-}
-
-QSet<QString> MercurialEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- const QString data = toPlainText();
- if (data.isEmpty())
- return changes;
-
- int position = 0;
- while ((position = changesetIdentifier12.indexIn(data, position)) != -1) {
- changes.insert(changesetIdentifier12.cap(1));
- position += changesetIdentifier12.matchedLength();
- }
-
- return changes;
+ setAnnotationEntryPattern(Constants::CHANGESETID12);
}
QString MercurialEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const
@@ -77,9 +62,9 @@ QString MercurialEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) co
cursor.select(QTextCursor::WordUnderCursor);
if (cursor.hasSelection()) {
const QString change = cursor.selectedText();
- if (exactIdentifier12.exactMatch(change))
+ if (exactIdentifier12.match(change).hasMatch())
return change;
- if (exactIdentifier40.exactMatch(change))
+ if (exactIdentifier40.match(change).hasMatch())
return change;
}
return QString();
diff --git a/src/plugins/mercurial/mercurialeditor.h b/src/plugins/mercurial/mercurialeditor.h
index 12976a3d779..40bf68854d5 100644
--- a/src/plugins/mercurial/mercurialeditor.h
+++ b/src/plugins/mercurial/mercurialeditor.h
@@ -27,7 +27,7 @@
#include <vcsbase/vcsbaseeditor.h>
-#include <QRegExp>
+#include <QRegularExpression>
namespace Mercurial {
namespace Internal {
@@ -41,17 +41,15 @@ public:
explicit MercurialEditorWidget(MercurialClient *client);
private:
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &cursor) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(
const QSet<QString> &changes) const override;
QString decorateVersion(const QString &revision) const override;
QStringList annotationPreviousVersions(const QString &revision) const override;
- mutable QRegExp exactIdentifier12;
- mutable QRegExp exactIdentifier40;
- mutable QRegExp changesetIdentifier12;
- const QRegExp changesetIdentifier40;
+ const QRegularExpression exactIdentifier12;
+ const QRegularExpression exactIdentifier40;
+ const QRegularExpression changesetIdentifier40;
MercurialClient *m_client;
};
diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp
index e686d4e427b..4566efc3572 100644
--- a/src/plugins/perforce/perforceeditor.cpp
+++ b/src/plugins/perforce/perforceeditor.cpp
@@ -35,7 +35,6 @@
#include <QDebug>
#include <QFileInfo>
#include <QProcess>
-#include <QRegExp>
#include <QSet>
#include <QTextStream>
@@ -52,7 +51,7 @@ namespace Internal {
// ------------ PerforceEditor
PerforceEditorWidget::PerforceEditorWidget() :
- m_changeNumberPattern(QLatin1String("^\\d+$"))
+ m_changeNumberPattern("^\\d+$")
{
QTC_CHECK(m_changeNumberPattern.isValid());
// Diff format:
@@ -60,31 +59,10 @@ PerforceEditorWidget::PerforceEditorWidget() :
// 2) "==== //depot/.../mainwindow.cpp#15 (text) ====" (created by p4 describe)
// 3) --- //depot/XXX/closingkit/trunk/source/cui/src/cui_core.cpp<tab>2012-02-08 13:54:01.000000000 0100
// +++ P:/XXX\closingkit\trunk\source\cui\src\cui_core.cpp<tab>2012-02-08 13:54:01.000000000 0100
- setDiffFilePattern(QRegExp(QLatin1String("^(?:={4}|\\+{3}) (.+)(?:\\t|#\\d)")));
- setLogEntryPattern(QRegExp(QLatin1String("^... #\\d change (\\d+) ")));
+ setDiffFilePattern("^(?:={4}|\\+{3}) (.+)(?:\\t|#\\d)");
+ setLogEntryPattern("^... #\\d change (\\d+) ");
setAnnotateRevisionTextFormat(tr("Annotate change list \"%1\""));
-}
-
-QSet<QString> PerforceEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- const QString txt = toPlainText();
- if (txt.isEmpty())
- return changes;
- // Hunt for first change number in annotation: "<change>:"
- QRegExp r(QLatin1String("^(\\d+):"));
- QTC_ASSERT(r.isValid(), return changes);
- if (r.indexIn(txt) != -1) {
- changes.insert(r.cap(1));
- r.setPattern(QLatin1String("\n(\\d+):"));
- QTC_ASSERT(r.isValid(), return changes);
- int pos = 0;
- while ((pos = r.indexIn(txt, pos)) != -1) {
- pos += r.matchedLength();
- changes.insert(r.cap(1));
- }
- }
- return changes;
+ setAnnotationEntryPattern("^(\\d+):");
}
QString PerforceEditorWidget::changeUnderCursor(const QTextCursor &c) const
@@ -95,7 +73,7 @@ QString PerforceEditorWidget::changeUnderCursor(const QTextCursor &c) const
if (!cursor.hasSelection())
return QString();
const QString change = cursor.selectedText();
- return m_changeNumberPattern.exactMatch(change) ? change : QString();
+ return m_changeNumberPattern.match(change).hasMatch() ? change : QString();
}
VcsBase::BaseAnnotationHighlighter *PerforceEditorWidget::createAnnotationHighlighter(const QSet<QString> &changes) const
diff --git a/src/plugins/perforce/perforceeditor.h b/src/plugins/perforce/perforceeditor.h
index 2a91373aacd..67e939f6e5d 100644
--- a/src/plugins/perforce/perforceeditor.h
+++ b/src/plugins/perforce/perforceeditor.h
@@ -27,7 +27,7 @@
#include <vcsbase/vcsbaseeditor.h>
-#include <QRegExp>
+#include <QRegularExpression>
namespace Perforce {
namespace Internal {
@@ -40,14 +40,13 @@ public:
PerforceEditorWidget();
private:
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(
const QSet<QString> &changes) const override;
QString findDiffFile(const QString &f) const override;
QStringList annotationPreviousVersions(const QString &v) const override;
- mutable QRegExp m_changeNumberPattern;
+ const QRegularExpression m_changeNumberPattern;
};
} // namespace Perforce
diff --git a/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp b/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
index 49385fbaa9c..d8ed9082b1c 100644
--- a/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
+++ b/src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
@@ -152,9 +152,9 @@ int PerfProfilerFlameGraphModel::rowCount(const QModelIndex &parent) const
{
if (parent.isValid()) {
Data *parentData = static_cast<Data *>(parent.internalPointer());
- return parentData->children.size();
+ return int(parentData->children.size());
}
- return m_stackBottom->children.size();
+ return int(m_stackBottom->children.size());
}
int PerfProfilerFlameGraphModel::columnCount(const QModelIndex &parent) const
diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h
index 3d125f5bb36..35730eccc78 100644
--- a/src/plugins/projectexplorer/buildconfiguration.h
+++ b/src/plugins/projectexplorer/buildconfiguration.h
@@ -105,7 +105,7 @@ public:
static QString buildTypeName(BuildType type);
- bool isActive() const override;
+ bool isActive() const;
static void prependCompilerPathToEnvironment(Kit *k, Utils::Environment &env);
void updateCacheAndEmitEnvironmentChanged();
diff --git a/src/plugins/projectexplorer/buildmanager.cpp b/src/plugins/projectexplorer/buildmanager.cpp
index 663cf22f8e4..720b501681d 100644
--- a/src/plugins/projectexplorer/buildmanager.cpp
+++ b/src/plugins/projectexplorer/buildmanager.cpp
@@ -791,6 +791,7 @@ bool BuildManager::buildLists(const QList<BuildStepList *> bsls, const QStringLi
bool success = buildQueueAppend(steps, names, preambelMessage);
if (!success) {
d->m_outputWindow->popup(IOutputPane::NoModeSwitch);
+ d->m_isDeploying = false;
return false;
}
diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp
index 67d45fbcd54..275d9fdcfbf 100644
--- a/src/plugins/projectexplorer/buildstep.cpp
+++ b/src/plugins/projectexplorer/buildstep.cpp
@@ -260,11 +260,6 @@ void BuildStep::reportRunResult(QFutureInterface<bool> &fi, bool success)
fi.reportFinished();
}
-bool BuildStep::isActive() const
-{
- return projectConfiguration()->isActive();
-}
-
bool BuildStep::widgetExpandedByDefault() const
{
return m_widgetExpandedByDefault;
diff --git a/src/plugins/projectexplorer/buildstep.h b/src/plugins/projectexplorer/buildstep.h
index 9a1e3120f6a..b8dd6b67181 100644
--- a/src/plugins/projectexplorer/buildstep.h
+++ b/src/plugins/projectexplorer/buildstep.h
@@ -100,8 +100,6 @@ public:
static void reportRunResult(QFutureInterface<bool> &fi, bool success);
- bool isActive() const override;
-
bool widgetExpandedByDefault() const;
void setWidgetExpandedByDefault(bool widgetExpandedByDefault);
diff --git a/src/plugins/projectexplorer/deployconfiguration.h b/src/plugins/projectexplorer/deployconfiguration.h
index 156fb526749..6cd85b62a3e 100644
--- a/src/plugins/projectexplorer/deployconfiguration.h
+++ b/src/plugins/projectexplorer/deployconfiguration.h
@@ -56,7 +56,7 @@ public:
bool fromMap(const QVariantMap &map) override;
QVariantMap toMap() const override;
- bool isActive() const override;
+ bool isActive() const;
bool usesCustomDeploymentData() const { return m_usesCustomDeploymentData; }
void setUseCustomDeploymentData(bool enabled) { m_usesCustomDeploymentData = enabled; }
diff --git a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp
index 2e0cf6a6606..3734977c4b3 100644
--- a/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp
+++ b/src/plugins/projectexplorer/devicesupport/deviceprocessesdialog.cpp
@@ -124,7 +124,6 @@ DeviceProcessesDialogPrivate::DeviceProcessesDialogPrivate(KitChooser *chooser,
, buttonBox(new QDialogButtonBox(parent))
{
q->setWindowTitle(DeviceProcessesDialog::tr("List of Processes"));
- q->setWindowFlags(q->windowFlags() & ~Qt::WindowContextHelpButtonHint);
q->setMinimumHeight(500);
processList = nullptr;
diff --git a/src/plugins/projectexplorer/projectconfiguration.h b/src/plugins/projectexplorer/projectconfiguration.h
index a87a264c420..0aa0e9f85ee 100644
--- a/src/plugins/projectexplorer/projectconfiguration.h
+++ b/src/plugins/projectexplorer/projectconfiguration.h
@@ -190,8 +190,6 @@ public:
Target *target() const;
Project *project() const;
- virtual bool isActive() const = 0;
-
static QString settingsIdKey();
template<class Aspect, typename ...Args>
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 75de3f5cc24..575543d77bd 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -2859,8 +2859,7 @@ static bool hasDeploySettings(Project *pro)
{
return Utils::anyOf(SessionManager::projectOrder(pro), [](Project *project) {
return project->activeTarget()
- && project->activeTarget()->activeDeployConfiguration()
- && !project->activeTarget()->activeDeployConfiguration()->stepList()->isEmpty();
+ && project->activeTarget()->activeDeployConfiguration();
});
}
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index de54858abc6..f79001a571c 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -128,7 +128,7 @@ class PROJECTEXPLORER_EXPORT RunConfiguration : public ProjectConfiguration
public:
~RunConfiguration() override;
- bool isActive() const override;
+ bool isActive() const;
virtual QString disabledReason() const;
virtual bool isEnabled() const;
diff --git a/src/plugins/projectexplorer/sessionmodel.cpp b/src/plugins/projectexplorer/sessionmodel.cpp
index 9e926941166..a535294f91d 100644
--- a/src/plugins/projectexplorer/sessionmodel.cpp
+++ b/src/plugins/projectexplorer/sessionmodel.cpp
@@ -165,7 +165,7 @@ QVariant SessionModel::data(const QModelIndex &index, int role) const
QHash<int, QByteArray> SessionModel::roleNames() const
{
- static QHash<int, QByteArray> extraRoles{
+ static const QHash<int, QByteArray> extraRoles{
{Qt::DisplayRole, "sessionName"},
{DefaultSessionRole, "defaultSession"},
{ActiveSessionRole, "activeSession"},
@@ -173,7 +173,9 @@ QHash<int, QByteArray> SessionModel::roleNames() const
{ProjectsPathRole, "projectsPath"},
{ProjectsDisplayRole, "projectsName"}
};
- return QAbstractTableModel::roleNames().unite(extraRoles);
+ QHash<int, QByteArray> roles = QAbstractTableModel::roleNames();
+ Utils::addToHash(&roles, extraRoles);
+ return roles;
}
void SessionModel::sort(int column, Qt::SortOrder order)
diff --git a/src/plugins/projectexplorer/toolchainoptionspage.h b/src/plugins/projectexplorer/toolchainoptionspage.h
index 1cb067e5607..9bcf90cab1b 100644
--- a/src/plugins/projectexplorer/toolchainoptionspage.h
+++ b/src/plugins/projectexplorer/toolchainoptionspage.h
@@ -27,11 +27,15 @@
#include <coreplugin/dialogs/ioptionspage.h>
+#include <QCoreApplication>
+
namespace ProjectExplorer {
namespace Internal {
class ToolChainOptionsPage final : public Core::IOptionsPage
{
+ Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::ToolChainOptionsPage)
+
public:
ToolChainOptionsPage();
};
diff --git a/src/plugins/projectexplorer/waitforstopdialog.cpp b/src/plugins/projectexplorer/waitforstopdialog.cpp
index 1a7852989d9..f2d3abb1521 100644
--- a/src/plugins/projectexplorer/waitforstopdialog.cpp
+++ b/src/plugins/projectexplorer/waitforstopdialog.cpp
@@ -39,7 +39,6 @@ WaitForStopDialog::WaitForStopDialog(QList<ProjectExplorer::RunControl *> runCon
m_runControls(runControls)
{
setWindowTitle(tr("Waiting for Applications to Stop"));
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
auto layout = new QVBoxLayout();
setLayout(layout);
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp
index bc0309a3028..e584a90e4d3 100644
--- a/src/plugins/python/pythonutils.cpp
+++ b/src/plugins/python/pythonutils.cpp
@@ -44,6 +44,7 @@
#include <texteditor/textdocument.h>
#include <utils/qtcassert.h>
+#include <utils/runextensions.h>
#include <utils/synchronousprocess.h>
#include <QDir>
@@ -144,19 +145,18 @@ static PythonLanguageServerState checkPythonLanguageServer(const FilePath &pytho
using namespace LanguageClient;
SynchronousProcess pythonProcess;
const CommandLine pythonLShelpCommand(python, {"-m", "pyls", "-h"});
- SynchronousProcessResponse response = pythonProcess.runBlocking(pythonLShelpCommand);
- if (response.allOutput().contains("Python Language Server")) {
- const FilePath &modulePath = getPylsModulePath(pythonLShelpCommand);
- for (const StdIOSettings *serverSetting : configuredPythonLanguageServer()) {
- if (modulePath == getPylsModulePath(serverSetting->command())) {
- return {serverSetting->m_enabled ? PythonLanguageServerState::AlreadyConfigured
- : PythonLanguageServerState::ConfiguredButDisabled,
- FilePath()};
- }
+ const FilePath &modulePath = getPylsModulePath(pythonLShelpCommand);
+ for (const StdIOSettings *serverSetting : configuredPythonLanguageServer()) {
+ if (modulePath == getPylsModulePath(serverSetting->command())) {
+ return {serverSetting->m_enabled ? PythonLanguageServerState::AlreadyConfigured
+ : PythonLanguageServerState::ConfiguredButDisabled,
+ FilePath()};
}
+ }
+ SynchronousProcessResponse response = pythonProcess.runBlocking(pythonLShelpCommand);
+ if (response.allOutput().contains("Python Language Server"))
return {PythonLanguageServerState::AlreadyInstalled, modulePath};
- }
const CommandLine pythonPipVersionCommand(python, {"-m", "pip", "-V"});
response = pythonProcess.runBlocking(pythonPipVersionCommand);
@@ -368,11 +368,38 @@ void PyLSConfigureAssistant::documentOpened(Core::IDocument *document)
void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
TextEditor::TextDocument *document)
{
- const PythonLanguageServerState &lsState = checkPythonLanguageServer(python);
+ using CheckPylsWatcher = QFutureWatcher<PythonLanguageServerState>;
+
+ QPointer<CheckPylsWatcher> watcher = new CheckPylsWatcher();
+ watcher->setFuture(Utils::runAsync(&checkPythonLanguageServer, python));
- if (lsState.state == PythonLanguageServerState::CanNotBeInstalled)
+ // cancel and delete watcher after a 10 second timeout
+ QTimer::singleShot(10000, this, [watcher]() {
+ if (watcher) {
+ watcher->cancel();
+ watcher->deleteLater();
+ }
+ });
+
+ connect(
+ watcher,
+ &CheckPylsWatcher::resultReadyAt,
+ this,
+ [=, document = QPointer<TextEditor::TextDocument>(document)]() {
+ if (!document || !watcher)
+ return;
+ handlePyLSState(python, watcher->result(), document);
+ watcher->deleteLater();
+ });
+}
+
+void PyLSConfigureAssistant::handlePyLSState(const FilePath &python,
+ const PythonLanguageServerState &state,
+ TextEditor::TextDocument *document)
+{
+ if (state.state == PythonLanguageServerState::CanNotBeInstalled)
return;
- if (lsState.state == PythonLanguageServerState::AlreadyConfigured) {
+ if (state.state == PythonLanguageServerState::AlreadyConfigured) {
if (const StdIOSettings *setting = languageServerForPython(python)) {
if (Client *client = LanguageClientManager::clientForSetting(setting).value(0))
LanguageClientManager::reOpenDocumentWithClient(document, client);
@@ -382,12 +409,11 @@ void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
resetEditorInfoBar(document);
Core::InfoBar *infoBar = document->infoBar();
- if (lsState.state == PythonLanguageServerState::CanBeInstalled
+ if (state.state == PythonLanguageServerState::CanBeInstalled
&& infoBar->canInfoBeAdded(installPylsInfoBarId)) {
- auto message
- = tr("Install and set up Python language server (PyLS) for %1 (%2). "
- "The language server provides Python specific completion and annotation.")
- .arg(pythonName(python), python.toUserOutput());
+ auto message = tr("Install and set up Python language server (PyLS) for %1 (%2). "
+ "The language server provides Python specific completion and annotation.")
+ .arg(pythonName(python), python.toUserOutput());
Core::InfoBarEntry info(installPylsInfoBarId,
message,
Core::InfoBarEntry::GlobalSuppression::Enabled);
@@ -395,7 +421,7 @@ void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
[=]() { installPythonLanguageServer(python, document); });
infoBar->addInfo(info);
m_infoBarEntries[python] << document;
- } else if (lsState.state == PythonLanguageServerState::AlreadyInstalled
+ } else if (state.state == PythonLanguageServerState::AlreadyInstalled
&& infoBar->canInfoBeAdded(startPylsInfoBarId)) {
auto message = tr("Found a Python language server for %1 (%2). "
"Set it up for this document?")
@@ -407,7 +433,7 @@ void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
[=]() { setupPythonLanguageServer(python, document); });
infoBar->addInfo(info);
m_infoBarEntries[python] << document;
- } else if (lsState.state == PythonLanguageServerState::ConfiguredButDisabled
+ } else if (state.state == PythonLanguageServerState::ConfiguredButDisabled
&& infoBar->canInfoBeAdded(enablePylsInfoBarId)) {
auto message = tr("Enable Python language server for %1 (%2)?")
.arg(pythonName(python), python.toUserOutput());
diff --git a/src/plugins/python/pythonutils.h b/src/plugins/python/pythonutils.h
index 20cb674ddb9..28d1faf6074 100644
--- a/src/plugins/python/pythonutils.h
+++ b/src/plugins/python/pythonutils.h
@@ -40,6 +40,8 @@ namespace TextEditor { class TextDocument; }
namespace Python {
namespace Internal {
+struct PythonLanguageServerState;
+
class PyLSConfigureAssistant : public QObject
{
Q_OBJECT
@@ -56,6 +58,9 @@ public:
private:
explicit PyLSConfigureAssistant(QObject *parent);
+ void handlePyLSState(const Utils::FilePath &python,
+ const PythonLanguageServerState &state,
+ TextEditor::TextDocument *document);
void resetEditorInfoBar(TextEditor::TextDocument *document);
void installPythonLanguageServer(const Utils::FilePath &python,
QPointer<TextEditor::TextDocument> document);
diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
index c8cabd87b4a..a47c1c972f7 100644
--- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
+++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp
@@ -669,6 +669,7 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
connect(forceProbesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeForceProbes);
updateState();
+ setSummaryText(tr("<b>Qbs:</b> %1").arg("build"));
}
void QbsBuildStepConfigWidget::updateState()
@@ -714,8 +715,6 @@ void QbsBuildStepConfigWidget::updateState()
Constants::QBS_CONFIG_QUICK_COMPILER_KEY);
commandLineTextEdit->setPlainText(command);
-
- setSummaryText(tr("<b>Qbs:</b> %1").arg(command));
}
diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp
index ddecb793dcd..f6753fa411f 100644
--- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp
+++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp
@@ -74,7 +74,7 @@ QbsCleanStep::QbsCleanStep(BuildStepList *bsl, Core::Id id)
QString command = static_cast<QbsBuildConfiguration *>(buildConfiguration())
->equivalentCommandLine(data);
effectiveCommandAspect->setValue(command);
- return tr("<b>Qbs:</b> %1").arg(command);
+ return tr("<b>Qbs:</b> %1").arg("clean");
});
}
diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp
index ca78e2f5f0d..f3e3164e1e3 100644
--- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp
+++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp
@@ -324,6 +324,7 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
this, &QbsInstallStepConfigWidget::updateState);
updateState();
+ setSummaryText(QbsInstallStep::tr("<b>Qbs:</b> %1").arg("install"));
}
void QbsInstallStepConfigWidget::updateState()
@@ -338,8 +339,6 @@ void QbsInstallStepConfigWidget::updateState()
QString command = m_step->buildConfig()->equivalentCommandLine(m_step->stepData());
m_commandLineTextEdit->setPlainText(command);
-
- setSummaryText(QbsInstallStep::tr("<b>Qbs:</b> %1").arg(command));
}
// --------------------------------------------------------------------
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index 8ce7c8bfb99..0bd173a742f 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -1067,12 +1067,13 @@ void QbsBuildSystem::updateApplicationTargets()
}
}
BuildTargetInfo bti;
- bti.buildKey = productData.value("full-display-name").toString();
+ bti.buildKey = productData.value("name").toString() + '.'
+ + productData.value("multiplex-configuration-id").toString();
bti.targetFilePath = FilePath::fromString(targetFile);
bti.projectFilePath = FilePath::fromString(projectFile);
bti.isQtcRunnable = isQtcRunnable; // Fixed up below.
bti.usesTerminal = usesTerminal;
- bti.displayName = bti.buildKey;
+ bti.displayName = productData.value("full-display-name").toString();
bti.runEnvModifier = [targetFile, productData, this](Utils::Environment &env, bool usingLibraryPaths) {
const QString productName = productData.value("full-display-name").toString();
if (session()->projectData().isEmpty())
diff --git a/src/plugins/qbsprojectmanager/qbssettings.cpp b/src/plugins/qbsprojectmanager/qbssettings.cpp
index 22d5059f4b3..34831b6cbe1 100644
--- a/src/plugins/qbsprojectmanager/qbssettings.cpp
+++ b/src/plugins/qbsprojectmanager/qbssettings.cpp
@@ -103,6 +103,11 @@ void QbsSettings::setSettingsData(const QbsSettingsData &settings)
}
}
+QbsSettingsData QbsSettings::rawSettingsData()
+{
+ return instance().m_settings;
+}
+
QbsSettings::QbsSettings()
{
loadSettings();
@@ -148,8 +153,8 @@ public:
void apply()
{
- QbsSettingsData settings;
- if (m_qbsExePathChooser.isValid())
+ QbsSettingsData settings = QbsSettings::rawSettingsData();
+ if (m_qbsExePathChooser.fileName() != QbsSettings::qbsExecutableFilePath())
settings.qbsExecutableFilePath = m_qbsExePathChooser.fileName();
settings.defaultInstallDirTemplate = m_defaultInstallDirLineEdit.text();
settings.useCreatorSettings = m_settingsDirCheckBox.isChecked();
diff --git a/src/plugins/qbsprojectmanager/qbssettings.h b/src/plugins/qbsprojectmanager/qbssettings.h
index f5e2bd343c3..490c9c57433 100644
--- a/src/plugins/qbsprojectmanager/qbssettings.h
+++ b/src/plugins/qbsprojectmanager/qbssettings.h
@@ -54,6 +54,7 @@ public:
static QString qbsSettingsBaseDir();
static void setSettingsData(const QbsSettingsData &settings);
+ static QbsSettingsData rawSettingsData();
signals:
void settingsChanged();
diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
index 35141a58e18..d28b390d54d 100644
--- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp
@@ -1232,15 +1232,11 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const
const Utils::FilePath expected = tc->compilerCommand();
- Environment env = Environment::systemEnvironment();
Target *t = target();
QTC_ASSERT(t, return);
- Kit *k = t->kit();
- if (BuildConfiguration *bc = t->activeBuildConfiguration())
- env = bc->environment();
- else
- k->addToEnvironment(env);
+ QTC_ASSERT(m_buildConfiguration, return);
+ Environment env = m_buildConfiguration->environment();
if (env.isSameExecutable(path.toString(), expected.toString()))
return;
@@ -1261,7 +1257,9 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const
"\"%1\" is used by qmake, but \"%2\" is configured in the kit.\n"
"Please update your kit (%3) or choose a mkspec for qmake that matches "
"your target environment better.")
- .arg(path.toUserOutput()).arg(expected.toUserOutput()).arg(k->displayName())));
+ .arg(path.toUserOutput())
+ .arg(expected.toUserOutput())
+ .arg(t->kit()->displayName())));
m_toolChainWarnings.insert(pair);
}
diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp
index 1f2ba590de0..f4df59dd89d 100644
--- a/src/plugins/qmakeprojectmanager/qmakestep.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp
@@ -736,14 +736,9 @@ void QMakeStepConfigWidget::updateSummaryLabel()
abisChanged();
}
- // We don't want the full path to the .pro file
- const QString args = m_step->allArguments(
- qtVersion,
- QMakeStep::ArgumentFlag::OmitProjectPath
- | QMakeStep::ArgumentFlag::Expand);
- // And we only use the .pro filename not the full path
const QString program = qtVersion->qmakeCommand().fileName();
- setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program, args));
+ setSummaryText(tr("<b>qmake:</b> %1 %2").arg(program,
+ m_step->project()->projectFilePath().fileName()));
}
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
diff --git a/src/plugins/qmldesigner/CMakeLists.txt b/src/plugins/qmldesigner/CMakeLists.txt
index 1e8fcdc48aa..82c26c43adc 100644
--- a/src/plugins/qmldesigner/CMakeLists.txt
+++ b/src/plugins/qmldesigner/CMakeLists.txt
@@ -1,6 +1,6 @@
add_qtc_plugin(QmlDesigner
DEPENDS
- QmlJS LanguageUtils QmlEditorWidgets
+ QmlJS LanguageUtils QmlEditorWidgets AdvancedDockingSystem
Qt5::QuickWidgets Qt5::CorePrivate
DEFINES
DESIGNER_CORE_LIBRARY
@@ -141,9 +141,10 @@ extend_qtc_plugin(QmlDesigner
changeselectioncommand.cpp changeselectioncommand.h
drop3dlibraryitemcommand.cpp drop3dlibraryitemcommand.h
update3dviewstatecommand.cpp update3dviewstatecommand.h
- enable3dviewcommand.cpp enable3dviewcommand.h
view3dclosedcommand.cpp view3dclosedcommand.h
puppettocreatorcommand.cpp puppettocreatorcommand.h
+ inputeventcommand.cpp inputeventcommand.h
+ view3dactioncommand.cpp view3dactioncommand.h
)
extend_qtc_plugin(QmlDesigner
@@ -195,6 +196,16 @@ extend_qtc_plugin(QmlDesigner
)
extend_qtc_plugin(QmlDesigner
+ SOURCES_PREFIX components/edit3d
+ SOURCES
+ edit3dview.cpp edit3dview.h
+ edit3dwidget.cpp edit3dwidget.h
+ edit3dcanvas.cpp edit3dcanvas.h
+ edit3dactions.cpp edit3dactions.h
+ edit3d.qrc
+)
+
+extend_qtc_plugin(QmlDesigner
SOURCES_PREFIX components/formeditor
SOURCES
abstractcustomtool.cpp abstractcustomtool.h
diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp
index cd32560d444..c119dfdca1e 100644
--- a/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp
+++ b/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.cpp
@@ -66,7 +66,8 @@ void AnnotationEditor::showWidget()
m_dialog->setAttribute(Qt::WA_DeleteOnClose);
- m_dialog->open();
+ m_dialog->show();
+ m_dialog->raise();
}
void AnnotationEditor::showWidget(int x, int y)
diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp
index ca91f308ea9..dd234a074cb 100644
--- a/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp
+++ b/src/plugins/qmldesigner/components/annotationeditor/annotationeditordialog.cpp
@@ -30,7 +30,8 @@
#include "ui_annotationcommenttab.h"
-#include <timelineicons.h> //replace timeline icons with our own?
+#include <timelineicons.h>
+#include <utils/qtcassert.h>
#include <QObject>
#include <QToolBar>
@@ -47,9 +48,9 @@ AnnotationEditorDialog::AnnotationEditorDialog(QWidget *parent, const QString &t
{
ui->setupUi(this);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowFlag(Qt::Tool, true);
setWindowTitle(titleString);
+ setModal(true);
connect(this, &QDialog::accepted, this, &AnnotationEditorDialog::acceptedClicked);
@@ -67,8 +68,10 @@ AnnotationEditorDialog::AnnotationEditorDialog(QWidget *parent, const QString &t
connect(commentRemoveAction, &QAction::triggered, this, [this]() {
- if (ui->tabWidget->count() == 0) //it is not even supposed to happen but lets be sure
+ if (ui->tabWidget->count() == 0) { //it is not even supposed to happen but lets be sure
+ QTC_ASSERT(true, return);
return;
+ }
int currentIndex = ui->tabWidget->currentIndex();
QString currentTitle = ui->tabWidget->tabText(currentIndex);
@@ -202,11 +205,18 @@ void AnnotationEditorDialog::addCommentTab(const Comment &comment)
{
auto commentTab = new AnnotationCommentTab();
commentTab->setComment(comment);
- int tabIndex = ui->tabWidget->addTab(commentTab, comment.title());
- if (comment.title().isEmpty())
- ui->tabWidget->setTabText(tabIndex,
- (defaultTabName + " " + QString::number(tabIndex+1)));
+ QString tabTitle(comment.title());
+ int tabIndex = ui->tabWidget->addTab(commentTab, tabTitle);
+ ui->tabWidget->setCurrentIndex(tabIndex);
+
+ if (tabTitle.isEmpty()) {
+ const QString appendix = ((tabIndex > 0) ? QString::number(tabIndex+1) : "");
+
+ tabTitle = QString("%1 %2").arg(defaultTabName).arg(appendix);
+
+ ui->tabWidget->setTabText(tabIndex, tabTitle);
+ }
connect(commentTab, &AnnotationCommentTab::titleChanged,
this, &AnnotationEditorDialog::commentTitleChanged);
@@ -230,18 +240,7 @@ void AnnotationEditorDialog::deleteAllTabs()
void AnnotationEditorDialog::tabChanged(int index)
{
- QWidget *w = ui->tabWidget->widget(index);
- AnnotationCommentTab *tab = nullptr;
- if (w)
- tab = reinterpret_cast<AnnotationCommentTab*>(w);
-
- if (tab) {
- //this tab order resetting doesn't work
- QWidget::setTabOrder(ui->targetIdEdit, ui->customIdEdit);
- QWidget::setTabOrder(ui->customIdEdit, ui->tabWidget);
- QWidget::setTabOrder(ui->tabWidget, tab);
- QWidget::setTabOrder(tab, ui->buttonBox);
- }
+ (void) index;
}
} //namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp
index 522505dd9ca..7cb0bdfa19f 100644
--- a/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp
+++ b/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp
@@ -163,19 +163,20 @@ void AnnotationTool::selectedItemsChanged(const QList<FormEditorItem*> &itemList
if (!itemList.isEmpty()) {
m_formEditorItem = itemList.constFirst();
- m_oldCustomId = m_formEditorItem->qmlItemNode().modelNode().customId();
- m_oldAnnotation = m_formEditorItem->qmlItemNode().modelNode().annotation();
+ ModelNode itemModelNode = m_formEditorItem->qmlItemNode().modelNode();
+ m_oldCustomId = itemModelNode.customId();
+ m_oldAnnotation = itemModelNode.annotation();
if (m_annotationEditor.isNull()) {
m_annotationEditor = new AnnotationEditorDialog(view()->formEditorWidget()->parentWidget(),
- m_formEditorItem->qmlItemNode().modelNode().displayName(),
+ itemModelNode.displayName(),
m_oldCustomId, m_oldAnnotation);
connect(m_annotationEditor, &AnnotationEditorDialog::accepted, this, &AnnotationTool::annotationDialogAccepted);
connect(m_annotationEditor, &QDialog::rejected, this, &AnnotationTool::annotationDialogRejected);
-// connect(m_colorDialog.data(), &QColorDialog::currentColorChanged, this, &ColorTool::currentColorChanged);
- m_annotationEditor->exec();
+ m_annotationEditor->show();
+ m_annotationEditor->raise();
}
} else {
view()->changeToSelectionTool();
diff --git a/src/plugins/qmldesigner/components/bindingeditor/bindingeditordialog.cpp b/src/plugins/qmldesigner/components/bindingeditor/bindingeditordialog.cpp
index f368aee38b9..3e6d8389903 100644
--- a/src/plugins/qmldesigner/components/bindingeditor/bindingeditordialog.cpp
+++ b/src/plugins/qmldesigner/components/bindingeditor/bindingeditordialog.cpp
@@ -45,7 +45,6 @@ BindingEditorDialog::BindingEditorDialog(QWidget *parent, DialogType type)
: QDialog(parent)
, m_dialogType(type)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowFlag(Qt::Tool, true);
setWindowTitle(defaultTitle());
setModal(false);
diff --git a/src/plugins/qmldesigner/components/componentcore/actioninterface.h b/src/plugins/qmldesigner/components/componentcore/actioninterface.h
index ee120131f79..026bb707a9d 100644
--- a/src/plugins/qmldesigner/components/componentcore/actioninterface.h
+++ b/src/plugins/qmldesigner/components/componentcore/actioninterface.h
@@ -42,7 +42,8 @@ public:
ContextMenuAction,
ToolBarAction,
Action,
- FormEditorAction
+ FormEditorAction,
+ Edit3DAction
};
enum Priorities {
diff --git a/src/plugins/qmldesigner/components/componentcore/addimagesdialog.cpp b/src/plugins/qmldesigner/components/componentcore/addimagesdialog.cpp
index 10a992ae1b7..062403d39f7 100644
--- a/src/plugins/qmldesigner/components/componentcore/addimagesdialog.cpp
+++ b/src/plugins/qmldesigner/components/componentcore/addimagesdialog.cpp
@@ -95,7 +95,6 @@ QString AddImagesDialog::getDirectory(const QStringList &fileNames, const QStrin
QString directory = defaultDirectory;
dialog->setModal(true);
- dialog->setWindowFlags(dialog->windowFlags() & ~Qt::WindowContextHelpButtonHint);
dialog->setWindowTitle(QCoreApplication::translate("AddImageToResources","Add Resources"));
QTableWidget *table = createFilesTable(fileNames);
table->setParent(dialog);
diff --git a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp
index 6d724d12ef2..2f809712107 100644
--- a/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp
+++ b/src/plugins/qmldesigner/components/componentcore/zoomaction.cpp
@@ -30,10 +30,12 @@
namespace QmlDesigner {
+const int defaultZoomIndex = 11;
+
ZoomAction::ZoomAction(QObject *parent)
: QWidgetAction(parent),
m_zoomLevel(1.0),
- m_currentComboBoxIndex(8)
+ m_currentComboBoxIndex(defaultZoomIndex)
{
}
@@ -58,7 +60,7 @@ void ZoomAction::zoomOut()
void ZoomAction::resetZoomLevel()
{
m_zoomLevel = 1.0;
- m_currentComboBoxIndex = 8;
+ m_currentComboBoxIndex = defaultZoomIndex;
emit reseted();
}
@@ -72,6 +74,9 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
{
auto comboBox = new QComboBox(parent);
+ /*
+ * When add zoom levels do not forget to update defaultZoomIndex
+ */
if (m_comboBoxModel.isNull()) {
m_comboBoxModel = comboBox->model();
comboBox->addItem(QLatin1String("1 %"), 0.01);
diff --git a/src/plugins/qmldesigner/components/connectioneditor/addnewbackenddialog.cpp b/src/plugins/qmldesigner/components/connectioneditor/addnewbackenddialog.cpp
index 9de928ae906..49f47dfef27 100644
--- a/src/plugins/qmldesigner/components/connectioneditor/addnewbackenddialog.cpp
+++ b/src/plugins/qmldesigner/components/connectioneditor/addnewbackenddialog.cpp
@@ -34,7 +34,6 @@ AddNewBackendDialog::AddNewBackendDialog(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::AddNewBackendDialog)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this);
connect(m_ui->comboBox, &QComboBox::currentTextChanged, this, &AddNewBackendDialog::invalidate);
diff --git a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp
index 3777de72910..30aaf2b0045 100644
--- a/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp
+++ b/src/plugins/qmldesigner/components/connectioneditor/connectionviewwidget.cpp
@@ -87,8 +87,6 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
QStyle *style = QStyleFactory::create("fusion");
setStyle(style);
- setStyleSheet(Theme::replaceCssColors(QLatin1String(Utils::FileReader::fetchQrc(QLatin1String(":/connectionview/stylesheet.css")))));
-
//ui->tabWidget->tabBar()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
ui->tabBar->setUsesScrollButtons(true);
@@ -105,13 +103,9 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
ui->tabBar->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
- const QString themedScrollBarCss = Theme::replaceCssColors(
- QLatin1String(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css"))));
-
- ui->connectionView->setStyleSheet(themedScrollBarCss);
- ui->bindingView->setStyleSheet(themedScrollBarCss);
- ui->dynamicPropertiesView->setStyleSheet(themedScrollBarCss);
- ui->backendView->setStyleSheet(themedScrollBarCss);
+ QByteArray sheet = Utils::FileReader::fetchQrc(":/connectionview/stylesheet.css");
+ sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
+ setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
connect(ui->tabBar, &QTabBar::currentChanged,
ui->stackedWidget, &QStackedWidget::setCurrentIndex);
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp
index d0467db251d..2351793f8d5 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp
@@ -121,7 +121,7 @@ void GraphicsScene::handleMoved(KeyframeItem *frame,
}
}
-void GraphicsScene::setPinned(int id, bool pinned)
+void GraphicsScene::setPinned(uint id, bool pinned)
{
const auto itemList = items();
for (auto *item : itemList) {
diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h
index 088f86e4e1f..4569ace37ab 100644
--- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h
+++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h
@@ -69,7 +69,7 @@ public:
void handleMoved(KeyframeItem *frame, HandleSlot handle, double angle, double deltaLength);
- void setPinned(int id, bool pinned);
+ void setPinned(uint id, bool pinned);
std::vector<CurveItem *> takePinnedItems();
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3d.pri b/src/plugins/qmldesigner/components/edit3d/edit3d.pri
new file mode 100644
index 00000000000..fbef3175286
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3d.pri
@@ -0,0 +1,12 @@
+VPATH += $$PWD
+SOURCES += edit3dwidget.cpp \
+ edit3dview.cpp \
+ edit3dcanvas.cpp \
+ edit3dactions.cpp
+
+HEADERS += edit3dwidget.h \
+ edit3dview.h \
+ edit3dcanvas.h \
+ edit3dactions.h
+
+RESOURCES += edit3d.qrc
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3d.qrc b/src/plugins/qmldesigner/components/edit3d/edit3d.qrc
new file mode 100644
index 00000000000..1719b8ed63a
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3d.qrc
@@ -0,0 +1,34 @@
+<RCC>
+ <qresource prefix="/edit3d">
+ <file>images/edit_light_off.png</file>
+ <file>images/edit_light_off@2x.png</file>
+ <file>images/edit_light_on.png</file>
+ <file>images/edit_light_on@2x.png</file>
+ <file>images/fit_active.png</file>
+ <file>images/fit_active@2x.png</file>
+ <file>images/global.png</file>
+ <file>images/global@2x.png</file>
+ <file>images/group_selection_selected.png</file>
+ <file>images/group_selection_selected@2x.png</file>
+ <file>images/item_selection_selected.png</file>
+ <file>images/item_selection_selected@2x.png</file>
+ <file>images/local.png</file>
+ <file>images/local@2x.png</file>
+ <file>images/move_active.png</file>
+ <file>images/move_active@2x.png</file>
+ <file>images/move_selected.png</file>
+ <file>images/move_selected@2x.png</file>
+ <file>images/ortho.png</file>
+ <file>images/ortho@2x.png</file>
+ <file>images/persp.png</file>
+ <file>images/persp@2x.png</file>
+ <file>images/rotate_active.png</file>
+ <file>images/rotate_active@2x.png</file>
+ <file>images/rotate_selected.png</file>
+ <file>images/rotate_selected@2x.png</file>
+ <file>images/scale_active.png</file>
+ <file>images/scale_active@2x.png</file>
+ <file>images/scale_selected.png</file>
+ <file>images/scale_selected@2x.png</file>
+ </qresource>
+</RCC>
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dactions.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dactions.cpp
new file mode 100644
index 00000000000..a249f78a126
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dactions.cpp
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "edit3dactions.h"
+#include "edit3dview.h"
+#include "edit3dwidget.h"
+
+#include <viewmanager.h>
+#include <nodeinstanceview.h>
+#include <qmldesignerplugin.h>
+
+#include <QDebug>
+
+namespace QmlDesigner {
+
+Edit3DActionTemplate::Edit3DActionTemplate(const QString &description,
+ SelectionContextOperation action,
+ View3DActionCommand::Type type)
+ : DefaultAction(description),
+ m_action(action),
+ m_type(type)
+{ }
+
+void Edit3DActionTemplate::actionTriggered(bool b)
+{
+ if (m_type != View3DActionCommand::Empty) {
+ QmlDesignerPlugin::instance()->viewManager().nodeInstanceView()
+ ->view3DAction(View3DActionCommand(m_type, b));
+ }
+
+ if (m_action)
+ m_action(m_selectionContext);
+}
+
+Edit3DAction::Edit3DAction(const QByteArray &menuId, View3DActionCommand::Type type,
+ const QString &description, const QKeySequence &key, bool checkable,
+ bool checked, const QIcon &iconOff, const QIcon &iconOn,
+ SelectionContextOperation selectionAction)
+ : AbstractAction(new Edit3DActionTemplate(description, selectionAction, type))
+ , m_menuId(menuId)
+{
+ action()->setShortcut(key);
+ action()->setShortcutContext(Qt::WidgetWithChildrenShortcut);
+ action()->setCheckable(checkable);
+ action()->setChecked(checked);
+ if (checkable) {
+ QIcon onOffIcon;
+ const auto onAvail = iconOn.availableSizes(); // Assume both icons have same sizes available
+ for (const auto &size : onAvail) {
+ onOffIcon.addPixmap(iconOn.pixmap(size), QIcon::Normal, QIcon::On);
+ onOffIcon.addPixmap(iconOff.pixmap(size), QIcon::Normal, QIcon::Off);
+ }
+ action()->setIcon(onOffIcon);
+ } else {
+ action()->setIcon(iconOff);
+ }
+}
+
+QByteArray Edit3DAction::category() const
+{
+ return QByteArray();
+}
+
+bool Edit3DAction::isVisible(const SelectionContext &selectionContext) const
+{
+ return true;
+}
+
+bool Edit3DAction::isEnabled(const SelectionContext &selectionContext) const
+{
+ return isVisible(selectionContext);
+}
+
+}
+
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dactions.h b/src/plugins/qmldesigner/components/edit3d/edit3dactions.h
new file mode 100644
index 00000000000..1973e22491d
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dactions.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+#pragma once
+
+#include "view3dactioncommand.h"
+
+#include <abstractaction.h>
+
+#include <QtWidgets/qaction.h>
+#include <QtGui/qicon.h>
+
+namespace QmlDesigner {
+
+using SelectionContextOperation = std::function<void(const SelectionContext &)>;
+
+class Edit3DActionTemplate : public DefaultAction
+{
+
+public:
+ Edit3DActionTemplate(const QString &description, SelectionContextOperation action,
+ View3DActionCommand::Type type);
+
+ void actionTriggered(bool b) override;
+
+ SelectionContextOperation m_action;
+ View3DActionCommand::Type m_type;
+};
+
+class Edit3DAction : public AbstractAction
+{
+public:
+ Edit3DAction(const QByteArray &menuId, View3DActionCommand::Type type,
+ const QString &description, const QKeySequence &key, bool checkable, bool checked,
+ const QIcon &iconOff, const QIcon &iconOn,
+ SelectionContextOperation selectionAction = nullptr);
+
+ QByteArray category() const override;
+
+ int priority() const override
+ {
+ return CustomActionsPriority;
+ }
+
+ Type type() const override
+ {
+ return ActionInterface::Edit3DAction;
+ }
+
+ QByteArray menuId() const override
+ {
+ return m_menuId;
+ }
+
+protected:
+ bool isVisible(const SelectionContext &selectionContext) const override;
+ bool isEnabled(const SelectionContext &selectionContext) const override;
+
+private:
+ QByteArray m_menuId;
+};
+
+} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp
new file mode 100644
index 00000000000..8a1c049907b
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "edit3dcanvas.h"
+#include "edit3dview.h"
+#include "edit3dwidget.h"
+
+#include "nodehints.h"
+#include "qmlvisualnode.h"
+
+#include <QtCore/qmimedata.h>
+#include <QPainter>
+
+namespace QmlDesigner {
+
+Edit3DCanvas::Edit3DCanvas(Edit3DWidget *parent)
+ : QWidget(parent),
+ m_parent(parent)
+{
+ setMouseTracking(true);
+ setAcceptDrops(true);
+}
+
+void Edit3DCanvas::updateRenderImage(const QImage &img)
+{
+ m_image = img;
+ update();
+}
+
+void Edit3DCanvas::updateActiveScene(qint32 activeScene)
+{
+ m_activeScene = activeScene;
+}
+
+void Edit3DCanvas::mousePressEvent(QMouseEvent *e)
+{
+ m_parent->view()->sendInputEvent(e);
+ QWidget::mousePressEvent(e);
+}
+
+void Edit3DCanvas::mouseReleaseEvent(QMouseEvent *e)
+{
+ m_parent->view()->sendInputEvent(e);
+ QWidget::mouseReleaseEvent(e);
+}
+
+void Edit3DCanvas::mouseDoubleClickEvent(QMouseEvent *e)
+{
+ m_parent->view()->sendInputEvent(e);
+ QWidget::mouseDoubleClickEvent(e);
+}
+
+void Edit3DCanvas::mouseMoveEvent(QMouseEvent *e)
+{
+ m_parent->view()->sendInputEvent(e);
+ QWidget::mouseMoveEvent(e);
+}
+
+void Edit3DCanvas::wheelEvent(QWheelEvent *e)
+{
+ m_parent->view()->sendInputEvent(e);
+ QWidget::wheelEvent(e);
+}
+
+void Edit3DCanvas::paintEvent(QPaintEvent *e)
+{
+ Q_UNUSED(e)
+
+ QWidget::paintEvent(e);
+
+ QPainter painter(this);
+
+ painter.drawImage(rect(), m_image, rect());
+}
+
+void Edit3DCanvas::resizeEvent(QResizeEvent *e)
+{
+ m_parent->view()->edit3DViewResized(e->size());
+}
+
+void Edit3DCanvas::dragEnterEvent(QDragEnterEvent *e)
+{
+ QByteArray data = e->mimeData()->data(QStringLiteral("application/vnd.bauhaus.itemlibraryinfo"));
+ if (!data.isEmpty()) {
+ QDataStream stream(data);
+ stream >> m_itemLibraryEntry;
+ bool canDrop = NodeHints::fromItemLibraryEntry(m_itemLibraryEntry).canBeDroppedInView3D();
+
+ if (canDrop)
+ e->accept();
+ }
+}
+
+void Edit3DCanvas::dropEvent(QDropEvent *e)
+{
+ Q_UNUSED(e)
+
+ QmlVisualNode::createQmlVisualNode(m_parent->view(), m_itemLibraryEntry, m_activeScene, {});
+}
+
+}
+
+
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.h b/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.h
new file mode 100644
index 00000000000..48b05789476
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+#pragma once
+
+#include "itemlibraryinfo.h"
+
+#include <QtWidgets/qwidget.h>
+#include <QtGui/qimage.h>
+#include <QtGui/qevent.h>
+#include <QtCore/qpointer.h>
+
+namespace QmlDesigner {
+
+class Edit3DWidget;
+
+class Edit3DCanvas : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Edit3DCanvas(Edit3DWidget *parent);
+
+ void updateRenderImage(const QImage &img);
+ void updateActiveScene(qint32 activeScene);
+
+protected:
+ void mousePressEvent(QMouseEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent *e) override;
+ void mouseDoubleClickEvent(QMouseEvent *e) override;
+ void mouseMoveEvent(QMouseEvent *e) override;
+ void wheelEvent(QWheelEvent *e) override;
+ void paintEvent(QPaintEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
+ void dragEnterEvent(QDragEnterEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
+
+private:
+ QPointer<Edit3DWidget> m_parent;
+ QImage m_image;
+ qint32 m_activeScene;
+ ItemLibraryEntry m_itemLibraryEntry;
+};
+
+} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp
new file mode 100644
index 00000000000..8aefce79403
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp
@@ -0,0 +1,247 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "edit3dview.h"
+#include "edit3dwidget.h"
+#include "edit3dcanvas.h"
+#include "edit3dactions.h"
+#include "designmodewidget.h"
+
+#include <nodeinstanceview.h>
+#include <designeractionmanager.h>
+#include <qmldesignerplugin.h>
+#include <designersettings.h>
+#include <qmldesignerconstants.h>
+#include <viewmanager.h>
+#include <qmldesignericons.h>
+#include <utils/utilsicons.h>
+
+#include <QDebug>
+
+namespace QmlDesigner {
+
+Edit3DView::Edit3DView(QObject *parent)
+ : AbstractView(parent)
+{
+}
+
+Edit3DView::~Edit3DView()
+{
+}
+
+void Edit3DView::createEdit3DWidget()
+{
+ createEdit3DActions();
+ m_edit3DWidget = new Edit3DWidget(this);
+}
+
+WidgetInfo Edit3DView::widgetInfo()
+{
+ if (!m_edit3DWidget)
+ createEdit3DWidget();
+
+ return createWidgetInfo(m_edit3DWidget.data(), nullptr, "Editor3D", WidgetInfo::CentralPane, 0, tr("3D Editor"), DesignerWidgetFlags::IgnoreErrors);
+}
+
+Edit3DWidget *Edit3DView::edit3DWidget() const
+{
+ return m_edit3DWidget.data();
+}
+
+void Edit3DView::renderImage3DChanged(const QImage &img)
+{
+ edit3DWidget()->canvas()->updateRenderImage(img);
+}
+
+void Edit3DView::updateActiveScene3D(const QVariantMap &sceneState)
+{
+ const QString sceneKey = QStringLiteral("sceneInstanceId");
+ const QString selectKey = QStringLiteral("groupSelect");
+ const QString transformKey = QStringLiteral("groupTransform");
+ const QString perspectiveKey = QStringLiteral("usePerspective");
+ const QString orientationKey = QStringLiteral("globalOrientation");
+ const QString editLightKey = QStringLiteral("showEditLight");
+
+ if (sceneState.contains(sceneKey))
+ edit3DWidget()->canvas()->updateActiveScene(sceneState[sceneKey].value<qint32>());
+
+ if (sceneState.contains(selectKey))
+ m_selectionModeAction->action()->setChecked(sceneState[selectKey].toInt() == 0);
+ else
+ m_selectionModeAction->action()->setChecked(false);
+
+ if (sceneState.contains(transformKey)) {
+ const int tool = sceneState[transformKey].toInt();
+ if (tool == 0)
+ m_moveToolAction->action()->setChecked(true);
+ else if (tool == 1)
+ m_rotateToolAction->action()->setChecked(true);
+ else
+ m_scaleToolAction->action()->setChecked(true);
+ } else {
+ m_moveToolAction->action()->setChecked(true);
+ }
+
+ if (sceneState.contains(perspectiveKey))
+ m_cameraModeAction->action()->setChecked(sceneState[perspectiveKey].toBool());
+ else
+ m_cameraModeAction->action()->setChecked(false);
+ if (sceneState.contains(orientationKey))
+ m_orientationModeAction->action()->setChecked(sceneState[orientationKey].toBool());
+ else
+ m_orientationModeAction->action()->setChecked(false);
+ if (sceneState.contains(editLightKey))
+ m_editLightAction->action()->setChecked(sceneState[editLightKey].toBool());
+ else
+ m_editLightAction->action()->setChecked(false);
+}
+
+void Edit3DView::sendInputEvent(QInputEvent *e) const
+{
+ nodeInstanceView()->sendInputEvent(e);
+}
+
+void Edit3DView::edit3DViewResized(const QSize &size) const
+{
+ nodeInstanceView()->edit3DViewResized(size);
+}
+
+QSize Edit3DView::canvasSize() const
+{
+ if (!m_edit3DWidget.isNull() && m_edit3DWidget->canvas())
+ return m_edit3DWidget->canvas()->size();
+
+ return {};
+}
+
+void Edit3DView::createEdit3DActions()
+{
+ m_selectionModeAction
+ = new Edit3DAction(
+ "Edit3DSelectionModeToggle", View3DActionCommand::SelectionModeToggle,
+ QCoreApplication::translate("SelectionModeToggleAction", "Toggle Group / Single Selection Mode"),
+ QKeySequence(Qt::Key_Q), true, false, Icons::EDIT3D_SELECTION_MODE_OFF.icon(),
+ Icons::EDIT3D_SELECTION_MODE_ON.icon());
+
+ m_moveToolAction
+ = new Edit3DAction(
+ "Edit3DMoveTool", View3DActionCommand::MoveTool,
+ QCoreApplication::translate("MoveToolAction", "Activate Move Tool"),
+ QKeySequence(Qt::Key_W), true, true, Icons::EDIT3D_MOVE_TOOL_OFF.icon(),
+ Icons::EDIT3D_MOVE_TOOL_ON.icon());
+
+ m_rotateToolAction
+ = new Edit3DAction(
+ "Edit3DRotateTool", View3DActionCommand::RotateTool,
+ QCoreApplication::translate("RotateToolAction", "Activate Rotate Tool"),
+ QKeySequence(Qt::Key_E), true, false, Icons::EDIT3D_ROTATE_TOOL_OFF.icon(),
+ Icons::EDIT3D_ROTATE_TOOL_ON.icon());
+
+ m_scaleToolAction
+ = new Edit3DAction(
+ "Edit3DScaleTool", View3DActionCommand::ScaleTool,
+ QCoreApplication::translate("ScaleToolAction", "Activate Scale Tool"),
+ QKeySequence(Qt::Key_R), true, false, Icons::EDIT3D_SCALE_TOOL_OFF.icon(),
+ Icons::EDIT3D_SCALE_TOOL_ON.icon());
+
+ m_fitAction = new Edit3DAction(
+ "Edit3DFitToView", View3DActionCommand::FitToView,
+ QCoreApplication::translate("FitToViewAction", "Fit Selected Object To View"),
+ QKeySequence(Qt::Key_F), false, false, Icons::EDIT3D_FIT_SELECTED_OFF.icon(), {});
+
+ m_cameraModeAction
+ = new Edit3DAction(
+ "Edit3DCameraToggle", View3DActionCommand::CameraToggle,
+ QCoreApplication::translate("CameraToggleAction", "Toggle Perspective / Orthographic Edit Camera"),
+ QKeySequence(Qt::Key_T), true, false, Icons::EDIT3D_EDIT_CAMERA_OFF.icon(),
+ Icons::EDIT3D_EDIT_CAMERA_ON.icon());
+
+ m_orientationModeAction
+ = new Edit3DAction(
+ "Edit3DOrientationToggle", View3DActionCommand::OrientationToggle,
+ QCoreApplication::translate("OrientationToggleAction", "Toggle Global / Local Orientation"),
+ QKeySequence(Qt::Key_Y), true, false, Icons::EDIT3D_ORIENTATION_OFF.icon(),
+ Icons::EDIT3D_ORIENTATION_ON.icon());
+
+ m_editLightAction
+ = new Edit3DAction(
+ "Edit3DEditLightToggle", View3DActionCommand::EditLightToggle,
+ QCoreApplication::translate("EditLightToggleAction", "Toggle Edit Light On / Off"),
+ QKeySequence(Qt::Key_U), true, false, Icons::EDIT3D_LIGHT_OFF.icon(),
+ Icons::EDIT3D_LIGHT_ON.icon());
+
+ SelectionContextOperation resetTrigger = [this](const SelectionContext &) {
+ setCurrentStateNode(rootModelNode());
+ resetPuppet();
+ };
+ m_resetAction
+ = new Edit3DAction(
+ "Edit3DResetView", View3DActionCommand::Empty,
+ QCoreApplication::translate("ResetView", "Reset View"),
+ QKeySequence(Qt::Key_P), false, false, Utils::Icons::RESET_TOOLBAR.icon(), {},
+ resetTrigger);
+
+ m_leftActions << m_selectionModeAction;
+ m_leftActions << nullptr; // Null indicates separator
+ m_leftActions << nullptr; // Second null after separator indicates an exclusive group
+ m_leftActions << m_moveToolAction;
+ m_leftActions << m_rotateToolAction;
+ m_leftActions << m_scaleToolAction;
+ m_leftActions << nullptr;
+ m_leftActions << m_fitAction;
+ m_leftActions << nullptr;
+ m_leftActions << m_cameraModeAction;
+ m_leftActions << m_orientationModeAction;
+ m_leftActions << m_editLightAction;
+
+ m_rightActions << m_resetAction;
+
+ // TODO: Registering actions to action manager causes conflicting shortcuts in form editor.
+ // Registration commented out until UX defines non-conflicting shortcuts.
+ // Also, actions creation needs to be somehow triggered before action manager registers
+ // actions to creator.
+// DesignerActionManager &actionManager = QmlDesignerPlugin::instance()->designerActionManager();
+// for (auto action : qAsConst(m_leftActions)) {
+// if (action)
+// actionManager.addDesignerAction(action);
+// }
+// for (auto action : qAsConst(m_rightActions)) {
+// if (action)
+// actionManager.addDesignerAction(action);
+// }
+}
+
+QVector<Edit3DAction *> Edit3DView::leftActions() const
+{
+ return m_leftActions;
+}
+
+QVector<Edit3DAction *> Edit3DView::rightActions() const
+{
+ return m_rightActions;
+}
+
+}
+
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dview.h b/src/plugins/qmldesigner/components/edit3d/edit3dview.h
new file mode 100644
index 00000000000..64ffedb1540
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dview.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+#pragma once
+
+#include "view3dactioncommand.h"
+
+#include <abstractview.h>
+#include <QtGui/qevent.h>
+#include <QtGui/qimage.h>
+#include <QtCore/qvector.h>
+#include <QtCore/qvariant.h>
+#include <QtCore/qsize.h>
+
+QT_BEGIN_NAMESPACE
+QT_END_NAMESPACE
+
+namespace QmlDesigner {
+
+class Edit3DWidget;
+class Edit3DAction;
+
+class QMLDESIGNERCORE_EXPORT Edit3DView : public AbstractView
+{
+ Q_OBJECT
+
+public:
+ Edit3DView(QObject *parent = nullptr);
+ ~Edit3DView() override;
+
+ WidgetInfo widgetInfo() override;
+
+ Edit3DWidget *edit3DWidget() const;
+
+ void renderImage3DChanged(const QImage &img) override;
+ void updateActiveScene3D(const QVariantMap &sceneState) override;
+
+ void sendInputEvent(QInputEvent *e) const;
+ void edit3DViewResized(const QSize &size) const;
+
+ QSize canvasSize() const;
+
+ void createEdit3DActions();
+ QVector<Edit3DAction *> leftActions() const;
+ QVector<Edit3DAction *> rightActions() const;
+
+protected:
+
+private:
+ void createEdit3DWidget();
+
+ QPointer<Edit3DWidget> m_edit3DWidget;
+ QVector<Edit3DAction *> m_leftActions;
+ QVector<Edit3DAction *> m_rightActions;
+ Edit3DAction *m_selectionModeAction;
+ Edit3DAction *m_moveToolAction;
+ Edit3DAction *m_rotateToolAction;
+ Edit3DAction *m_scaleToolAction;
+ Edit3DAction *m_fitAction;
+ Edit3DAction *m_cameraModeAction;
+ Edit3DAction *m_orientationModeAction;
+ Edit3DAction *m_editLightAction;
+ Edit3DAction *m_resetAction;
+};
+
+} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
new file mode 100644
index 00000000000..b21bb3d46ec
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+
+#include "edit3dwidget.h"
+#include "edit3dview.h"
+#include "edit3dcanvas.h"
+#include "edit3dactions.h"
+
+#include "qmldesignerplugin.h"
+#include "designersettings.h"
+#include "qmldesignerconstants.h"
+#include "viewmanager.h"
+
+#include <toolbox.h>
+#include <utils/utilsicons.h>
+#include <QVBoxLayout>
+
+namespace QmlDesigner {
+
+Edit3DWidget::Edit3DWidget(Edit3DView *view) :
+ m_view(view)
+{
+ setMouseTracking(true);
+ setFocusPolicy(Qt::WheelFocus);
+
+ auto fillLayout = new QVBoxLayout(this);
+ fillLayout->setContentsMargins(0, 0, 0, 0);
+ fillLayout->setSpacing(0);
+ setLayout(fillLayout);
+
+ // Initialize toolbar
+ m_toolBox = new ToolBox(this);
+ fillLayout->addWidget(m_toolBox.data());
+
+ // Iterate through view actions. A null action indicates a separator and a second null action
+ // after separator indicates an exclusive group.
+ auto addActionsToToolBox = [this](const QVector<Edit3DAction *> &actions, bool left) {
+ bool previousWasSeparator = true;
+ QActionGroup *group = nullptr;
+ for (auto action : actions) {
+ if (action) {
+ if (group)
+ group->addAction(action->action());
+ addAction(action->action());
+ if (left)
+ m_toolBox->addLeftSideAction(action->action());
+ else
+ m_toolBox->addRightSideAction(action->action());
+ previousWasSeparator = false;
+ } else {
+ if (previousWasSeparator) {
+ group = new QActionGroup(this);
+ previousWasSeparator = false;
+ } else {
+ group = nullptr;
+ auto separator = new QAction(this);
+ separator->setSeparator(true);
+ addAction(separator);
+ m_toolBox->addLeftSideAction(separator);
+ previousWasSeparator = true;
+ }
+ }
+ }
+
+ };
+ addActionsToToolBox(view->leftActions(), true);
+ addActionsToToolBox(view->rightActions(), false);
+
+ // Canvas is used to render the actual edit 3d view
+ m_canvas = new Edit3DCanvas(this);
+ fillLayout->addWidget(m_canvas.data());
+}
+
+Edit3DCanvas *Edit3DWidget::canvas() const
+{
+ return m_canvas.data();
+}
+
+Edit3DView *Edit3DWidget::view() const
+{
+ return m_view.data();
+}
+
+}
diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dwidget.h b/src/plugins/qmldesigner/components/edit3d/edit3dwidget.h
new file mode 100644
index 00000000000..967713930e4
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/edit3dwidget.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+****************************************************************************/
+#pragma once
+
+#include <QtWidgets/qwidget.h>
+#include <QtCore/qpointer.h>
+
+namespace QmlDesigner {
+
+class Edit3DView;
+class Edit3DCanvas;
+class ToolBox;
+
+class Edit3DWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ Edit3DWidget(Edit3DView *view);
+
+ Edit3DCanvas *canvas() const;
+ Edit3DView *view() const;
+
+private:
+ QPointer<Edit3DView> m_edit3DView;
+ QPointer<Edit3DView> m_view;
+ QPointer<Edit3DCanvas> m_canvas;
+ QPointer<ToolBox> m_toolBox;
+};
+
+} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/components/edit3d/images/edit_light_off.png b/src/plugins/qmldesigner/components/edit3d/images/edit_light_off.png
new file mode 100644
index 00000000000..73e6e92374b
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/edit_light_off.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/edit_light_off@2x.png b/src/plugins/qmldesigner/components/edit3d/images/edit_light_off@2x.png
new file mode 100644
index 00000000000..5166264e16d
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/edit_light_off@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/edit_light_on.png b/src/plugins/qmldesigner/components/edit3d/images/edit_light_on.png
new file mode 100644
index 00000000000..7660c285460
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/edit_light_on.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/edit_light_on@2x.png b/src/plugins/qmldesigner/components/edit3d/images/edit_light_on@2x.png
new file mode 100644
index 00000000000..836bd2a0d59
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/edit_light_on@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/fit_active.png b/src/plugins/qmldesigner/components/edit3d/images/fit_active.png
new file mode 100644
index 00000000000..056e9ec3c8b
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/fit_active.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/fit_active@2x.png b/src/plugins/qmldesigner/components/edit3d/images/fit_active@2x.png
new file mode 100644
index 00000000000..4b05f83d460
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/fit_active@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/global.png b/src/plugins/qmldesigner/components/edit3d/images/global.png
new file mode 100644
index 00000000000..1bd09c680ac
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/global.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/global@2x.png b/src/plugins/qmldesigner/components/edit3d/images/global@2x.png
new file mode 100644
index 00000000000..a2a857fb10c
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/global@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/group_selection_selected.png b/src/plugins/qmldesigner/components/edit3d/images/group_selection_selected.png
new file mode 100644
index 00000000000..bfb848aa384
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/group_selection_selected.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/group_selection_selected@2x.png b/src/plugins/qmldesigner/components/edit3d/images/group_selection_selected@2x.png
new file mode 100644
index 00000000000..f18895dc440
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/group_selection_selected@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/item_selection_selected.png b/src/plugins/qmldesigner/components/edit3d/images/item_selection_selected.png
new file mode 100644
index 00000000000..2b685d3d00a
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/item_selection_selected.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/item_selection_selected@2x.png b/src/plugins/qmldesigner/components/edit3d/images/item_selection_selected@2x.png
new file mode 100644
index 00000000000..eb0051a606e
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/item_selection_selected@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/local.png b/src/plugins/qmldesigner/components/edit3d/images/local.png
new file mode 100644
index 00000000000..0a608f6816e
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/local.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/local@2x.png b/src/plugins/qmldesigner/components/edit3d/images/local@2x.png
new file mode 100644
index 00000000000..a5c931e750f
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/local@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/move_active.png b/src/plugins/qmldesigner/components/edit3d/images/move_active.png
new file mode 100644
index 00000000000..d21d290349c
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/move_active.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/move_active@2x.png b/src/plugins/qmldesigner/components/edit3d/images/move_active@2x.png
new file mode 100644
index 00000000000..bd0827f918c
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/move_active@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/move_selected.png b/src/plugins/qmldesigner/components/edit3d/images/move_selected.png
new file mode 100644
index 00000000000..5c8ce42a758
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/move_selected.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/move_selected@2x.png b/src/plugins/qmldesigner/components/edit3d/images/move_selected@2x.png
new file mode 100644
index 00000000000..fad362a3e6a
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/move_selected@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/ortho.png b/src/plugins/qmldesigner/components/edit3d/images/ortho.png
new file mode 100644
index 00000000000..35b36203fa2
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/ortho.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/ortho@2x.png b/src/plugins/qmldesigner/components/edit3d/images/ortho@2x.png
new file mode 100644
index 00000000000..443c73e444b
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/ortho@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/persp.png b/src/plugins/qmldesigner/components/edit3d/images/persp.png
new file mode 100644
index 00000000000..9a48e763996
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/persp.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/persp@2x.png b/src/plugins/qmldesigner/components/edit3d/images/persp@2x.png
new file mode 100644
index 00000000000..88a4eab9c6a
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/persp@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/rotate_active.png b/src/plugins/qmldesigner/components/edit3d/images/rotate_active.png
new file mode 100644
index 00000000000..bdabaf30285
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/rotate_active.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/rotate_active@2x.png b/src/plugins/qmldesigner/components/edit3d/images/rotate_active@2x.png
new file mode 100644
index 00000000000..8c81f409d32
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/rotate_active@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/rotate_selected.png b/src/plugins/qmldesigner/components/edit3d/images/rotate_selected.png
new file mode 100644
index 00000000000..42dc2763ce4
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/rotate_selected.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/rotate_selected@2x.png b/src/plugins/qmldesigner/components/edit3d/images/rotate_selected@2x.png
new file mode 100644
index 00000000000..b6cc48c0533
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/rotate_selected@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/scale_active.png b/src/plugins/qmldesigner/components/edit3d/images/scale_active.png
new file mode 100644
index 00000000000..cd63c1d03bc
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/scale_active.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/scale_active@2x.png b/src/plugins/qmldesigner/components/edit3d/images/scale_active@2x.png
new file mode 100644
index 00000000000..0d95e8e8913
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/scale_active@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/scale_selected.png b/src/plugins/qmldesigner/components/edit3d/images/scale_selected.png
new file mode 100644
index 00000000000..4cca7726170
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/scale_selected.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/edit3d/images/scale_selected@2x.png b/src/plugins/qmldesigner/components/edit3d/images/scale_selected@2x.png
new file mode 100644
index 00000000000..690cf5f924f
--- /dev/null
+++ b/src/plugins/qmldesigner/components/edit3d/images/scale_selected@2x.png
Binary files differ
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp
index 7bd4573aafc..4ad03468bba 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorannotationicon.cpp
@@ -96,7 +96,7 @@ void FormEditorAnnotationIcon::paint(QPainter *painter, const QStyleOptionGraphi
if (scene)
m_readerIsActive = scene->annotationVisibility();
- QPixmap icon( (m_readerIsActive ? m_activeIconStr : m_normalIconStr) );
+ QPixmap icon(m_readerIsActive ? m_activeIconStr : m_normalIconStr);
painter->drawPixmap(0, 0,
static_cast<int>(m_iconW), static_cast<int>(m_iconH),
@@ -261,7 +261,6 @@ void FormEditorAnnotationIcon::drawReader()
++currentColumn;
newPos = commentsStartPosition + QPointF(currentColumn * (offset + width), 0);
-
} else {
//few normal comments, lets stack them
}
@@ -277,11 +276,8 @@ void FormEditorAnnotationIcon::drawReader()
void FormEditorAnnotationIcon::hideReader()
{
- if (!childItems().isEmpty()) {
- for (QGraphicsItem *item : childItems()) {
- delete item;
- }
- }
+ if (!childItems().isEmpty())
+ qDeleteAll(childItems());
}
QGraphicsItem *FormEditorAnnotationIcon::createCommentBubble(const QRectF &rect, const QString &title,
@@ -398,7 +394,8 @@ void FormEditorAnnotationIcon::createAnnotationEditor()
connect(m_annotationEditor, &QDialog::rejected,
this, &FormEditorAnnotationIcon::annotationDialogRejected);
- m_annotationEditor->open();
+ m_annotationEditor->show();
+ m_annotationEditor->raise();
}
void FormEditorAnnotationIcon::removeAnnotationDialog()
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
index dd01029c036..65c59a6954a 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditoritem.cpp
@@ -236,7 +236,7 @@ QTransform FormEditorItem::instanceSceneContentItemTransform() const
return qmlItemNode().instanceSceneContentItemTransform();
}
-bool FormEditorItem::flowHitTest(const QPointF &point) const
+bool FormEditorItem::flowHitTest(const QPointF & ) const
{
return false;
}
@@ -564,7 +564,7 @@ QPointF FormEditorFlowItem::instancePosition() const
return qmlItemNode().flowPosition();
}
-void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void FormEditorFlowActionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
if (!painter->isActive())
return;
@@ -646,7 +646,6 @@ void FormEditorTransitionItem::setDataModelPositionInBaseState(const QPointF &)
void FormEditorTransitionItem::updateGeometry()
{
FormEditorItem::updateGeometry();
- const QPointF pos = qmlItemNode().flowPosition();
const ModelNode from = qmlItemNode().modelNode().bindingProperty("from").resolveToModelNode();
const ModelNode to = qmlItemNode().modelNode().bindingProperty("to").resolveToModelNode();
@@ -901,7 +900,7 @@ static void paintConnection(QPainter *painter,
painter->restore();
}
-void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
+void FormEditorTransitionItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
{
if (!painter->isActive())
return;
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
index 44e514641a5..37c0efc9d7f 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
@@ -369,6 +369,7 @@ void FormEditorView::selectedNodesChanged(const QList<ModelNode> &selectedNodeLi
void FormEditorView::bindingPropertiesChanged(const QList<BindingProperty> &propertyList, AbstractView::PropertyChangeFlags propertyChange)
{
+ Q_UNUSED(propertyChange)
for (const BindingProperty &property : propertyList) {
QmlVisualNode node(property.parentModelNode());
if (node.isFlowTransition()) {
@@ -675,9 +676,6 @@ void FormEditorView::toggle3DViewEnabled(bool enabled)
rootModelNode().removeAuxiliaryData("3d-view");
resetNodeInstanceView();
-
- // TODO: the line below is not in use. It should replace the resetNodeInstanceView(); to have a clean API
-// nodeInstanceView()->enable3DView(enabled);
}
QmlItemNode findRecursiveQmlItemNode(const QmlObjectNode &firstQmlObjectNode)
diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
index bf4f1f0454f..ec7e1d782d8 100644
--- a/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/formeditorwidget.cpp
@@ -59,8 +59,6 @@ namespace QmlDesigner {
FormEditorWidget::FormEditorWidget(FormEditorView *view) :
m_formEditorView(view)
{
- setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/formeditorstylesheet.css")))));
-
auto fillLayout = new QVBoxLayout(this);
fillLayout->setContentsMargins(0, 0, 0, 0);
fillLayout->setSpacing(0);
@@ -74,7 +72,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) :
layoutActionGroup->setExclusive(true);
m_noSnappingAction = layoutActionGroup->addAction(tr("No snapping (T)."));
- m_noSnappingAction->setShortcut(Qt::Key_W);
+ m_noSnappingAction->setShortcut(Qt::Key_T);
m_noSnappingAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
m_noSnappingAction->setCheckable(true);
m_noSnappingAction->setChecked(true);
@@ -135,7 +133,6 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) :
m_toolBox = new ToolBox(this);
fillLayout->addWidget(m_toolBox.data());
-
m_toolBox->setLeftSideActions(upperActions);
m_backgroundAction = new BackgroundAction(m_toolActionGroup.data());
@@ -145,9 +142,11 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) :
m_toolBox->addRightSideAction(m_backgroundAction.data());
m_option3DAction = new Option3DAction(m_toolActionGroup.data());
- addAction(m_option3DAction.data());
- upperActions.append(m_option3DAction.data());
- m_toolBox->addRightSideAction(m_option3DAction.data());
+ if (qEnvironmentVariableIsSet("QMLDESIGNER_QUICK3D_SHOW_EDIT_WINDOW")) {
+ addAction(m_option3DAction.data());
+ upperActions.append(m_option3DAction.data());
+ m_toolBox->addRightSideAction(m_option3DAction.data());
+ }
m_zoomAction = new ZoomAction(m_toolActionGroup.data());
connect(m_zoomAction.data(), &ZoomAction::zoomLevelChanged,
@@ -168,7 +167,10 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view) :
m_graphicsView = new FormEditorGraphicsView(this);
fillLayout->addWidget(m_graphicsView.data());
- m_graphicsView.data()->setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))));
+
+ QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
+ sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
+ setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
}
void FormEditorWidget::changeTransformTool(bool checked)
diff --git a/src/plugins/qmldesigner/components/formeditor/selectionindicator.cpp b/src/plugins/qmldesigner/components/formeditor/selectionindicator.cpp
index 7253d3b6153..02f3ce9ee66 100644
--- a/src/plugins/qmldesigner/components/formeditor/selectionindicator.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/selectionindicator.cpp
@@ -215,17 +215,18 @@ void SelectionIndicator::adjustAnnotationPosition(const QRectF &itemRect, const
{
if (!m_annotationItem) return;
- const qreal iconW = 40 * 0.5; //*0.5 for a shift of an icon outide the item
+ const qreal iconWShift = m_annotationItem->iconWidth() * 0.5;
+ const qreal iconHShift = (m_annotationItem->iconHeight() * 0.45)/scaleFactor;
qreal iconX = 0.0;
- qreal iconY = -15.0/scaleFactor; //small offset
+ qreal iconY = -(iconHShift);
- if (((labelRect.width() + iconW)/scaleFactor) > itemRect.width())
+ if (((labelRect.width() + iconWShift)/scaleFactor) > itemRect.width())
iconY -= labelRect.height()/scaleFactor;
- if ((iconW/scaleFactor) > itemRect.width())
+ if ((iconWShift/scaleFactor) > itemRect.width())
iconX = 0.0;
else
- iconX = (itemRect.width()) - (iconW/scaleFactor);
+ iconX = (itemRect.width()) - (iconWShift/scaleFactor);
m_annotationItem->setPos(iconX*scaleFactor, iconY*scaleFactor);
}
diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp
index 6e1c6a50156..3a13f524119 100644
--- a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp
+++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp
@@ -56,7 +56,7 @@ WidgetInfo ImportManagerView::widgetInfo()
m_importsWidget->setImports(model()->imports());
}
- return createWidgetInfo(m_importsWidget, nullptr, QLatin1String("ImportManager"), WidgetInfo::LeftPane, 1);
+ return createWidgetInfo(m_importsWidget, nullptr, QLatin1String("ImportManager"), WidgetInfo::LeftPane, 1, tr("Import Manager"));
}
void ImportManagerView::modelAttached(Model *model)
diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp
index 99ceb2fff37..90c0a2f28f1 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp
+++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryview.cpp
@@ -58,7 +58,8 @@ WidgetInfo ItemLibraryView::widgetInfo()
new WidgetInfo::ToolBarWidgetDefaultFactory<ItemLibraryWidget>(m_widget.data()),
QStringLiteral("Library"),
WidgetInfo::LeftPane,
- 0);
+ 0,
+ tr("Library"));
}
void ItemLibraryView::modelAttached(Model *model)
diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
index 445d342d7fd..69d431582a0 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
+++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp
@@ -83,7 +83,7 @@ static QString propertyEditorResourcesPath() {
ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
QFrame(parent),
m_itemIconSize(24, 24),
- m_itemViewQuickWidget(new QQuickWidget),
+ m_itemViewQuickWidget(new QQuickWidget(this)),
m_resourcesView(new ItemLibraryResourceView(this)),
m_importTagsWidget(new QWidget(this)),
m_addResourcesWidget(new QWidget(this)),
@@ -121,7 +121,7 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
auto tabBar = new QTabBar(this);
tabBar->addTab(tr("QML Types", "Title of library QML types view"));
tabBar->addTab(tr("Assets", "Title of library assets view"));
- tabBar->addTab(tr("Imports", "Title of library imports view"));
+ tabBar->addTab(tr("QML Imports", "Title of QML imports view"));
tabBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(tabBar, &QTabBar::currentChanged, this, &ItemLibraryWidget::setCurrentIndexOfStackedWidget);
connect(tabBar, &QTabBar::currentChanged, this, &ItemLibraryWidget::updateSearch);
@@ -147,6 +147,8 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
m_stackedWidget = new QStackedWidget(this);
m_stackedWidget->addWidget(m_itemViewQuickWidget.data());
m_stackedWidget->addWidget(m_resourcesView.data());
+ m_stackedWidget->setMinimumHeight(30);
+ m_stackedWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
QWidget *spacer = new QWidget(this);
spacer->setObjectName(QStringLiteral("itemLibrarySearchInputSpacer"));
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index 98735e51206..93b1997707c 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -75,8 +75,10 @@ static QList<ModelNode> modelNodesFromMimeData(const QMimeData *mineData, Abstra
bool fitsToTargetProperty(const NodeAbstractProperty &targetProperty,
const QList<ModelNode> &modelNodeList)
{
+ bool const canBeContainer =
+ NodeHints::fromModelNode(targetProperty.parentModelNode()).canBeContainerFor(modelNodeList.first());
return !(targetProperty.isNodeProperty() &&
- modelNodeList.count() > 1);
+ modelNodeList.count() > 1) && canBeContainer;
}
static inline QString msgUnknownItem(const QString &t)
diff --git a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp
index 4918f88a8bf..8da3cc9bba0 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatorview.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatorview.cpp
@@ -142,7 +142,8 @@ WidgetInfo NavigatorView::widgetInfo()
new WidgetInfo::ToolBarWidgetDefaultFactory<NavigatorWidget>(m_widget.data()),
QStringLiteral("Navigator"),
WidgetInfo::LeftPane,
- 0);
+ 0,
+ tr("Navigator"));
}
void NavigatorView::modelAttached(Model *model)
diff --git a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
index 12103b048ba..0d2417e3944 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatorwidget.cpp
@@ -61,39 +61,15 @@ NavigatorWidget::NavigatorWidget(NavigatorView *view)
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
- auto tabBar = new QTabBar(this);
- tabBar->addTab(tr("Navigator"));
- tabBar->addTab(tr("Project"));
- tabBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-
- QWidget *spacer = new QWidget(this);
- spacer->setObjectName(QStringLiteral("itemLibrarySearchInputSpacer"));
- spacer->setFixedHeight(4);
-
- layout->addWidget(tabBar);
- layout->addWidget(spacer);
-
- auto stackedWidget = new QStackedWidget(this);
- stackedWidget->addWidget(m_treeView);
-
-#ifndef QMLDESIGNER_TEST
- auto projectManager = QmlDesignerPlugin::instance()->createProjectExplorerWidget(this);
-
- QTC_ASSERT(projectManager, ;);
- if (projectManager)
- stackedWidget->addWidget(projectManager);
-#endif
-
- connect(tabBar, &QTabBar::currentChanged, stackedWidget, &QStackedWidget::setCurrentIndex);
-
- layout->addWidget(stackedWidget);
+ layout->addWidget(m_treeView);
setLayout(layout);
setWindowTitle(tr("Navigator", "Title of navigator view"));
#ifndef QMLDESIGNER_TEST
- setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"))));
- m_treeView->setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css"))));
+ QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
+ sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
+ setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
#endif
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp
index 8237390de90..3977eff168a 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetdefaultlistmodel.cpp
@@ -56,6 +56,8 @@ void GradientPresetDefaultListModel::addAllPresets()
return;
for (int i = 0; i < metaEnum.keyCount(); i++) {
- addItem(GradientPresetItem(GradientPresetItem::Preset(metaEnum.value(i))));
+ auto preset = GradientPresetItem::Preset(metaEnum.value(i));
+ if (preset < GradientPresetItem::Preset::NumPresets)
+ addItem(GradientPresetItem(preset));
}
}
diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h
index cd0f0017e0e..4cb5a519fbf 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetitem.h
@@ -42,7 +42,7 @@ public:
#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
using Preset = QGradient::Preset;
#else
- enum Preset {};
+ enum Preset { NumPresets = 0 };
#endif
explicit GradientPresetItem();
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
index 7497879ecb5..da3c331d5c3 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp
@@ -277,7 +277,7 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm
}
}
-void PropertyEditorQmlBackend::setValue(const QmlObjectNode & qmlObjectNode, const PropertyName &name, const QVariant &value)
+void PropertyEditorQmlBackend::setValue(const QmlObjectNode & , const PropertyName &name, const QVariant &value)
{
PropertyName propertyName = name;
propertyName.replace('.', '_');
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
index 7fa264a121c..1f2440b56f0 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp
@@ -760,7 +760,7 @@ bool PropertyEditorView::hasWidget() const
WidgetInfo PropertyEditorView::widgetInfo()
{
- return createWidgetInfo(m_stackedWidget, nullptr, QStringLiteral("Properties"), WidgetInfo::RightPane, 0);
+ return createWidgetInfo(m_stackedWidget, nullptr, QStringLiteral("Properties"), WidgetInfo::RightPane, 0, tr("Properties"));
}
void PropertyEditorView::currentStateChanged(const ModelNode &node)
diff --git a/src/plugins/qmldesigner/components/resources/centerwidget.css b/src/plugins/qmldesigner/components/resources/centerwidget.css
index 41855e5d770..ba659f61c4d 100644
--- a/src/plugins/qmldesigner/components/resources/centerwidget.css
+++ b/src/plugins/qmldesigner/components/resources/centerwidget.css
@@ -28,6 +28,10 @@ QTabBar#centralTabBar::tab:selected {
color: creatorTheme.QmlDesigner_TabDark;
}
+QTabBar#centralTabBar::tab:disabled {
+ color: creatorTheme.QmlDesigner_ScrollBarHandleColor;
+}
+
QToolButton#centralTabBar {
background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
width: 08px;
diff --git a/src/plugins/qmldesigner/components/resources/dockwidgets.css b/src/plugins/qmldesigner/components/resources/dockwidgets.css
new file mode 100644
index 00000000000..b878e5c6ebd
--- /dev/null
+++ b/src/plugins/qmldesigner/components/resources/dockwidgets.css
@@ -0,0 +1,128 @@
+ADS--DockContainerWidget
+{
+ background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
+}
+
+ADS--DockContainerWidget QSplitter::handle
+{
+ background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;
+}
+
+ADS--DockAreaWidget
+{
+ background-color: creatorTheme.BackgroundColorNormal;
+}
+
+ADS--DockAreaWidget #tabsMenuButton::menu-indicator
+{
+ image: none;
+}
+
+ADS--DockSplitter::handle:horizontal {
+ width: 1px;
+ background-color: creatorTheme.SplitterColor;
+}
+
+ADS--DockSplitter::handle:vertical {
+ height: 1px;
+ background-color: creatorTheme.SplitterColor;
+}
+
+ADS--DockWidgetTab
+{
+ background-color: creatorTheme.BackgroundColorDark;
+ border-color: creatorTheme.SplitterColor;
+ border-style: solid;
+ border-width: 0 1px 0 0;
+}
+
+ADS--DockWidgetTab[activeTab="true"]
+{
+ background-color: creatorTheme.QmlDesigner_TabLight;
+}
+
+ADS--DockWidgetTab QLabel
+{
+ color: creatorTheme.QmlDesigner_TabLight;
+}
+
+ADS--DockWidgetTab[activeTab="true"] QLabel
+{
+ color: creatorTheme.QmlDesigner_TabDark;
+}
+
+ADS--DockWidget
+{
+ background-color: palette(light);
+ border-color: red;
+ border-style: solid;
+ border-width: 0;
+}
+
+ADS--DockAreaTitleBar{ background-color: creatorTheme.BackgroundColorDark; }
+
+QWidget#tabsContainerWidget { background-color: creatorTheme.BackgroundColorDark; }
+
+ADS--TitleBarButton
+{
+ padding: 0px 0px;
+}
+
+QScrollArea#dockWidgetScrollArea
+{
+ padding: 0px;
+ border: none;
+}
+
+#tabCloseButton
+{
+ margin-top: 2px;
+ background: none;
+ border: none;
+ padding: 0px -2px;
+}
+
+#tabCloseButton:hover
+{
+ border: 1px solid rgba(0, 0, 0, 32);
+ background: rgba(0, 0, 0, 16);
+}
+
+#tabCloseButton:pressed
+{
+ background: rgba(0, 0, 0, 32);
+}
+
+QScrollBar {
+ background-color: creatorTheme.BackgroundColorDark;
+}
+
+QScrollBar:vertical {
+ width: 10px;
+}
+
+QScrollBar:horizontal {
+ height: 10px;
+}
+
+QScrollBar::handle {
+ background-color: creatorTheme.QmlDesigner_ScrollBarHandleColor;
+}
+
+QScrollBar::handle:vertical {
+ min-height: 30px;
+}
+
+QScrollBar::handle:horizontal {
+ min-width: 30px;
+}
+
+QScrollBar::add-line,
+QScrollBar::sub-line,
+QScrollBar::left-arrow,
+QScrollBar::right-arrow,
+QScrollBar::add-page,
+QScrollBar::sub-page {
+ height: 0px;
+ width: 0px;
+}
diff --git a/src/plugins/qmldesigner/components/resources/resources.qrc b/src/plugins/qmldesigner/components/resources/resources.qrc
index 4100b9da6bc..40a1595d24f 100644
--- a/src/plugins/qmldesigner/components/resources/resources.qrc
+++ b/src/plugins/qmldesigner/components/resources/resources.qrc
@@ -4,6 +4,7 @@
<file>scrollbar.css</file>
<file>formeditorstylesheet.css</file>
<file>centerwidget.css</file>
+ <file>dockwidgets.css</file>
<file>images/spliteditorhorizontally.png</file>
<file>images/spliteditorhorizontally@2x.png</file>
<file>images/spliteditorvertically.png</file>
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
index 956b0d32a63..dafe5f3ff26 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.cpp
@@ -127,6 +127,12 @@ void StatesEditorWidget::toggleStatesViewExpanded()
rootObject()->setProperty("expanded", !expanded);
}
+void StatesEditorWidget::showEvent(QShowEvent *event)
+{
+ Q_UNUSED(event)
+ update();
+}
+
void StatesEditorWidget::reloadQmlSource()
{
QString statesListQmlFilePath = qmlSourcesPath() + QStringLiteral("/StatesList.qml");
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h
index ce636201f69..e4e9668abb0 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorwidget.h
@@ -59,6 +59,9 @@ public:
void toggleStatesViewExpanded();
+protected:
+ void showEvent(QShowEvent *) override;
+
private:
void reloadQmlSource();
Q_SLOT void handleExpandedChanged();
diff --git a/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp
index 2c4fb147b04..71fcb1a260e 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/animationcurvedialog.cpp
@@ -33,14 +33,12 @@ AnimationCurveDialog::AnimationCurveDialog(QWidget *parent)
: QDialog(parent)
, m_editor(nullptr)
{
- setWindowFlag(Qt::WindowContextHelpButtonHint, false);
}
AnimationCurveDialog::AnimationCurveDialog(DesignTools::CurveEditorModel *model, QWidget *parent)
: QDialog(parent)
, m_editor(nullptr)
{
- setWindowFlag(Qt::WindowContextHelpButtonHint, false);
setModel(model);
}
diff --git a/src/plugins/qmldesigner/components/timelineeditor/easingcurvedialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/easingcurvedialog.cpp
index 938cc0dce1f..91ab2339008 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/easingcurvedialog.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/easingcurvedialog.cpp
@@ -61,7 +61,6 @@ EasingCurveDialog::EasingCurveDialog(const QList<ModelNode> &frames, QWidget *pa
, m_label(new QLabel)
, m_frames(frames)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowFlag(Qt::Tool, true);
auto tw = new QTabWidget;
diff --git a/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp
index dbb70ca07a5..70f382e859b 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/setframevaluedialog.cpp
@@ -36,7 +36,6 @@ SetFrameValueDialog::SetFrameValueDialog(qreal frame, const QVariant &value,
, ui(new Ui::SetFrameValueDialog)
{
ui->setupUi(this);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Edit Keyframe"));
setFixedSize(size());
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp
index 3af73cd8233..7549e741bd3 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/timelinesectionitem.cpp
@@ -530,7 +530,7 @@ static void drawCenteredText(QPainter *p, int x, int y, const QString &text)
p->drawText(rect, Qt::AlignCenter, text);
}
-TimelineRulerSectionItem *TimelineRulerSectionItem::create(QGraphicsScene *parentScene,
+TimelineRulerSectionItem *TimelineRulerSectionItem::create(QGraphicsScene * ,
TimelineItem *parent)
{
auto item = new TimelineRulerSectionItem(parent);
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp
index 960c409553a..8b098e92ba1 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/timelinesettingsdialog.cpp
@@ -102,7 +102,6 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi
{
m_timelineSettingsModel = new TimelineSettingsModel(this, view);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->setupUi(this);
auto *timelineCornerWidget = new QToolBar;
diff --git a/src/plugins/qmldesigner/componentsplugin/componentsplugin.qbs b/src/plugins/qmldesigner/componentsplugin/componentsplugin.qbs
index 51d8ccbd636..a49c475f800 100644
--- a/src/plugins/qmldesigner/componentsplugin/componentsplugin.qbs
+++ b/src/plugins/qmldesigner/componentsplugin/componentsplugin.qbs
@@ -16,6 +16,7 @@ QtcProduct {
"..",
"../components/componentcore",
"../components/debugview",
+ "../components/edit3d",
"../components/formeditor",
"../components/importmanager",
"../components/integration",
diff --git a/src/plugins/qmldesigner/designercore/include/abstractview.h b/src/plugins/qmldesigner/designercore/include/abstractview.h
index 2e549b52b1e..08e5d954749 100644
--- a/src/plugins/qmldesigner/designercore/include/abstractview.h
+++ b/src/plugins/qmldesigner/designercore/include/abstractview.h
@@ -44,6 +44,7 @@
QT_BEGIN_NAMESPACE
class QStyle;
class QToolButton;
+class QImage;
QT_END_NAMESPACE
namespace QmlDesigner {
@@ -182,6 +183,8 @@ public:
void emitRewriterBeginTransaction();
void emitRewriterEndTransaction();
void emitInstanceToken(const QString &token, int number, const QVector<ModelNode> &nodeVector);
+ void emitRenderImage3DChanged(const QImage &image);
+ void emitUpdateActiveScene3D(const QVariantMap &sceneState);
void sendTokenToInstances(const QString &token, int number, const QVector<ModelNode> &nodeVector);
@@ -237,6 +240,9 @@ public:
virtual void currentTimelineChanged(const ModelNode &node);
+ virtual void renderImage3DChanged(const QImage &image);
+ virtual void updateActiveScene3D(const QVariantMap &sceneState);
+
void changeRootNodeType(const TypeName &type, int majorVersion, int minorVersion);
NodeInstanceView *nodeInstanceView() const;
diff --git a/src/plugins/qmldesigner/designercore/include/nodehints.h b/src/plugins/qmldesigner/designercore/include/nodehints.h
index 7fed390ee0a..9b9f52721ac 100644
--- a/src/plugins/qmldesigner/designercore/include/nodehints.h
+++ b/src/plugins/qmldesigner/designercore/include/nodehints.h
@@ -59,6 +59,7 @@ public:
bool doesLayoutChildren() const;
bool canBeDroppedInFormEditor() const;
bool canBeDroppedInNavigator() const;
+ bool canBeDroppedInView3D() const;
bool isMovable() const;
bool isResizable() const;
bool isStackedContainer() const;
diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
index 33c436aa100..6087997332c 100644
--- a/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
+++ b/src/plugins/qmldesigner/designercore/include/nodeinstanceview.h
@@ -39,6 +39,7 @@
#include <QPointer>
#include <QRectF>
#include <QTime>
+#include <QtGui/qevent.h>
namespace ProjectExplorer {
class Target;
@@ -94,7 +95,6 @@ public:
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data) override;
void nodeSourceChanged(const ModelNode &modelNode, const QString &newNodeSource) override;
-
void currentStateChanged(const ModelNode &node) override;
QList<NodeInstance> instances() const;
@@ -136,7 +136,9 @@ public:
void mainWindowStateChanged(Qt::WindowStates previousStates, Qt::WindowStates currentStates);
void mainWindowActiveChanged(bool active, bool hasPopup);
- void enable3DView(bool enable);
+ void sendInputEvent(QInputEvent *e) const;
+ void view3DAction(const View3DActionCommand &command);
+ void edit3DViewResized(const QSize &size) const;
void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override;
diff --git a/src/plugins/qmldesigner/designercore/include/viewmanager.h b/src/plugins/qmldesigner/designercore/include/viewmanager.h
index 8f1ccbfe083..3491a7c33a3 100644
--- a/src/plugins/qmldesigner/designercore/include/viewmanager.h
+++ b/src/plugins/qmldesigner/designercore/include/viewmanager.h
@@ -42,6 +42,7 @@ class AbstractCustomTool;
class DesignerActionManager;
class NodeInstanceView;
class RewriterView;
+class Edit3DView;
namespace Internal { class DesignModeWidget; }
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
index 706d62b2cfc..480f1e4472a 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
@@ -30,7 +30,6 @@
#include <createinstancescommand.h>
#include <createscenecommand.h>
#include <update3dviewstatecommand.h>
-#include <enable3dviewcommand.h>
#include <changevaluescommand.h>
#include <changebindingscommand.h>
#include <changeauxiliarycommand.h>
@@ -47,6 +46,8 @@
#include <drop3dlibraryitemcommand.h>
#include <puppettocreatorcommand.h>
#include <view3dclosedcommand.h>
+#include <inputeventcommand.h>
+#include <view3dactioncommand.h>
#include <informationchangedcommand.h>
#include <pixmapchangedcommand.h>
@@ -665,11 +666,6 @@ void NodeInstanceServerProxy::update3DViewState(const Update3dViewStateCommand &
writeCommand(QVariant::fromValue(command));
}
-void NodeInstanceServerProxy::enable3DView(const Enable3DViewCommand &command)
-{
- writeCommand(QVariant::fromValue(command));
-}
-
void NodeInstanceServerProxy::removeInstances(const RemoveInstancesCommand &command)
{
writeCommand(QVariant::fromValue(command));
@@ -732,7 +728,7 @@ void NodeInstanceServerProxy::token(const TokenCommand &command)
void NodeInstanceServerProxy::removeSharedMemory(const RemoveSharedMemoryCommand &command)
{
- writeCommand(QVariant::fromValue(command));
+ writeCommand(QVariant::fromValue(command));
}
void NodeInstanceServerProxy::benchmark(const QString &message)
@@ -740,4 +736,14 @@ void NodeInstanceServerProxy::benchmark(const QString &message)
qCInfo(instanceViewBenchmark) << message << m_benchmarkTimer.elapsed();
}
+void NodeInstanceServerProxy::inputEvent(const InputEventCommand &command)
+{
+ writeCommand(QVariant::fromValue(command));
+}
+
+void NodeInstanceServerProxy::view3DAction(const View3DActionCommand &command)
+{
+ writeCommand(QVariant::fromValue(command));
+}
+
} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h
index 5affc3fe448..77a86199a60 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.h
@@ -68,7 +68,6 @@ public:
void changeFileUrl(const ChangeFileUrlCommand &command) override;
void createScene(const CreateSceneCommand &command) override;
void update3DViewState(const Update3dViewStateCommand &command) override;
- void enable3DView(const Enable3DViewCommand &command) override;
void clearScene(const ClearSceneCommand &command) override;
void removeInstances(const RemoveInstancesCommand &command) override;
void changeSelection(const ChangeSelectionCommand &command) override;
@@ -84,6 +83,8 @@ public:
void token(const TokenCommand &command) override;
void removeSharedMemory(const RemoveSharedMemoryCommand &command) override;
void benchmark(const QString &message) override;
+ void inputEvent(const InputEventCommand &command) override;
+ void view3DAction(const View3DActionCommand &command) override;
protected:
void writeCommand(const QVariant &command);
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
index a7cf6a64e14..e361b742058 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
@@ -48,7 +48,6 @@
#include "changefileurlcommand.h"
#include "reparentinstancescommand.h"
#include "update3dviewstatecommand.h"
-#include "enable3dviewcommand.h"
#include "changevaluescommand.h"
#include "changeauxiliarycommand.h"
#include "changebindingscommand.h"
@@ -71,6 +70,8 @@
#include "debugoutputcommand.h"
#include "nodeinstanceserverproxy.h"
#include "puppettocreatorcommand.h"
+#include "inputeventcommand.h"
+#include "view3dactioncommand.h"
#ifndef QMLDESIGNER_TEST
#include <qmldesignerplugin.h>
@@ -1470,6 +1471,13 @@ void NodeInstanceView::handlePuppetToCreatorCommand(const PuppetToCreatorCommand
m_edit3DToolStates[qmlId].insert(data[1].toString(), data[2]);
}
}
+ } else if (command.type() == PuppetToCreatorCommand::Render3DView) {
+ ImageContainer container = qvariant_cast<ImageContainer>(command.data());
+ if (!container.image().isNull())
+ emitRenderImage3DChanged(container.image());
+ } else if (command.type() == PuppetToCreatorCommand::ActiveSceneChanged) {
+ const auto sceneState = qvariant_cast<QVariantMap>(command.data());
+ emitUpdateActiveScene3D(sceneState);
}
}
@@ -1526,10 +1534,19 @@ void NodeInstanceView::mainWindowActiveChanged(bool active, bool hasPopup)
nodeInstanceServer()->update3DViewState(Update3dViewStateCommand(active, hasPopup));
}
-// enable / disable 3D edit View
-void NodeInstanceView::enable3DView(bool enable)
+void NodeInstanceView::sendInputEvent(QInputEvent *e) const
{
- nodeInstanceServer()->enable3DView(Enable3DViewCommand(enable));
+ nodeInstanceServer()->inputEvent(InputEventCommand(e));
+}
+
+void NodeInstanceView::view3DAction(const View3DActionCommand &command)
+{
+ nodeInstanceServer()->view3DAction(command);
+}
+
+void NodeInstanceView::edit3DViewResized(const QSize &size) const
+{
+ nodeInstanceServer()->update3DViewState(Update3dViewStateCommand(size));
}
void NodeInstanceView::timerEvent(QTimerEvent *event)
diff --git a/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp
index f72513c84db..abd64928527 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/itemlibraryinfo.cpp
@@ -28,6 +28,7 @@
#include <QSharedData>
+#include <utils/algorithm.h>
#include <utils/fileutils.h>
namespace QmlDesigner {
@@ -193,7 +194,7 @@ void ItemLibraryEntry::setRequiredImport(const QString &requiredImport)
void ItemLibraryEntry::addHints(const QHash<QString, QString> &hints)
{
- m_data->hints.unite(hints);
+ Utils::addToHash(&m_data->hints, hints);
}
void ItemLibraryEntry::addProperty(PropertyName &name, QString &type, QVariant &value)
diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodehints.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodehints.cpp
index 4862b59c048..1e34e197bbe 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/nodehints.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/nodehints.cpp
@@ -165,6 +165,11 @@ bool NodeHints::canBeDroppedInNavigator() const
return evaluateBooleanExpression("canBeDroppedInNavigator", true);
}
+bool NodeHints::canBeDroppedInView3D() const
+{
+ return evaluateBooleanExpression("canBeDroppedInView3D", false);
+}
+
bool NodeHints::isMovable() const
{
if (!isValid())
diff --git a/src/plugins/qmldesigner/designercore/model/abstractview.cpp b/src/plugins/qmldesigner/designercore/model/abstractview.cpp
index f5e07d9f834..de0c8882a1a 100644
--- a/src/plugins/qmldesigner/designercore/model/abstractview.cpp
+++ b/src/plugins/qmldesigner/designercore/model/abstractview.cpp
@@ -42,6 +42,7 @@
#include <utils/algorithm.h>
#include <QRegExp>
+#include <QtGui/qimage.h>
namespace QmlDesigner {
@@ -362,7 +363,14 @@ void AbstractView::documentMessagesChanged(const QList<DocumentMessage> &/*error
void AbstractView::currentTimelineChanged(const ModelNode & /*node*/)
{
+}
+void AbstractView::renderImage3DChanged(const QImage & /*image*/)
+{
+}
+
+void AbstractView::updateActiveScene3D(const QVariantMap & /*sceneState*/)
+{
}
QList<ModelNode> AbstractView::toModelNodeList(const QList<Internal::InternalNode::Pointer> &nodeList) const
@@ -729,6 +737,18 @@ void AbstractView::emitInstanceToken(const QString &token, int number, const QVe
model()->d->notifyInstanceToken(token, number, nodeVector);
}
+void AbstractView::emitRenderImage3DChanged(const QImage &image)
+{
+ if (model())
+ model()->d->notifyRenderImage3DChanged(image);
+}
+
+void AbstractView::emitUpdateActiveScene3D(const QVariantMap &sceneState)
+{
+ if (model())
+ model()->d->notifyUpdateActiveScene3D(sceneState);
+}
+
void AbstractView::emitRewriterEndTransaction()
{
if (model())
diff --git a/src/plugins/qmldesigner/designercore/model/model.cpp b/src/plugins/qmldesigner/designercore/model/model.cpp
index 45d6f872eda..871c04aeb17 100644
--- a/src/plugins/qmldesigner/designercore/model/model.cpp
+++ b/src/plugins/qmldesigner/designercore/model/model.cpp
@@ -668,6 +668,22 @@ void ModelPrivate::notifyCurrentTimelineChanged(const ModelNode &node)
resetModelByRewriter(description);
}
+void ModelPrivate::notifyRenderImage3DChanged(const QImage &image)
+{
+ for (const QPointer<AbstractView> &view : qAsConst(m_viewList)) {
+ Q_ASSERT(view != nullptr);
+ view->renderImage3DChanged(image);
+ }
+}
+
+void ModelPrivate::notifyUpdateActiveScene3D(const QVariantMap &sceneState)
+{
+ for (const QPointer<AbstractView> &view : qAsConst(m_viewList)) {
+ Q_ASSERT(view != nullptr);
+ view->updateActiveScene3D(sceneState);
+ }
+}
+
void ModelPrivate::notifyRewriterBeginTransaction()
{
bool resetModel = false;
diff --git a/src/plugins/qmldesigner/designercore/model/model_p.h b/src/plugins/qmldesigner/designercore/model/model_p.h
index dd29d25e510..6990610b374 100644
--- a/src/plugins/qmldesigner/designercore/model/model_p.h
+++ b/src/plugins/qmldesigner/designercore/model/model_p.h
@@ -158,6 +158,9 @@ public:
void notifyCurrentStateChanged(const ModelNode &node);
void notifyCurrentTimelineChanged(const ModelNode &node);
+ void notifyRenderImage3DChanged(const QImage &image);
+ void notifyUpdateActiveScene3D(const QVariantMap &sceneState);
+
void setDocumentMessages(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &warnings);
void notifyRewriterBeginTransaction();
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
index c09895ad918..de07ef230fe 100644
--- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
+++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
@@ -80,7 +80,7 @@ QStringList supportedVersionsList()
{
static const QStringList list = {
"2.0", "2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7", "2.8", "2.9",
- "2.10", "2.11", "2.12", "2.13", "2.14"
+ "2.10", "2.11", "2.12", "2.13", "2.14", "2.15"
};
return list;
}
diff --git a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp
index 65d76164844..b2873816af7 100644
--- a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp
+++ b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp
@@ -36,6 +36,7 @@
#include <itemlibraryview.h>
#include <navigatorview.h>
#include <stateseditorview.h>
+#include <edit3dview.h>
#include <formeditorview.h>
#include <texteditorview.h>
#include <propertyeditorview.h>
@@ -63,6 +64,7 @@ public:
DesignerActionManagerView designerActionManagerView;
NodeInstanceView nodeInstanceView;
ComponentView componentView;
+ Edit3DView edit3DView;
FormEditorView formEditorView;
TextEditorView textEditorView;
ItemLibraryView itemLibraryView;
@@ -73,7 +75,6 @@ public:
QList<QPointer<AbstractView> > additionalViews;
};
-
static CrumbleBar *crumbleBar() {
return QmlDesignerPlugin::instance()->mainWidget()->crumbleBar();
}
@@ -165,6 +166,7 @@ QList<QPointer<AbstractView> > ViewManager::views() const
{
auto list = d->additionalViews;
list.append({
+ &d->edit3DView,
&d->formEditorView,
&d->textEditorView,
&d->itemLibraryView,
@@ -195,6 +197,7 @@ void ViewManager::detachViewsExceptRewriterAndComponetView()
switchStateEditorViewToBaseState();
detachAdditionalViews();
currentModel()->detachView(&d->designerActionManagerView);
+ currentModel()->detachView(&d->edit3DView);
currentModel()->detachView(&d->formEditorView);
currentModel()->detachView(&d->textEditorView);
currentModel()->detachView(&d->navigatorView);
@@ -264,9 +267,15 @@ void ViewManager::attachViewsExceptRewriterAndComponetView()
int last = time.elapsed();
qCInfo(viewBenchmark) << "ActionManagerView:" << last << time.elapsed();
- currentModel()->attachView(&d->formEditorView);
+ currentModel()->attachView(&d->edit3DView);
int currentTime = time.elapsed();
+ qCInfo(viewBenchmark) << "Edit3DView:" << currentTime - last;
+ last = currentTime;
+
+ currentModel()->attachView(&d->formEditorView);
+
+ currentTime = time.elapsed();
qCInfo(viewBenchmark) << "FormEditorView:" << currentTime - last;
last = currentTime;
@@ -337,6 +346,7 @@ QList<WidgetInfo> ViewManager::widgetInfos() const
{
QList<WidgetInfo> widgetInfoList;
+ widgetInfoList.append(d->edit3DView.widgetInfo());
widgetInfoList.append(d->formEditorView.widgetInfo());
widgetInfoList.append(d->textEditorView.widgetInfo());
widgetInfoList.append(d->itemLibraryView.widgetInfo());
diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp
index 759789d7ce2..091f1d5e459 100644
--- a/src/plugins/qmldesigner/designmodewidget.cpp
+++ b/src/plugins/qmldesigner/designmodewidget.cpp
@@ -31,12 +31,19 @@
#include "qmldesignerplugin.h"
#include "crumblebar.h"
#include "documentwarningwidget.h"
+#include "edit3dview.h"
#include <texteditor/textdocument.h>
#include <nodeinstanceview.h>
#include <itemlibrarywidget.h>
#include <theme.h>
+#include <coreplugin/actionmanager/actioncontainer.h>
+#include <coreplugin/actionmanager/actionmanager.h>
+#include <coreplugin/actionmanager/actionmanager_p.h>
+#include <coreplugin/actionmanager/command.h>
+#include <qmldesigner/qmldesignerconstants.h>
+
#include <coreplugin/outputpane.h>
#include <coreplugin/modemanager.h>
#include <coreplugin/coreconstants.h>
@@ -56,6 +63,10 @@
#include <QToolBar>
#include <QLayout>
#include <QBoxLayout>
+#include <QDir>
+
+#include <advanceddockingsystem/dockareawidget.h>
+#include <advanceddockingsystem/docksplitter.h>
using Core::MiniSplitter;
using Core::IEditor;
@@ -67,13 +78,9 @@ enum {
debug = false
};
-const char SB_PROJECTS[] = "Projects";
-const char SB_FILESYSTEM[] = "FileSystem";
-const char SB_OPENDOCUMENTS[] = "OpenDocuments";
-
static void hideToolButtons(QList<QToolButton*> &buttons)
{
- foreach (QToolButton *button, buttons)
+ for (QToolButton *button : buttons)
button->hide();
}
@@ -138,36 +145,12 @@ DesignModeWidget::DesignModeWidget()
DesignModeWidget::~DesignModeWidget()
{
- m_leftSideBar.reset();
- m_rightSideBar.reset();
-
- foreach (QPointer<QWidget> widget, m_viewWidgets) {
+ for (QPointer<QWidget> widget : m_viewWidgets) {
if (widget)
widget.clear();
}
-}
-void DesignModeWidget::restoreDefaultView()
-{
- QSettings *settings = Core::ICore::settings();
- m_leftSideBar->closeAllWidgets();
- m_rightSideBar->closeAllWidgets();
- m_leftSideBar->readSettings(settings, "none.LeftSideBar");
- m_rightSideBar->readSettings(settings, "none.RightSideBar");
- m_leftSideBar->show();
- m_rightSideBar->show();
-}
-
-void DesignModeWidget::toggleLeftSidebar()
-{
- if (m_leftSideBar)
- m_leftSideBar->setVisible(!m_leftSideBar->isVisible());
-}
-
-void DesignModeWidget::toggleRightSidebar()
-{
- if (m_rightSideBar)
- m_rightSideBar->setVisible(!m_rightSideBar->isVisible());
+ delete m_dockManager;
}
QWidget *DesignModeWidget::createProjectExplorerWidget(QWidget *parent)
@@ -178,7 +161,7 @@ QWidget *DesignModeWidget::createProjectExplorerWidget(QWidget *parent)
Core::NavigationView navigationView;
navigationView.widget = nullptr;
- foreach (Core::INavigationWidgetFactory *factory, factories) {
+ for (Core::INavigationWidgetFactory *factory : factories) {
if (factory->id() == "Projects") {
navigationView = factory->createWidget();
hideToolButtons(navigationView.dockToolBarWidgets);
@@ -196,29 +179,23 @@ QWidget *DesignModeWidget::createProjectExplorerWidget(QWidget *parent)
return navigationView.widget;
}
-void DesignModeWidget::readSettings()
+void DesignModeWidget::readSettings() // readPerspectives
{
+ return;
+
QSettings *settings = Core::ICore::settings();
settings->beginGroup("Bauhaus");
- m_leftSideBar->readSettings(settings, QStringLiteral("LeftSideBar"));
- m_rightSideBar->readSettings(settings, QStringLiteral("RightSideBar"));
- if (settings->contains("MainSplitter")) {
- const QByteArray splitterState = settings->value("MainSplitter").toByteArray();
- m_mainSplitter->restoreState(splitterState);
- m_mainSplitter->setOpaqueResize(); // force opaque resize since it used to be off
- }
settings->endGroup();
}
-void DesignModeWidget::saveSettings()
+void DesignModeWidget::saveSettings() // savePerspectives
{
+ return;
+
QSettings *settings = Core::ICore::settings();
settings->beginGroup("Bauhaus");
- m_leftSideBar->saveSettings(settings, QStringLiteral("LeftSideBar"));
- m_rightSideBar->saveSettings(settings, QStringLiteral("RightSideBar"));
- settings->setValue("MainSplitter", m_mainSplitter->saveState());
settings->endGroup();
}
@@ -240,12 +217,20 @@ void DesignModeWidget::disableWidgets()
m_isDisabled = true;
}
-void DesignModeWidget::switchTextOrForm()
+bool DesignModeWidget::eventFilter(QObject *obj, QEvent *event) // TODO
{
- if (m_centralTabWidget->currentWidget() == viewManager().widget("TextEditor"))
- m_centralTabWidget->switchTo(viewManager().widget("FormEditor"));
- else
- m_centralTabWidget->switchTo(viewManager().widget("TextEditor"));
+ if (event->type() == QEvent::Hide) {
+ qDebug() << ">>> HIDE";
+ m_outputPaneDockWidget->toggleView(false);
+ return true;
+ } else if (event->type() == QEvent::Show) {
+ qDebug() << ">>> SHOW";
+ m_outputPaneDockWidget->toggleView(true);
+ return true;
+ } else {
+ // standard event processing
+ return QObject::eventFilter(obj, event);
+ }
}
void DesignModeWidget::setup()
@@ -255,42 +240,122 @@ void DesignModeWidget::setup()
actionManager.createDefaultAddResourceHandler();
actionManager.polishActions();
- QList<Core::INavigationWidgetFactory *> factories =
- Core::INavigationWidgetFactory::allNavigationFactories();
+ m_dockManager = new ADS::DockManager(this);
+ m_dockManager->setConfigFlags(ADS::DockManager::DefaultNonOpaqueConfig);
+ m_dockManager->setSettings(Core::ICore::settings(QSettings::UserScope));
+
+ QString sheet = QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/dockwidgets.css"));
+ m_dockManager->setStyleSheet(Theme::replaceCssColors(sheet));
+
+ // Setup Actions and Menus
+ Core::ActionContainer *mwindow = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW);
+ // Window > Views
+ Core::ActionContainer *mviews = Core::ActionManager::createMenu(Core::Constants::M_WINDOW_VIEWS);
+ mviews->menu()->addSeparator();
+ // Window > Workspaces
+ Core::ActionContainer *mworkspaces = Core::ActionManager::createMenu(QmlDesigner::Constants::M_WINDOW_WORKSPACES);
+ mwindow->addMenu(mworkspaces, Core::Constants::G_WINDOW_VIEWS);
+ mworkspaces->menu()->setTitle(tr("&Workspaces"));
+ mworkspaces->setOnAllDisabledBehavior(Core::ActionContainer::Show); // TODO what does it exactly do?!
+
+ // Connect opening of the 'window' menu with creation of the workspaces menu
+ connect(mwindow->menu(), &QMenu::aboutToShow, this, &DesignModeWidget::aboutToShowWorkspaces);
- QWidget *openDocumentsWidget = nullptr;
- QWidget *projectsExplorer = nullptr;
- QWidget *fileSystemExplorer = nullptr;
+ // Create a DockWidget for each QWidget and add them to the DockManager
+ const Core::Context designContext(Core::Constants::C_DESIGN_MODE);
+ static const Core::Id actionToggle("QmlDesigner.Toggle");
- foreach (Core::INavigationWidgetFactory *factory, factories) {
+ // First get all navigation views
+ QList<Core::INavigationWidgetFactory *> factories = Core::INavigationWidgetFactory::allNavigationFactories();
+
+ for (Core::INavigationWidgetFactory *factory : factories) {
Core::NavigationView navigationView;
navigationView.widget = nullptr;
+ QString uniqueId;
+ QString title;
+
if (factory->id() == "Projects") {
navigationView = factory->createWidget();
- projectsExplorer = navigationView.widget;
hideToolButtons(navigationView.dockToolBarWidgets);
- projectsExplorer->setWindowTitle(tr("Projects"));
- } else if (factory->id() == "File System") {
+ navigationView.widget->setWindowTitle(tr(factory->id().name()));
+ uniqueId = "Projects";
+ title = "Projects";
+ }
+ if (factory->id() == "File System") {
navigationView = factory->createWidget();
- fileSystemExplorer = navigationView.widget;
hideToolButtons(navigationView.dockToolBarWidgets);
- fileSystemExplorer->setWindowTitle(tr("File System"));
- } else if (factory->id() == "Open Documents") {
+ navigationView.widget->setWindowTitle(tr(factory->id().name()));
+ uniqueId = "FileSystem";
+ title = "File System";
+ }
+ if (factory->id() == "Open Documents") {
navigationView = factory->createWidget();
- openDocumentsWidget = navigationView.widget;
hideToolButtons(navigationView.dockToolBarWidgets);
- openDocumentsWidget->setWindowTitle(tr("Open Documents"));
+ navigationView.widget->setWindowTitle(tr(factory->id().name()));
+ uniqueId = "OpenDocuments";
+ title = "Open Documents";
}
if (navigationView.widget) {
+ // Apply stylesheet to QWidget
QByteArray sheet = Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css");
sheet += Utils::FileReader::fetchQrc(":/qmldesigner/scrollbar.css");
sheet += "QLabel { background-color: #4f4f4f; }";
navigationView.widget->setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(sheet)));
+
+ // Create DockWidget
+ ADS::DockWidget *dockWidget = new ADS::DockWidget(uniqueId);
+ dockWidget->setWidget(navigationView.widget);
+ dockWidget->setWindowTitle(title);
+ m_dockManager->addDockWidget(ADS::NoDockWidgetArea, dockWidget);
+
+ // Create menu action
+ auto command = Core::ActionManager::registerAction(dockWidget->toggleViewAction(),
+ actionToggle.withSuffix(uniqueId + "Widget"),
+ designContext);
+ command->setAttribute(Core::Command::CA_Hide);
+ mviews->addAction(command);
}
}
- auto toolBar = new QToolBar;
+ // Afterwards get all the other widgets
+ for (const WidgetInfo &widgetInfo : viewManager().widgetInfos()) {
+ // Create DockWidget
+ ADS::DockWidget *dockWidget = new ADS::DockWidget(widgetInfo.uniqueId);
+ dockWidget->setWidget(widgetInfo.widget);
+ dockWidget->setWindowTitle(widgetInfo.tabName);
+ m_dockManager->addDockWidget(ADS::NoDockWidgetArea, dockWidget);
+
+ // Add to view widgets
+ m_viewWidgets.append(widgetInfo.widget);
+
+ // Create menu action
+ auto command = Core::ActionManager::registerAction(dockWidget->toggleViewAction(),
+ actionToggle.withSuffix(widgetInfo.uniqueId + "Widget"),
+ designContext);
+ command->setAttribute(Core::Command::CA_Hide);
+ mviews->addAction(command);
+ }
+
+ // Finally the output pane
+ {
+ auto outputPanePlaceholder = new Core::OutputPanePlaceHolder(Core::Constants::MODE_DESIGN);
+ m_outputPaneDockWidget = new ADS::DockWidget("OutputPane");
+ m_outputPaneDockWidget->setWidget(outputPanePlaceholder);
+ m_outputPaneDockWidget->setWindowTitle("Output Pane");
+ m_dockManager->addDockWidget(ADS::NoDockWidgetArea, m_outputPaneDockWidget);
+ // Create menu action
+ auto command = Core::ActionManager::registerAction(m_outputPaneDockWidget->toggleViewAction(),
+ actionToggle.withSuffix("OutputPaneWidget"),
+ designContext);
+ command->setAttribute(Core::Command::CA_Hide);
+ mviews->addAction(command);
+
+ //outputPanePlaceholder->installEventFilter(this);
+ }
+
+ // Create toolbars
+ auto toolBar = new QToolBar();
toolBar->addAction(viewManager().componentViewAction());
toolBar->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
DesignerActionToolBar *designerToolBar = QmlDesignerPlugin::instance()->viewManager().designerActionManager().createToolBar(m_toolBar);
@@ -298,97 +363,162 @@ void DesignModeWidget::setup()
designerToolBar->layout()->addWidget(toolBar);
m_toolBar->addCenterToolBar(designerToolBar);
-
m_toolBar->setMinimumWidth(320);
+ m_toolBar->setToolbarCreationFlags(Core::EditorToolBar::FlagsStandalone);
+ m_toolBar->setNavigationVisible(true);
- m_mainSplitter = new MiniSplitter(this);
- m_mainSplitter->setObjectName("mainSplitter");
+ connect(m_toolBar, &Core::EditorToolBar::goForwardClicked, this, &DesignModeWidget::toolBarOnGoForwardClicked);
+ connect(m_toolBar, &Core::EditorToolBar::goBackClicked, this, &DesignModeWidget::toolBarOnGoBackClicked);
- QList<Core::SideBarItem*> sideBarItems;
- QList<Core::SideBarItem*> leftSideBarItems;
- QList<Core::SideBarItem*> rightSideBarItems;
+ QToolBar* toolBarWrapper = new QToolBar();
+ toolBarWrapper->addWidget(m_toolBar);
+ toolBarWrapper->addWidget(createCrumbleBarFrame());
+ toolBarWrapper->setMovable(false);
+ addToolBar(Qt::TopToolBarArea, toolBarWrapper);
- foreach (const WidgetInfo &widgetInfo, viewManager().widgetInfos()) {
- if (widgetInfo.placementHint == widgetInfo.LeftPane) {
- Core::SideBarItem *sideBarItem = new DesignerSideBarItem(widgetInfo.widget, widgetInfo.toolBarWidgetFactory, widgetInfo.uniqueId);
- sideBarItems.append(sideBarItem);
- leftSideBarItems.append(sideBarItem);
- }
+ if (currentDesignDocument())
+ setupNavigatorHistory(currentDesignDocument()->textEditor());
- if (widgetInfo.placementHint == widgetInfo.RightPane) {
- Core::SideBarItem *sideBarItem = new DesignerSideBarItem(widgetInfo.widget, widgetInfo.toolBarWidgetFactory, widgetInfo.uniqueId);
- sideBarItems.append(sideBarItem);
- rightSideBarItems.append(sideBarItem);
+ // Get a list of all available workspaces
+ QStringList workspaces = m_dockManager->workspaces();
+ QString workspace = ADS::Constants::FACTORY_DEFAULT_NAME;
- }
- m_viewWidgets.append(widgetInfo.widget);
+ // If there is no factory default workspace create one and write the xml file
+ if (!workspaces.contains(ADS::Constants::FACTORY_DEFAULT_NAME)) {
+ createFactoryDefaultWorkspace();
+ // List of workspaces needs to be updated
+ workspaces = m_dockManager->workspaces();
}
- if (projectsExplorer) {
- Core::SideBarItem *projectExplorerItem = new Core::SideBarItem(projectsExplorer, QLatin1String(SB_PROJECTS));
- sideBarItems.append(projectExplorerItem);
+ // Determine workspace to restore at startup
+ if (m_dockManager->autoRestorLastWorkspace()) {
+ QString lastWorkspace = m_dockManager->lastWorkspace();
+ if (!lastWorkspace.isEmpty() && workspaces.contains(lastWorkspace))
+ workspace = lastWorkspace;
+ else
+ qDebug() << "Couldn't restore last workspace!";
}
- if (fileSystemExplorer) {
- Core::SideBarItem *fileSystemExplorerItem = new Core::SideBarItem(fileSystemExplorer, QLatin1String(SB_FILESYSTEM));
- sideBarItems.append(fileSystemExplorerItem);
+ if (workspace.isNull() && workspaces.contains(ADS::Constants::DEFAULT_NAME)) {
+ workspace = ADS::Constants::DEFAULT_NAME;
}
- if (openDocumentsWidget) {
- Core::SideBarItem *openDocumentsItem = new Core::SideBarItem(openDocumentsWidget, QLatin1String(SB_OPENDOCUMENTS));
- sideBarItems.append(openDocumentsItem);
- }
+ m_dockManager->openWorkspace(workspace);
- m_leftSideBar.reset(new Core::SideBar(sideBarItems, leftSideBarItems));
- m_rightSideBar.reset(new Core::SideBar(sideBarItems, rightSideBarItems));
+ viewManager().enableWidgets();
+ readSettings();
+ show();
+}
- connect(m_leftSideBar.data(), &Core::SideBar::availableItemsChanged, [=](){
- // event comes from m_leftSidebar, so update right side.
- m_rightSideBar->setUnavailableItemIds(m_leftSideBar->unavailableItemIds());
- });
+void DesignModeWidget::aboutToShowWorkspaces()
+{
+ Core::ActionContainer *aci = Core::ActionManager::actionContainer(QmlDesigner::Constants::M_WINDOW_WORKSPACES);
+ QMenu *menu = aci->menu();
+ menu->clear();
- connect(m_rightSideBar.data(), &Core::SideBar::availableItemsChanged, [=](){
- // event comes from m_rightSidebar, so update left side.
- m_leftSideBar->setUnavailableItemIds(m_rightSideBar->unavailableItemIds());
- });
+ auto *ag = new QActionGroup(menu);
- connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose, [=](){
- m_leftSideBar.reset();
- m_rightSideBar.reset();
+ connect(ag, &QActionGroup::triggered, this, [this](QAction *action) {
+ QString workspace = action->data().toString();
+ m_dockManager->openWorkspace(workspace);
});
- m_toolBar->setToolbarCreationFlags(Core::EditorToolBar::FlagsStandalone);
- m_toolBar->setNavigationVisible(true);
+ QAction *action = menu->addAction("Manage...");
+ connect(action, &QAction::triggered,
+ m_dockManager, &ADS::DockManager::showWorkspaceMananger);
- connect(m_toolBar, &Core::EditorToolBar::goForwardClicked, this, &DesignModeWidget::toolBarOnGoForwardClicked);
- connect(m_toolBar, &Core::EditorToolBar::goBackClicked, this, &DesignModeWidget::toolBarOnGoBackClicked);
+ menu->addSeparator();
- if (currentDesignDocument())
- setupNavigatorHistory(currentDesignDocument()->textEditor());
+ for (const auto &workspace : m_dockManager->workspaces())
+ {
+ QAction *action = ag->addAction(workspace);
+ action->setData(workspace);
+ action->setCheckable(true);
+ if (workspace == m_dockManager->activeWorkspace())
+ action->setChecked(true);
+ }
+ menu->addActions(ag->actions());
+}
- // m_mainSplitter area:
- m_mainSplitter->addWidget(m_leftSideBar.data());
- m_mainSplitter->addWidget(createCenterWidget());
- m_mainSplitter->addWidget(m_rightSideBar.data());
+void DesignModeWidget::createFactoryDefaultWorkspace()
+{
+ ADS::DockAreaWidget* centerArea = nullptr;
+ ADS::DockAreaWidget* leftArea = nullptr;
+ ADS::DockAreaWidget* rightArea = nullptr;
+ ADS::DockAreaWidget* bottomArea = nullptr;
- // Finishing touches:
- m_mainSplitter->setStretchFactor(1, 1);
- m_mainSplitter->setSizes({150, 300, 150});
+ // Iterate over all widgets and only get the central once to start with creating the factory
+ // default workspace layout.
+ for (const WidgetInfo &widgetInfo : viewManager().widgetInfos()) {
+ if (widgetInfo.placementHint == widgetInfo.CentralPane) {
+ ADS::DockWidget *dockWidget = m_dockManager->findDockWidget(widgetInfo.uniqueId);
+ if (centerArea)
+ m_dockManager->addDockWidget(ADS::CenterDockWidgetArea, dockWidget, centerArea);
+ else
+ centerArea = m_dockManager->addDockWidget(ADS::CenterDockWidgetArea, dockWidget);
+ }
+ }
- QLayout *mainLayout = new QBoxLayout(QBoxLayout::RightToLeft, this);
- mainLayout->setContentsMargins(0, 0, 0, 0);
- mainLayout->setSpacing(0);
- mainLayout->addWidget(m_mainSplitter);
+ // Iterate over all widgets and get the remaining left, right and bottom widgets
+ for (const WidgetInfo &widgetInfo : viewManager().widgetInfos()) {
+ if (widgetInfo.placementHint == widgetInfo.LeftPane) {
+ ADS::DockWidget *dockWidget = m_dockManager->findDockWidget(widgetInfo.uniqueId);
+ if (leftArea)
+ m_dockManager->addDockWidget(ADS::CenterDockWidgetArea, dockWidget, leftArea);
+ else
+ leftArea = m_dockManager->addDockWidget(ADS::LeftDockWidgetArea, dockWidget, centerArea);
+ }
- viewManager().enableWidgets();
- m_leftSideBar->setEnabled(true);
- m_rightSideBar->setEnabled(true);
- m_leftSideBar->setCloseWhenEmpty(false);
- m_rightSideBar->setCloseWhenEmpty(false);
+ if (widgetInfo.placementHint == widgetInfo.RightPane) {
+ ADS::DockWidget *dockWidget = m_dockManager->findDockWidget(widgetInfo.uniqueId);
+ if (rightArea)
+ m_dockManager->addDockWidget(ADS::CenterDockWidgetArea, dockWidget, rightArea);
+ else
+ rightArea = m_dockManager->addDockWidget(ADS::RightDockWidgetArea, dockWidget, centerArea);
+ }
- readSettings();
+ if (widgetInfo.placementHint == widgetInfo.BottomPane) {
+ ADS::DockWidget *dockWidget = m_dockManager->findDockWidget(widgetInfo.uniqueId);
+ if (bottomArea)
+ m_dockManager->addDockWidget(ADS::CenterDockWidgetArea, dockWidget, bottomArea);
+ else
+ bottomArea = m_dockManager->addDockWidget(ADS::BottomDockWidgetArea, dockWidget, centerArea);
+ }
+ }
- show();
+ // Iterate over all 'special' widgets
+ QStringList specialWidgets = {"Projects", "FileSystem", "OpenDocuments"};
+ ADS::DockAreaWidget* leftBottomArea = nullptr;
+ for (const QString &uniqueId : specialWidgets) {
+ ADS::DockWidget *dockWidget = m_dockManager->findDockWidget(uniqueId);
+ if (leftBottomArea)
+ m_dockManager->addDockWidget(ADS::CenterDockWidgetArea, dockWidget, leftBottomArea);
+ else
+ leftBottomArea = m_dockManager->addDockWidget(ADS::BottomDockWidgetArea, dockWidget, leftArea);
+ }
+
+ // Add the last widget 'OutputPane' as the bottom bottom area
+ ADS::DockWidget *dockWidget = m_dockManager->findDockWidget("OutputPane");
+ m_dockManager->addDockWidget(ADS::BottomDockWidgetArea, dockWidget, bottomArea);
+
+ // TODO This is just a test
+ auto splitter = centerArea->dockContainer()->rootSplitter();
+ splitter->setSizes({100, 800, 100});
+ // TODO
+
+ m_dockManager->createWorkspace(ADS::Constants::FACTORY_DEFAULT_NAME);
+
+ // Write the xml file
+ Utils::FilePath fileName = m_dockManager->workspaceNameToFileName(ADS::Constants::FACTORY_DEFAULT_NAME);
+ QString errorString;
+ Utils::FileSaver fileSaver(fileName.toString(), QIODevice::Text);
+ QByteArray data = m_dockManager->saveState();
+ if (!fileSaver.hasError()) {
+ fileSaver.write(data);
+ }
+ if (!fileSaver.finalize()) {
+ errorString = fileSaver.errorString();
+ }
}
void DesignModeWidget::toolBarOnGoBackClicked()
@@ -445,93 +575,6 @@ void DesignModeWidget::addNavigatorHistoryEntry(const Utils::FilePath &fileName)
++m_navigatorHistoryCounter;
}
-static QTabWidget *createWidgetsInTabWidget(const QList<WidgetInfo> &widgetInfos)
-{
- auto tabWidget = new QTabWidget;
-
- foreach (const WidgetInfo &widgetInfo, widgetInfos)
- tabWidget->addTab(widgetInfo.widget, widgetInfo.tabName);
-
- return tabWidget;
-}
-
-static QWidget *createbottomSideBarWidget(const QList<WidgetInfo> &widgetInfos)
-{
- //### we now own these here
- QList<WidgetInfo> topWidgetInfos;
- foreach (const WidgetInfo &widgetInfo, widgetInfos) {
- if (widgetInfo.placementHint == widgetInfo.BottomPane)
- topWidgetInfos.append(widgetInfo);
- }
-
- QWidget *widget = topWidgetInfos.constFirst().widget;
- if (topWidgetInfos.count() > 1) {
- QWidget *background = new QWidget();
- background->setProperty("designerBackgroundColor", true);
-
- QString sheet = QString::fromUtf8(Utils::FileReader::fetchQrc(":/qmldesigner/stylesheet.css"));
- sheet.prepend("QWidget[designerBackgroundColor=\"true\"] {background-color: creatorTheme.QmlDesigner_BackgroundColorDarkAlternate;}");
-
- background->setStyleSheet(Theme::replaceCssColors(sheet));
- background->setLayout(new QVBoxLayout);
- background->layout()->setContentsMargins(0, 0, 0, 0);
-
- background->layout()->addWidget(createWidgetsInTabWidget(topWidgetInfos));
- widget = background;
- }
- return widget;
-}
-
-static Core::MiniSplitter *createCentralSplitter(const QList<WidgetInfo> &widgetInfos)
-{
- // editor and output panes
- auto outputPlaceholderSplitter = new Core::MiniSplitter;
- outputPlaceholderSplitter->setOrientation(Qt::Vertical);
-
- auto switchSplitTabWidget = new SwitchSplitTabWidget();
-
- foreach (const WidgetInfo &widgetInfo, widgetInfos) {
- if (widgetInfo.placementHint == widgetInfo.CentralPane)
- switchSplitTabWidget->addTab(widgetInfo.widget, widgetInfo.tabName);
- }
-
- outputPlaceholderSplitter->addWidget(switchSplitTabWidget);
-
- QWidget *bottomSideBar = createbottomSideBarWidget(widgetInfos);
- bottomSideBar->setObjectName("bottomSideBar");
- outputPlaceholderSplitter->addWidget(bottomSideBar);
-
- auto outputPanePlaceholder = new Core::OutputPanePlaceHolder(Core::Constants::MODE_DESIGN, outputPlaceholderSplitter);
- outputPlaceholderSplitter->addWidget(outputPanePlaceholder);
-
- outputPlaceholderSplitter->setStretchFactor(0, 10);
- outputPlaceholderSplitter->setStretchFactor(1, 1);
- return outputPlaceholderSplitter;
-}
-
-QWidget *DesignModeWidget::createCenterWidget()
-{
- QWidget *centerWidget = new QWidget;
-
- auto horizontalLayout = new QVBoxLayout(centerWidget);
- horizontalLayout->setContentsMargins(0, 0, 0, 0);
- horizontalLayout->setSpacing(0);
-
- horizontalLayout->addWidget(m_toolBar);
- horizontalLayout->addWidget(createCrumbleBarFrame());
-
- Core::MiniSplitter *centralSplitter = createCentralSplitter(viewManager().widgetInfos());
- m_centralTabWidget = centralSplitter->findChild<SwitchSplitTabWidget*>();
- Q_ASSERT(m_centralTabWidget);
- m_centralTabWidget->switchTo(viewManager().widget("FormEditor"));
-
- m_bottomSideBar = centralSplitter->findChild<QWidget*>("bottomSideBar");
- Q_ASSERT(m_bottomSideBar);
- horizontalLayout->addWidget(centralSplitter);
-
- return centerWidget;
-}
-
QWidget *DesignModeWidget::createCrumbleBarFrame()
{
auto frame = new Utils::StyledBar(this);
@@ -551,7 +594,9 @@ CrumbleBar *DesignModeWidget::crumbleBar() const
void DesignModeWidget::showInternalTextEditor()
{
- m_centralTabWidget->switchTo(viewManager().widget("TextEditor"));
+ auto dockWidget = m_dockManager->findDockWidget("TextEditor");
+ if (dockWidget)
+ dockWidget->toggleView(true);
}
void DesignModeWidget::contextHelp(const Core::IContext::HelpCallback &callback) const
diff --git a/src/plugins/qmldesigner/designmodewidget.h b/src/plugins/qmldesigner/designmodewidget.h
index b446cdf2e10..113265368c3 100644
--- a/src/plugins/qmldesigner/designmodewidget.h
+++ b/src/plugins/qmldesigner/designmodewidget.h
@@ -32,8 +32,11 @@
#include <modelnode.h>
#include <QWidget>
+#include <QMainWindow>
#include <QScopedPointer>
+#include <advanceddockingsystem/dockmanager.h>
+
namespace Core {
class SideBar;
class SideBarItem;
@@ -53,7 +56,7 @@ namespace Internal {
class DesignMode;
class DocumentWidget;
-class DesignModeWidget : public QWidget
+class DesignModeWidget : public QMainWindow
{
Q_OBJECT
@@ -75,17 +78,17 @@ public:
void enableWidgets();
void disableWidgets();
- void switchTextOrForm();
CrumbleBar* crumbleBar() const;
void showInternalTextEditor();
- void restoreDefaultView();
- void toggleLeftSidebar();
- void toggleRightSidebar();
+ void determineWorkspaceToRestoreAtStartup();
static QWidget *createProjectExplorerWidget(QWidget *parent);
+protected:
+ bool eventFilter(QObject *obj, QEvent *event) override;
+
private: // functions
enum InitializeStatus { NotInitialized, Initializing, Initialized };
@@ -99,12 +102,13 @@ private: // functions
QWidget *createCenterWidget();
QWidget *createCrumbleBarFrame();
+ void aboutToShowWorkspaces();
+
+ void createFactoryDefaultWorkspace();
+
private: // variables
- QSplitter *m_mainSplitter = nullptr;
SwitchSplitTabWidget* m_centralTabWidget = nullptr;
- QScopedPointer<Core::SideBar> m_leftSideBar;
- QScopedPointer<Core::SideBar> m_rightSideBar;
QPointer<QWidget> m_bottomSideBar;
Core::EditorToolBar *m_toolBar;
CrumbleBar *m_crumbleBar;
@@ -118,6 +122,9 @@ private: // variables
bool m_keepNavigatorHistory = false;
QList<QPointer<QWidget> >m_viewWidgets;
+
+ ADS::DockManager *m_dockManager = nullptr;
+ ADS::DockWidget *m_outputPaneDockWidget = nullptr;
};
} // namespace Internal
diff --git a/src/plugins/qmldesigner/openuiqmlfiledialog.cpp b/src/plugins/qmldesigner/openuiqmlfiledialog.cpp
index 545719623fe..bfb49c25c56 100644
--- a/src/plugins/qmldesigner/openuiqmlfiledialog.cpp
+++ b/src/plugins/qmldesigner/openuiqmlfiledialog.cpp
@@ -36,7 +36,6 @@ OpenUiQmlFileDialog::OpenUiQmlFileDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::OpenUiQmlFileDialog)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->setupUi(this);
connect(ui->cancelButton, &QPushButton::clicked, this, &QDialog::close);
diff --git a/src/plugins/qmldesigner/qmldesigner_dependencies.pri b/src/plugins/qmldesigner/qmldesigner_dependencies.pri
index 68b12dc2635..cba0186ce73 100644
--- a/src/plugins/qmldesigner/qmldesigner_dependencies.pri
+++ b/src/plugins/qmldesigner/qmldesigner_dependencies.pri
@@ -2,7 +2,8 @@ QTC_PLUGIN_NAME = QmlDesigner
QTC_LIB_DEPENDS += \
utils \
qmljs \
- qmleditorwidgets
+ qmleditorwidgets \
+ advanceddockingsystem
QTC_PLUGIN_DEPENDS += \
coreplugin \
texteditor \
@@ -22,6 +23,7 @@ INCLUDEPATH *= \
$$PWD/components/componentcore \
$$PWD/components/importmanager \
$$PWD/components/itemlibrary \
+ $$PWD/components/edit3d \
$$PWD/components/formeditor \
$$PWD/components/navigator \
$$PWD/components/stateseditor \
diff --git a/src/plugins/qmldesigner/qmldesignerconstants.h b/src/plugins/qmldesigner/qmldesignerconstants.h
index 82445f4e78b..5dcb014e58f 100644
--- a/src/plugins/qmldesigner/qmldesignerconstants.h
+++ b/src/plugins/qmldesigner/qmldesignerconstants.h
@@ -56,6 +56,9 @@ const char QUICK_3D_ASSET_ICON_DIR[] = "_icons";
const char DEFAULT_ASSET_IMPORT_FOLDER[] = "/asset_imports";
const char QT_QUICK_3D_MODULE_NAME[] = "QtQuick3D";
+// Menus
+const char M_WINDOW_WORKSPACES[] = "QmlDesigner.Menu.Window.Workspaces";
+
namespace Internal {
enum { debug = 0 };
}
diff --git a/src/plugins/qmldesigner/qmldesignericons.h b/src/plugins/qmldesigner/qmldesignericons.h
index 9a16ce2b0c0..840f1ea97c7 100644
--- a/src/plugins/qmldesigner/qmldesignericons.h
+++ b/src/plugins/qmldesigner/qmldesignericons.h
@@ -47,5 +47,36 @@ const Utils::Icon NO_SNAPPING({
const Utils::Icon NO_SNAPPING_AND_ANCHORING({
{QLatin1String(":/icon/layout/snapping_and_anchoring.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_LIGHT_ON({
+ {QLatin1String(":/edit3d/images/edit_light_on.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_LIGHT_OFF({
+ {QLatin1String(":/edit3d/images/edit_light_off.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_SELECTION_MODE_ON({
+ {QLatin1String(":/edit3d/images/group_selection_selected.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_SELECTION_MODE_OFF({
+ {QLatin1String(":/edit3d/images/item_selection_selected.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_MOVE_TOOL_ON({
+ {QLatin1String(":/edit3d/images/move_selected.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_MOVE_TOOL_OFF({
+ {QLatin1String(":/edit3d/images/move_active.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_ROTATE_TOOL_ON({
+ {QLatin1String(":/edit3d/images/rotate_selected.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_ROTATE_TOOL_OFF({
+ {QLatin1String(":/edit3d/images/rotate_active.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_SCALE_TOOL_ON({
+ {QLatin1String(":/edit3d/images/scale_selected.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_SCALE_TOOL_OFF({
+ {QLatin1String(":/edit3d/images/scale_active.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_FIT_SELECTED_OFF({
+ {QLatin1String(":/edit3d/images/fit_active.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_EDIT_CAMERA_ON({
+ {QLatin1String(":/edit3d/images/persp.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_EDIT_CAMERA_OFF({
+ {QLatin1String(":/edit3d/images/ortho.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_ORIENTATION_ON({
+ {QLatin1String(":/edit3d/images/global.png"), Utils::Theme::IconsBaseColor}});
+const Utils::Icon EDIT3D_ORIENTATION_OFF({
+ {QLatin1String(":/edit3d/images/local.png"), Utils::Theme::IconsBaseColor}});
+
} // Icons
} // QmlDesigner
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.pro b/src/plugins/qmldesigner/qmldesignerplugin.pro
index 30c34209377..ea017e3ceff 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.pro
+++ b/src/plugins/qmldesigner/qmldesignerplugin.pro
@@ -13,6 +13,7 @@ include(designercore/designercore-lib.pri)
include(components/componentcore/componentcore.pri)
include(components/integration/integration.pri)
include(components/propertyeditor/propertyeditor.pri)
+include(components/edit3d/edit3d.pri)
include(components/formeditor/formeditor.pri)
include(components/texteditor/texteditor.pri)
include(components/itemlibrary/itemlibrary.pri)
diff --git a/src/plugins/qmldesigner/qmldesignerplugin.qbs b/src/plugins/qmldesigner/qmldesignerplugin.qbs
index 477ebd83888..4bad2b32bed 100644
--- a/src/plugins/qmldesigner/qmldesignerplugin.qbs
+++ b/src/plugins/qmldesigner/qmldesignerplugin.qbs
@@ -15,6 +15,7 @@ Project {
"core-private", "quickwidgets"
]
}
+ Depends { name: "AdvancedDockingSystem" }
Depends { name: "Core" }
Depends { name: "QmlJS" }
Depends { name: "QmlEditorWidgets" }
@@ -50,6 +51,7 @@ Project {
"components/importmanager",
"components/integration",
"components/propertyeditor",
+ "components/edit3d",
"components/formeditor",
"components/itemlibrary",
"components/navigator",
@@ -69,6 +71,7 @@ Project {
cpp.includePaths: base.concat([
product.sourceDirectory,
product.sourceDirectory + "/components/componentcore",
+ product.sourceDirectory + "/components/edit3d",
product.sourceDirectory + "/components/formeditor",
product.sourceDirectory + "/components/integration",
product.sourceDirectory + "/designercore",
@@ -174,12 +177,14 @@ Project {
"commands/drop3dlibraryitemcommand.h",
"commands/update3dviewstatecommand.cpp",
"commands/update3dviewstatecommand.h",
- "commands/enable3dviewcommand.cpp",
- "commands/enable3dviewcommand.h",
"commands/view3dclosedcommand.cpp",
"commands/view3dclosedcommand.h",
"commands/puppettocreatorcommand.cpp",
"commands/puppettocreatorcommand.h",
+ "commands/inputeventcommand.cpp",
+ "commands/inputeventcommand.h",
+ "commands/view3dactioncommand.cpp",
+ "commands/view3dactioncommand.h",
"container/addimportcontainer.cpp",
"container/addimportcontainer.h",
"container/idcontainer.cpp",
@@ -443,6 +448,15 @@ Project {
"debugview/debugviewwidget.cpp",
"debugview/debugviewwidget.h",
"debugview/debugviewwidget.ui",
+ "edit3d/edit3dview.cpp",
+ "edit3d/edit3dview.h",
+ "edit3d/edit3dwidget.cpp",
+ "edit3d/edit3dwidget.h",
+ "edit3d/edit3dcanvas.cpp",
+ "edit3d/edit3dcanvas.h",
+ "edit3d/edit3dactions.cpp",
+ "edit3d/edit3dactions.h",
+ "edit3d/edit3d.qrc",
"formeditor/abstractcustomtool.cpp",
"formeditor/abstractcustomtool.h",
"formeditor/abstractformeditortool.cpp",
diff --git a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo
index a8562bf18ff..61e156f9693 100644
--- a/src/plugins/qmldesigner/qtquickplugin/quick.metainfo
+++ b/src/plugins/qmldesigner/qtquickplugin/quick.metainfo
@@ -284,6 +284,7 @@ MetaInfo {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
+ canBeContainer: false
}
ItemLibraryEntry {
@@ -302,6 +303,7 @@ MetaInfo {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
+ canBeContainer: false
}
ItemLibraryEntry {
@@ -356,6 +358,7 @@ MetaInfo {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
+ canBeContainer: false
}
ItemLibraryEntry {
@@ -374,6 +377,7 @@ MetaInfo {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
+ canBeContainer: false
}
ItemLibraryEntry {
@@ -392,6 +396,7 @@ MetaInfo {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
+ canBeContainer: false
}
ItemLibraryEntry {
@@ -410,6 +415,7 @@ MetaInfo {
visibleInNavigator: true
canBeDroppedInNavigator: true
canBeDroppedInFormEditor: false
+ canBeContainer: false
}
ItemLibraryEntry {
diff --git a/src/plugins/qmldesigner/shortcutmanager.cpp b/src/plugins/qmldesigner/shortcutmanager.cpp
index 45e75194741..d4dac41cf4a 100644
--- a/src/plugins/qmldesigner/shortcutmanager.cpp
+++ b/src/plugins/qmldesigner/shortcutmanager.cpp
@@ -53,7 +53,6 @@
#include "qmldesignerconstants.h"
#include "qmldesignerplugin.h"
-#include "designmodewidget.h"
#include <QApplication>
#include <QClipboard>
@@ -71,10 +70,6 @@ ShortCutManager::ShortCutManager()
m_pasteAction(tr("&Paste")),
m_selectAllAction(tr("Select &All")),
m_collapseExpandStatesAction(tr("Toggle States")),
- m_restoreDefaultViewAction(tr("&Restore Default View")),
- m_toggleLeftSidebarAction(tr("Toggle &Left Sidebar")),
- m_toggleRightSidebarAction(tr("Toggle &Right Sidebar")),
- m_switchTextFormAction(tr("Switch Text/Design")),
m_escapeAction(this)
{
@@ -101,26 +96,6 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
connect(&m_selectAllAction,&QAction::triggered, this, &ShortCutManager::selectAll);
- connect(&m_restoreDefaultViewAction,
- &QAction::triggered,
- QmlDesignerPlugin::instance()->mainWidget(),
- &Internal::DesignModeWidget::restoreDefaultView);
-
- connect(&m_toggleLeftSidebarAction,
- &QAction::triggered,
- QmlDesignerPlugin::instance()->mainWidget(),
- &Internal::DesignModeWidget::toggleLeftSidebar);
-
- connect(&m_toggleRightSidebarAction,
- &QAction::triggered,
- QmlDesignerPlugin::instance()->mainWidget(),
- &Internal::DesignModeWidget::toggleRightSidebar);
-
- connect(&m_switchTextFormAction,
- &QAction::triggered,
- QmlDesignerPlugin::instance()->mainWidget(),
- &Internal::DesignModeWidget::switchTextOrForm);
-
connect(&m_collapseExpandStatesAction, &QAction::triggered, [] {
QmlDesignerPlugin::instance()->viewManager().toggleStatesViewExpanded();
});
@@ -216,21 +191,11 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
Core::ActionContainer *viewsMenu = Core::ActionManager::actionContainer(Core::Constants::M_WINDOW_VIEWS);
- Core::ActionManager::registerAction(&m_toggleLeftSidebarAction, Core::Constants::TOGGLE_LEFT_SIDEBAR, qmlDesignerMainContext);
- Core::ActionManager::registerAction(&m_toggleRightSidebarAction, Core::Constants::TOGGLE_RIGHT_SIDEBAR, qmlDesignerMainContext);
-
command = Core::ActionManager::registerAction(&m_collapseExpandStatesAction, Constants::TOGGLE_STATES_EDITOR, qmlDesignerMainContext);
command->setAttribute(Core::Command::CA_Hide);
command->setDefaultKeySequence(QKeySequence("Ctrl+Alt+s"));
viewsMenu->addAction(command);
- command = Core::ActionManager::registerAction(&m_restoreDefaultViewAction, Constants::RESTORE_DEFAULT_VIEW, qmlDesignerMainContext);
- command->setAttribute(Core::Command::CA_Hide);
- viewsMenu->addAction(command);
-
- command = Core::ActionManager::registerAction(&m_switchTextFormAction, QmlDesigner::Constants::SWITCH_TEXT_DESIGN, qmlDesignerMainContext);
- command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
-
/* Registering disabled action for Escape, because Qt Quick does not support shortcut overrides. */
command = Core::ActionManager::registerAction(&m_escapeAction, Core::Constants::S_RETURNTOEDITOR, qmlDesignerMainContext);
command->setDefaultKeySequence(QKeySequence(Qt::Key_Escape));
@@ -326,16 +291,6 @@ void ShortCutManager::selectAll()
currentDesignDocument()->selectAll();
}
-void ShortCutManager::toggleLeftSidebar()
-{
- QmlDesignerPlugin::instance()->mainWidget()->toggleLeftSidebar();
-}
-
-void ShortCutManager::toggleRightSidebar()
-{
- QmlDesignerPlugin::instance()->mainWidget()->toggleRightSidebar();
-}
-
void ShortCutManager::connectUndoActions(DesignDocument *designDocument)
{
if (designDocument) {
diff --git a/src/plugins/qmldesigner/shortcutmanager.h b/src/plugins/qmldesigner/shortcutmanager.h
index 2d80520a4e7..102448f4307 100644
--- a/src/plugins/qmldesigner/shortcutmanager.h
+++ b/src/plugins/qmldesigner/shortcutmanager.h
@@ -63,8 +63,6 @@ private:
void copySelected();
void paste();
void selectAll();
- void toggleLeftSidebar();
- void toggleRightSidebar();
void undoAvailable(bool isAvailable);
void redoAvailable(bool isAvailable);
void goIntoComponent();
@@ -85,10 +83,6 @@ private:
QAction m_pasteAction;
QAction m_selectAllAction;
QAction m_collapseExpandStatesAction;
- QAction m_restoreDefaultViewAction;
- QAction m_toggleLeftSidebarAction;
- QAction m_toggleRightSidebarAction;
- QAction m_switchTextFormAction;
QAction m_escapeAction;
};
diff --git a/src/plugins/qmldesigner/switchsplittabwidget.cpp b/src/plugins/qmldesigner/switchsplittabwidget.cpp
index 7dea80f164f..e30f4180cfe 100644
--- a/src/plugins/qmldesigner/switchsplittabwidget.cpp
+++ b/src/plugins/qmldesigner/switchsplittabwidget.cpp
@@ -121,25 +121,32 @@ QWidget *SwitchSplitTabWidget::currentWidget() const
void SwitchSplitTabWidget::updateSplitterSizes(int index)
{
- if (isHidden()) {
- // we cannot get the sizes if the splitter is hidden
- m_splittSizesAreDirty = true;
- return;
- }
- QVector<int> splitterSizes = m_splitter->sizes().toVector();
+ QVector<int> splitterSizes(m_splitter->count());
int splitterFullSize = 0;
- for (int size : splitterSizes)
- splitterFullSize += size;
+ bool isHorizontal = m_splitter->orientation() == Qt::Horizontal;
+ for (int i = 0; i < m_splitter->count(); ++i) {
+ auto widget = m_splitter->widget(i);
+ splitterFullSize += isHorizontal ? widget->width() : widget->height();
+ }
+
if (index > -1) {
- // collapse all but not the one at index
+ // collapse all but the one at index
splitterSizes.fill(0);
splitterSizes.replace(index, splitterFullSize);
} else {
- // distribute full size
- splitterSizes.fill(splitterFullSize / splitterSizes.count());
+ // distribute full size among enabled tabs
+ int divisor = splitterSizes.count();
+ for (int i = 0; i < m_splitter->count(); ++i) {
+ if (!m_tabBar->isTabEnabled(i + fakeTab))
+ --divisor;
+ }
+
+ int splitSize = splitterFullSize / divisor;
+ for (int i = 0; i < m_splitter->count(); ++i)
+ splitterSizes.replace(i, m_tabBar->isTabEnabled(i + fakeTab) ? splitSize : 0);
}
+
m_splitter->setSizes(splitterSizes.toList());
- m_splittSizesAreDirty = false;
}
int SwitchSplitTabWidget::addTab(QWidget *w, const QString &label)
@@ -178,18 +185,8 @@ void SwitchSplitTabWidget::switchTo(QWidget *widget)
updateSplitterSizes(widgetIndex);
m_tabBar->setCurrentIndex(widgetIndex + fakeTab);
}
- widget->setFocus();
-}
-bool SwitchSplitTabWidget::event(QEvent *event)
-{
- if (event->type() == QEvent::Show && m_splittSizesAreDirty) {
- bool returnValue = QWidget::event(event);
- updateSplitterSizes(m_tabBar->currentIndex() - fakeTab);
- return returnValue;
- }
-
- return QWidget::event(event);
+ widget->setFocus();
}
void SwitchSplitTabWidget::updateSplitButtons()
@@ -203,14 +200,13 @@ void SwitchSplitTabWidget::selectFakeTab()
m_tabBar->setCurrentIndex(0);
}
-SwitchSplitTabWidget::Mode SwitchSplitTabWidget::mode()
+SwitchSplitTabWidget::Mode SwitchSplitTabWidget::mode() const
{
const bool isTabBarNecessary = count() > 1;
const int fakeTabPosition = 0;
const int hasSelectedTab = m_tabBar->currentIndex() > fakeTabPosition;
- if (isTabBarNecessary && !hasSelectedTab)
- return SplitMode;
- return TabMode;
+ // Note: When splitting the view by dragging from the side of the view, SplitMode is not detected
+ return (isTabBarNecessary && !hasSelectedTab) ? SplitMode : TabMode;
}
} // namespace QmlDesigner
diff --git a/src/plugins/qmldesigner/switchsplittabwidget.h b/src/plugins/qmldesigner/switchsplittabwidget.h
index 3bd19f393e9..72c5cc3e5e8 100644
--- a/src/plugins/qmldesigner/switchsplittabwidget.h
+++ b/src/plugins/qmldesigner/switchsplittabwidget.h
@@ -37,10 +37,9 @@ namespace QmlDesigner {
class SwitchSplitTabWidget : public QWidget
{
Q_OBJECT
- enum Mode {
- SplitMode,
- TabMode
- };
+
+ enum Mode { SplitMode, TabMode };
+
public:
explicit SwitchSplitTabWidget(QWidget *parent = nullptr);
int count() const;
@@ -50,19 +49,15 @@ public:
QWidget *takeTabWidget(const int index);
void switchTo(QWidget *widget);
-protected:
- bool event(QEvent* event) override;
-
private:
void updateSplitterSizes(int index = -1);
void updateSplitButtons();
void selectFakeTab();
- Mode mode();
+ Mode mode() const;
QSplitter *m_splitter = nullptr;
QTabBar *m_tabBar = nullptr;
QWidget *m_tabBarBackground = nullptr;
const int fakeTab = 1;
- bool m_splittSizesAreDirty = true;
};
} // namespace QmlDesigner
diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
index 034c1b13017..e3b169f46dd 100644
--- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
+++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
@@ -610,7 +610,7 @@ void SemanticHighlighter::reportMessagesInfo(const QVector<QTextLayout::FormatRa
// but will use them only after a signal sent by that same thread, maybe we should transfer
// them more explicitly
m_extraFormats = formats;
- m_extraFormats.unite(m_formats);
+ Utils::addToHash(&m_extraFormats, m_formats);
m_diagnosticRanges = diagnosticRanges;
}
diff --git a/src/plugins/qmlprofiler/flamegraphmodel.cpp b/src/plugins/qmlprofiler/flamegraphmodel.cpp
index 5673f2fbc3d..590932c1c44 100644
--- a/src/plugins/qmlprofiler/flamegraphmodel.cpp
+++ b/src/plugins/qmlprofiler/flamegraphmodel.cpp
@@ -312,7 +312,7 @@ QVariant FlameGraphModel::data(const QModelIndex &index, int role) const
QHash<int, QByteArray> FlameGraphModel::roleNames() const
{
- static QHash<int, QByteArray> extraRoles{
+ static const QHash<int, QByteArray> extraRoles{
{TypeIdRole, "typeId"},
{TypeRole, "type"},
{DurationRole, "duration"},
@@ -328,7 +328,9 @@ QHash<int, QByteArray> FlameGraphModel::roleNames() const
{AllocationsRole, "allocations" },
{MemoryRole, "memory" }
};
- return QAbstractItemModel::roleNames().unite(extraRoles);
+ QHash<int, QByteArray> roles = QAbstractItemModel::roleNames();
+ Utils::addToHash(&roles, extraRoles);
+ return roles;
}
QmlProfilerModelManager *FlameGraphModel::modelManager() const
diff --git a/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp b/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp
index 43b1d500a0b..1762c4a85c6 100644
--- a/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerattachdialog.cpp
@@ -51,7 +51,6 @@ QmlProfilerAttachDialog::QmlProfilerAttachDialog(QWidget *parent) :
QDialog(parent),
d(new QmlProfilerAttachDialogPrivate)
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setWindowTitle(tr("Start QML Profiler"));
d->kitChooser = new KitChooser(this);
diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp
index f62c7c1294e..1ad4bb0590c 100644
--- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp
+++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp
@@ -101,6 +101,10 @@ QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fi
if (targetDirectoryPropery.isValid())
projectItem->setTargetDirectory(targetDirectoryPropery.toString());
+ const QVariant qtForMCUProperty = rootNode->property("qtForMCUs");
+ if (qtForMCUProperty.isValid() && qtForMCUProperty.toBool())
+ projectItem->setQtForMCUs(targetDirectoryPropery.toBool());
+
if (debug)
qDebug() << "importPath:" << importPathsProperty << "mainFile:" << mainFileProperty;
diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp
index b36938b9f22..34f0591b178 100644
--- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp
+++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.cpp
@@ -55,6 +55,11 @@ void QmlProjectItem::setTargetDirectory(const QString &directoryPath)
m_targetDirectory = directoryPath;
}
+void QmlProjectItem::setQtForMCUs(bool b)
+{
+ m_qtForMCUs = b;
+}
+
void QmlProjectItem::setImportPaths(const QStringList &importPaths)
{
if (m_importPaths != importPaths)
diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h
index 5245e3872cf..68dfe6d55d3 100644
--- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h
+++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectitem.h
@@ -51,6 +51,9 @@ public:
QString targetDirectory() const { return m_targetDirectory; }
void setTargetDirectory(const QString &directoryPath);
+ bool qtForMCUs() const { return m_qtForMCUs; }
+ void setQtForMCUs(bool qtForMCUs);
+
QStringList importPaths() const { return m_importPaths; }
void setImportPaths(const QStringList &paths);
@@ -83,6 +86,7 @@ protected:
Utils::EnvironmentItems m_environment;
QVector<QmlProjectContentItem *> m_content; // content property
bool m_forceFreeType = false;
+ bool m_qtForMCUs = false;
};
} // namespace QmlProjectManager
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp
index 6d93305e6d7..fc622179cae 100644
--- a/src/plugins/qmlprojectmanager/qmlproject.cpp
+++ b/src/plugins/qmlprojectmanager/qmlproject.cpp
@@ -205,6 +205,13 @@ QString QmlBuildSystem::mainFile() const
return QString();
}
+bool QmlBuildSystem::qtForMCUs() const
+{
+ if (m_projectItem)
+ return m_projectItem.data()->qtForMCUs();
+ return false;
+}
+
void QmlBuildSystem::setMainFile(const QString &mainFilePath)
{
if (m_projectItem)
@@ -393,6 +400,8 @@ QVariant QmlBuildSystem::additionalData(Id id) const
return customFileSelectors();
if (id == Constants::customForceFreeTypeData)
return forceFreeType();
+ if (id == Constants::customQtForMCUs)
+ return qtForMCUs();
return {};
}
diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h
index b1b4c6bd536..0cff1528984 100644
--- a/src/plugins/qmlprojectmanager/qmlproject.h
+++ b/src/plugins/qmlprojectmanager/qmlproject.h
@@ -76,6 +76,7 @@ public:
Utils::FilePath canonicalProjectDir() const;
QString mainFile() const;
+ bool qtForMCUs() const;
void setMainFile(const QString &mainFilePath);
Utils::FilePath targetDirectory() const;
Utils::FilePath targetFile(const Utils::FilePath &sourceFile) const;
diff --git a/src/plugins/qmlprojectmanager/qmlprojectconstants.h b/src/plugins/qmlprojectmanager/qmlprojectconstants.h
index ecf39bc32ca..10d3bafc692 100644
--- a/src/plugins/qmlprojectmanager/qmlprojectconstants.h
+++ b/src/plugins/qmlprojectmanager/qmlprojectconstants.h
@@ -33,6 +33,7 @@ namespace Constants {
const char * const QMLPROJECT_MIMETYPE = QmlJSTools::Constants::QMLPROJECT_MIMETYPE;
const char customFileSelectorsData[] = "CustomFileSelectorsData";
const char customForceFreeTypeData[] = "CustomForceFreeType";
+const char customQtForMCUs[] = "CustomQtForMCUs";
} // namespace Constants
} // namespace QmlProjectManager
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index 6b2ecd88683..4643eb9aeb1 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -485,6 +485,12 @@ QSet<Id> BaseQtVersion::availableFeatures() const
if (qtVersion().matches(5, 14))
return features;
+ features.unite(versionedIds(Constants::FEATURE_QT_QUICK_PREFIX, 2, 15));
+ features.unite(versionedIds(Constants::FEATURE_QT_QUICK_CONTROLS_2_PREFIX, 2, 15));
+
+ if (qtVersion().matches(5, 15))
+ return features;
+
return features;
}
diff --git a/src/plugins/studiowelcome/CMakeLists.txt b/src/plugins/studiowelcome/CMakeLists.txt
index 217e5f7de47..c82b4fa2361 100644
--- a/src/plugins/studiowelcome/CMakeLists.txt
+++ b/src/plugins/studiowelcome/CMakeLists.txt
@@ -1,11 +1,20 @@
+set(qmlQrcFile "${CMAKE_CURRENT_BINARY_DIR}/StudioWelcome_qml.qrc")
+
+qtc_glob_resources(
+ QRC_FILE "${qmlQrcFile}"
+ ROOT "${CMAKE_CURRENT_SOURCE_DIR}"
+ GLOB "qml/*"
+)
+
add_qtc_plugin(StudioWelcome
DEPENDS Qt5::QuickWidgets
PLUGIN_DEPENDS Core ProjectExplorer QtSupport
- DEFINES STUDIO_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/qml"
+ DEFINES STUDIO_QML_PATH="${CMAKE_CURRENT_SOURCE_DIR}/qml/"
SOURCES
studiowelcomeplugin.cpp studiowelcomeplugin.h
studiowelcome_global.h
studiowelcome.qrc
+ ${qmlQrcFile}
"${PROJECT_SOURCE_DIR}/src/share/3rdparty/studiofonts/studiofonts.qrc"
EXTRA_TRANSLATIONS
qml
diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp
index cb48da5daaf..5b6b819615e 100644
--- a/src/plugins/subversion/subversioneditor.cpp
+++ b/src/plugins/subversion/subversioneditor.cpp
@@ -34,7 +34,6 @@
#include <QDebug>
#include <QFileInfo>
-#include <QRegExp>
#include <QTextCursor>
#include <QTextBlock>
@@ -42,8 +41,8 @@ using namespace Subversion;
using namespace Subversion::Internal;
SubversionEditorWidget::SubversionEditorWidget() :
- m_changeNumberPattern(QLatin1String("^\\s*(?<area>(?<rev>\\d+))\\s+.*$")),
- m_revisionNumberPattern(QLatin1String("\\b(?<area>(r|[rR]evision )(?<rev>\\d+))\\b"))
+ m_changeNumberPattern("^\\s*(?<area>(?<rev>\\d+))\\s+.*$"),
+ m_revisionNumberPattern("\\b(?<area>(r|[rR]evision )(?<rev>\\d+))\\b")
{
QTC_ASSERT(m_changeNumberPattern.isValid(), return);
QTC_ASSERT(m_revisionNumberPattern.isValid(), return);
@@ -56,33 +55,10 @@ SubversionEditorWidget::SubversionEditorWidget() :
@@ -6,6 +6,5 @@
\endcode
*/
- setDiffFilePattern(QRegExp(QLatin1String("^[-+]{3} ([^\\t]+)|^Index: .*|^=+$")));
- setLogEntryPattern(QRegExp(QLatin1String("^(r\\d+) \\|")));
+ setDiffFilePattern("^[-+]{3} ([^\\t]+)|^Index: .*|^=+$");
+ setLogEntryPattern("^(r\\d+) \\|");
setAnnotateRevisionTextFormat(tr("Annotate revision \"%1\""));
-}
-
-QSet<QString> SubversionEditorWidget::annotationChanges() const
-{
- QSet<QString> changes;
- const QString txt = toPlainText();
- if (txt.isEmpty())
- return changes;
- // Hunt for first change number in annotation: "<change>:"
- QRegExp r(QLatin1String("^(\\d+):"));
- QTC_ASSERT(r.isValid(), return changes);
- if (r.indexIn(txt) != -1) {
- changes.insert(r.cap(1));
- r.setPattern(QLatin1String("\n(\\d+):"));
- QTC_ASSERT(r.isValid(), return changes);
- int pos = 0;
- while ((pos = r.indexIn(txt, pos)) != -1) {
- pos += r.matchedLength();
- changes.insert(r.cap(1));
- }
- }
- if (Subversion::Constants::debug)
- qDebug() << "SubversionEditor::annotationChanges() returns #" << changes.size();
- return changes;
+ setAnnotationEntryPattern("^(\\d+):");
}
QString SubversionEditorWidget::changeUnderCursor(const QTextCursor &c) const
diff --git a/src/plugins/subversion/subversioneditor.h b/src/plugins/subversion/subversioneditor.h
index 6b2446ffdea..a7b44f66b9a 100644
--- a/src/plugins/subversion/subversioneditor.h
+++ b/src/plugins/subversion/subversioneditor.h
@@ -40,7 +40,6 @@ public:
SubversionEditorWidget();
private:
- QSet<QString> annotationChanges() const override;
QString changeUnderCursor(const QTextCursor &) const override;
VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(
const QSet<QString> &changes) const override;
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index 38526b4b7b4..f8a65cb9fe0 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -995,7 +995,6 @@ void SubversionPluginPrivate::slotDescribe()
QTC_ASSERT(state.hasTopLevel(), return);
QInputDialog inputDialog(ICore::dialogParent());
- inputDialog.setWindowFlags(inputDialog.windowFlags() & ~Qt::WindowContextHelpButtonHint);
inputDialog.setInputMode(QInputDialog::IntInput);
inputDialog.setIntRange(1, INT_MAX);
inputDialog.setWindowTitle(tr("Describe"));
diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp
index a29019a245d..b1154896745 100644
--- a/src/plugins/texteditor/codeassist/codeassistant.cpp
+++ b/src/plugins/texteditor/codeassist/codeassistant.cpp
@@ -288,6 +288,8 @@ void CodeAssistantPrivate::cancelCurrentRequest()
m_requestRunner->setDiscardProposal(true);
disconnect(m_runnerConnection);
}
+ if (m_asyncProcessor)
+ m_asyncProcessor->cancel();
invalidateCurrentRequestData();
}
diff --git a/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp b/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp
index 50a04ba88fc..8558e9c392f 100644
--- a/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp
+++ b/src/plugins/texteditor/codeassist/documentcontentcompletion.cpp
@@ -43,14 +43,15 @@
using namespace TextEditor;
-class DocumentContentCompletionProcessor : public IAssistProcessor
+class DocumentContentCompletionProcessor final : public IAssistProcessor
{
public:
DocumentContentCompletionProcessor(const QString &snippetGroupId);
- ~DocumentContentCompletionProcessor() override;
+ ~DocumentContentCompletionProcessor() final;
IAssistProposal *perform(const AssistInterface *interface) override;
bool running() final { return m_watcher.isRunning(); }
+ void cancel() final;
private:
QString m_snippetGroup;
@@ -77,8 +78,7 @@ DocumentContentCompletionProcessor::DocumentContentCompletionProcessor(const QSt
DocumentContentCompletionProcessor::~DocumentContentCompletionProcessor()
{
- if (m_watcher.isRunning())
- m_watcher.cancel();
+ cancel();
}
static void createProposal(QFutureInterface<QStringList> &future, const QString &text,
@@ -149,3 +149,9 @@ IAssistProposal *DocumentContentCompletionProcessor::perform(const AssistInterfa
});
return nullptr;
}
+
+void DocumentContentCompletionProcessor::cancel()
+{
+ if (running())
+ m_watcher.cancel();
+}
diff --git a/src/plugins/texteditor/codeassist/iassistprocessor.h b/src/plugins/texteditor/codeassist/iassistprocessor.h
index 6ed29b66f11..3658e97ad0e 100644
--- a/src/plugins/texteditor/codeassist/iassistprocessor.h
+++ b/src/plugins/texteditor/codeassist/iassistprocessor.h
@@ -51,6 +51,7 @@ public:
virtual bool running() { return false; }
virtual bool needsRestart() const { return false; }
+ virtual void cancel() {}
private:
AsyncCompletionsAvailableHandler m_asyncCompletionsAvailableHandler;
diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp
index 361419db7fb..e90af4d627f 100644
--- a/src/plugins/texteditor/texteditor.cpp
+++ b/src/plugins/texteditor/texteditor.cpp
@@ -5472,7 +5472,7 @@ void TextEditorWidget::mouseMoveEvent(QMouseEvent *e)
column += (e->pos().x() - cursorRect().center().x()) / QFontMetricsF(font()).horizontalAdvance(QLatin1Char(' '));
d->m_blockSelection.positionBlock = cursor.blockNumber();
- d->m_blockSelection.positionColumn = column;
+ d->m_blockSelection.positionColumn = qMax(0, column);
doSetTextCursor(d->m_blockSelection.selection(d->m_document.data()), true);
viewport()->update();
@@ -7166,7 +7166,7 @@ void TextEditorWidget::rewrapParagraph()
QString currentWord;
for (const QChar &ch : qAsConst(selectedText)) {
- if (ch.isSpace()) {
+ if (ch.isSpace() && ch != QChar::Nbsp) {
if (!currentWord.isEmpty()) {
currentLength += currentWord.length() + 1;
@@ -8055,12 +8055,12 @@ QTextCursor TextBlockSelection::cursor(const TextDocument *baseTextDocument,
}
void TextBlockSelection::fromPostition(int positionBlock, int positionColumn,
- int anchorBlock, int anchorColumn)
+ int anchorBlock, int anchorColumn)
{
- this->positionBlock = positionBlock;
- this->positionColumn = positionColumn;
- this->anchorBlock = anchorBlock;
- this->anchorColumn = anchorColumn;
+ this->positionBlock = QTC_GUARD(positionBlock >= 0) ? positionBlock : 0;
+ this->positionColumn = QTC_GUARD(positionColumn >= 0) ? positionColumn : 0;
+ this->anchorBlock = QTC_GUARD(anchorBlock >= 0) ? anchorBlock : 0;
+ this->anchorColumn = QTC_GUARD(anchorColumn >= 0) ? anchorColumn : 0;
}
bool TextEditorWidget::inFindScope(const QTextCursor &cursor)
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index 713d54187f9..64475eba242 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -1338,9 +1338,6 @@ HeobDialog::HeobDialog(QWidget *parent) :
m_profileDeleteButton->setEnabled(m_profilesCombo->count() > 1);
setWindowTitle(tr("Heob"));
-
- // disable context help button
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
}
QString HeobDialog::arguments() const
diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp
index 95495d8ba3d..0f358ab1de0 100644
--- a/src/plugins/vcsbase/cleandialog.cpp
+++ b/src/plugins/vcsbase/cleandialog.cpp
@@ -145,7 +145,6 @@ CleanDialog::CleanDialog(QWidget *parent) :
d(new Internal::CleanDialogPrivate)
{
setModal(true);
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
d->ui.setupUi(this);
d->ui.buttonBox->addButton(tr("Delete..."), QDialogButtonBox::AcceptRole);
diff --git a/src/plugins/vcsbase/diffandloghighlighter.cpp b/src/plugins/vcsbase/diffandloghighlighter.cpp
index afdc72cc678..a2f0836f35b 100644
--- a/src/plugins/vcsbase/diffandloghighlighter.cpp
+++ b/src/plugins/vcsbase/diffandloghighlighter.cpp
@@ -30,7 +30,7 @@
#include <utils/qtcassert.h>
#include <QDebug>
-#include <QRegExp>
+#include <QRegularExpression>
/*!
\class VcsBase::DiffAndLogHighlighter
@@ -88,8 +88,9 @@ static inline QTextCharFormat invertedColorFormat(const QTextCharFormat &in)
class DiffAndLogHighlighterPrivate
{
public:
- DiffAndLogHighlighterPrivate(DiffAndLogHighlighter *q_, const QRegExp &filePattern,
- const QRegExp &changePattern) :
+ DiffAndLogHighlighterPrivate(DiffAndLogHighlighter *q_,
+ const QRegularExpression &filePattern,
+ const QRegularExpression &changePattern) :
q(q_),
m_filePattern(filePattern),
m_changePattern(changePattern),
@@ -106,8 +107,8 @@ public:
DiffAndLogHighlighter *const q;
- mutable QRegExp m_filePattern;
- mutable QRegExp m_changePattern;
+ const QRegularExpression m_filePattern;
+ const QRegularExpression m_changePattern;
const QString m_locationIndicator;
const QChar m_diffInIndicator;
const QChar m_diffOutIndicator;
@@ -120,9 +121,9 @@ TextEditor::TextStyle DiffAndLogHighlighterPrivate::analyzeLine(const QString &t
{
// Do not match on git "--- a/" as a deleted line, check
// file first
- if (m_filePattern.indexIn(text) == 0)
+ if (m_filePattern.match(text).capturedStart() == 0)
return TextEditor::C_DIFF_FILE;
- if (m_changePattern.indexIn(text) == 0)
+ if (m_changePattern.match(text).capturedStart() == 0)
return TextEditor::C_LOG_CHANGE_LINE;
if (text.startsWith(m_diffInIndicator))
return TextEditor::C_ADDED_LINE;
@@ -141,7 +142,8 @@ void DiffAndLogHighlighterPrivate::updateOtherFormats()
}
// --- DiffAndLogHighlighter
-DiffAndLogHighlighter::DiffAndLogHighlighter(const QRegExp &filePattern, const QRegExp &changePattern) :
+DiffAndLogHighlighter::DiffAndLogHighlighter(const QRegularExpression &filePattern,
+ const QRegularExpression &changePattern) :
TextEditor::SyntaxHighlighter(static_cast<QTextDocument *>(nullptr)),
d(new DiffAndLogHighlighterPrivate(this, filePattern, changePattern))
{
diff --git a/src/plugins/vcsbase/diffandloghighlighter.h b/src/plugins/vcsbase/diffandloghighlighter.h
index 3847f287ba2..c43f4a510d7 100644
--- a/src/plugins/vcsbase/diffandloghighlighter.h
+++ b/src/plugins/vcsbase/diffandloghighlighter.h
@@ -30,7 +30,7 @@
#include <texteditor/syntaxhighlighter.h>
QT_BEGIN_NAMESPACE
-class QRegExp;
+class QRegularExpression;
class QTextCharFormat;
QT_END_NAMESPACE
@@ -45,7 +45,8 @@ class VCSBASE_EXPORT DiffAndLogHighlighter : public TextEditor::SyntaxHighlighte
Q_OBJECT
public:
- explicit DiffAndLogHighlighter(const QRegExp &filePattern, const QRegExp &changePattern);
+ explicit DiffAndLogHighlighter(const QRegularExpression &filePattern,
+ const QRegularExpression &changePattern);
~DiffAndLogHighlighter() override;
void highlightBlock(const QString &text) override;
diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp
index 11737ec08ba..799ef29faf0 100644
--- a/src/plugins/vcsbase/nicknamedialog.cpp
+++ b/src/plugins/vcsbase/nicknamedialog.cpp
@@ -169,7 +169,6 @@ NickNameDialog::NickNameDialog(QStandardItemModel *model, QWidget *parent) :
m_model(model),
m_filterModel(new QSortFilterProxyModel(this))
{
- setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->setupUi(this);
okButton()->setEnabled(false);
diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp
index 0471968dcfd..aac8696c0e0 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.cpp
+++ b/src/plugins/vcsbase/vcsbaseeditor.cpp
@@ -50,7 +50,7 @@
#include <QDebug>
#include <QFileInfo>
#include <QFile>
-#include <QRegExp>
+#include <QRegularExpression>
#include <QSet>
#include <QTextCodec>
#include <QUrl>
@@ -402,7 +402,7 @@ private:
};
UrlData m_urlData;
- QRegExp m_pattern;
+ QRegularExpression m_pattern;
};
UrlTextCursorHandler::UrlTextCursorHandler(VcsBaseEditorWidget *editorWidget)
@@ -424,16 +424,17 @@ bool UrlTextCursorHandler::findContentsUnderCursor(const QTextCursor &cursor)
const QString line = cursorForUrl.selectedText();
const int cursorCol = cursor.columnNumber();
int urlMatchIndex = -1;
- do {
- urlMatchIndex = m_pattern.indexIn(line, urlMatchIndex + 1);
- if (urlMatchIndex != -1) {
- const QString url = m_pattern.cap(0);
- if (urlMatchIndex <= cursorCol && cursorCol <= urlMatchIndex + url.length()) {
- m_urlData.startColumn = urlMatchIndex;
- m_urlData.url = url;
- }
+ QRegularExpressionMatchIterator i = m_pattern.globalMatch(line);
+ while (i.hasNext()) {
+ const QRegularExpressionMatch match = i.next();
+ urlMatchIndex = match.capturedStart();
+ const QString url = match.captured(0);
+ if (urlMatchIndex <= cursorCol && cursorCol <= urlMatchIndex + url.length()) {
+ m_urlData.startColumn = urlMatchIndex;
+ m_urlData.url = url;
+ break;
}
- } while (urlMatchIndex != -1 && m_urlData.startColumn == -1);
+ };
}
return m_urlData.startColumn != -1;
@@ -474,7 +475,7 @@ QString UrlTextCursorHandler::currentContents() const
void UrlTextCursorHandler::setUrlPattern(const QString &pattern)
{
- m_pattern = QRegExp(pattern);
+ m_pattern = QRegularExpression(pattern);
QTC_ASSERT(m_pattern.isValid(), return);
}
@@ -554,8 +555,10 @@ public:
QString m_workingDirectory;
- QRegExp m_diffFilePattern;
- QRegExp m_logEntryPattern;
+ QRegularExpression m_diffFilePattern;
+ QRegularExpression m_logEntryPattern;
+ QRegularExpression m_annotationEntryPattern;
+ QRegularExpression m_annotationSeparatorPattern;
QList<int> m_entrySections; // line number where this section starts
int m_cursorLine = -1;
int m_firstLineNumber = -1;
@@ -649,16 +652,34 @@ void VcsBaseEditorWidget::setParameters(const VcsBaseEditorParameters *parameter
d->m_parameters = parameters;
}
-void VcsBaseEditorWidget::setDiffFilePattern(const QRegExp &pattern)
+static void regexpFromString(
+ const QString &pattern,
+ QRegularExpression *regexp,
+ QRegularExpression::PatternOptions options = QRegularExpression::NoPatternOption)
+{
+ const QRegularExpression re(pattern, options);
+ QTC_ASSERT(re.isValid() && re.captureCount() >= 1, return);
+ *regexp = re;
+}
+
+void VcsBaseEditorWidget::setDiffFilePattern(const QString &pattern)
{
- QTC_ASSERT(pattern.isValid() && pattern.captureCount() >= 1, return);
- d->m_diffFilePattern = pattern;
+ regexpFromString(pattern, &d->m_diffFilePattern);
}
-void VcsBaseEditorWidget::setLogEntryPattern(const QRegExp &pattern)
+void VcsBaseEditorWidget::setLogEntryPattern(const QString &pattern)
{
- QTC_ASSERT(pattern.isValid() && pattern.captureCount() >= 1, return);
- d->m_logEntryPattern = pattern;
+ regexpFromString(pattern, &d->m_logEntryPattern);
+}
+
+void VcsBaseEditorWidget::setAnnotationEntryPattern(const QString &pattern)
+{
+ regexpFromString(pattern, &d->m_annotationEntryPattern, QRegularExpression::MultilineOption);
+}
+
+void VcsBaseEditorWidget::setAnnotationSeparatorPattern(const QString &pattern)
+{
+ regexpFromString(pattern, &d->m_annotationSeparatorPattern);
}
bool VcsBaseEditorWidget::supportChangeLinks() const
@@ -864,7 +885,7 @@ void VcsBaseEditorWidget::slotPopulateDiffBrowser()
for (QTextBlock it = document()->begin(); it != cend; it = it.next(), lineNumber++) {
const QString text = it.text();
// Check for a new diff section (not repeating the last filename)
- if (d->m_diffFilePattern.indexIn(text) == 0) {
+ if (d->m_diffFilePattern.match(text).capturedStart() == 0) {
const QString file = fileNameFromDiffSpecification(it);
if (!file.isEmpty() && lastFileName != file) {
lastFileName = file;
@@ -888,9 +909,10 @@ void VcsBaseEditorWidget::slotPopulateLogBrowser()
for (QTextBlock it = document()->begin(); it != cend; it = it.next(), lineNumber++) {
const QString text = it.text();
// Check for a new log section (not repeating the last filename)
- if (d->m_logEntryPattern.indexIn(text) != -1) {
+ const QRegularExpressionMatch match = d->m_logEntryPattern.match(text);
+ if (match.hasMatch()) {
d->m_entrySections.push_back(d->m_entrySections.empty() ? 0 : lineNumber);
- QString entry = d->m_logEntryPattern.cap(1);
+ QString entry = match.captured(1);
QString subject = revisionSubject(it);
if (!subject.isEmpty()) {
if (subject.length() > 100) {
@@ -1198,7 +1220,8 @@ DiffChunk VcsBaseEditorWidget::diffChunk(QTextCursor cursor) const
unicode.append(QLatin1Char('\n'));
for (block = block.next() ; block.isValid() ; block = block.next()) {
const QString line = block.text();
- if (checkChunkLine(line, &chunkStart) || d->m_diffFilePattern.indexIn(line) == 0) {
+ if (checkChunkLine(line, &chunkStart)
+ || d->m_diffFilePattern.match(line).capturedStart() == 0) {
break;
} else {
unicode += line;
@@ -1518,8 +1541,9 @@ QString VcsBaseEditorWidget::fileNameFromDiffSpecification(const QTextBlock &inB
QString fileName;
for (QTextBlock block = inBlock; block.isValid(); block = block.previous()) {
const QString line = block.text();
- if (d->m_diffFilePattern.indexIn(line) != -1) {
- QString cap = d->m_diffFilePattern.cap(1);
+ const QRegularExpressionMatch match = d->m_diffFilePattern.match(line);
+ if (match.hasMatch()) {
+ QString cap = match.captured(1);
if (header)
header->prepend(line + QLatin1String("\n"));
if (fileName.isEmpty() && !cap.isEmpty())
@@ -1537,6 +1561,26 @@ void VcsBaseEditorWidget::addChangeActions(QMenu *, const QString &)
{
}
+QSet<QString> VcsBaseEditorWidget::annotationChanges() const
+{
+ QSet<QString> changes;
+ QString text = toPlainText();
+ QStringRef txt(&text);
+ if (txt.isEmpty())
+ return changes;
+ if (!d->m_annotationSeparatorPattern.pattern().isEmpty()) {
+ const QRegularExpressionMatch match = d->m_annotationSeparatorPattern.match(txt);
+ if (match.hasMatch())
+ txt.truncate(match.capturedStart());
+ }
+ QRegularExpressionMatchIterator i = d->m_annotationEntryPattern.globalMatch(txt);
+ while (i.hasNext()) {
+ const QRegularExpressionMatch match = i.next();
+ changes.insert(match.captured(1));
+ }
+ return changes;
+}
+
QString VcsBaseEditorWidget::decorateVersion(const QString &revision) const
{
return revision;
diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h
index 863d300d62f..6e32037b680 100644
--- a/src/plugins/vcsbase/vcsbaseeditor.h
+++ b/src/plugins/vcsbase/vcsbaseeditor.h
@@ -32,7 +32,6 @@
#include <QSet>
QT_BEGIN_NAMESPACE
-class QRegExp;
class QTextCodec;
class QTextCursor;
QT_END_NAMESPACE
@@ -145,9 +144,13 @@ protected:
// virtual functions).
VcsBaseEditorWidget();
// Pattern for diff header. File name must be in the first capture group
- void setDiffFilePattern(const QRegExp &pattern);
+ void setDiffFilePattern(const QString &pattern);
// Pattern for log entry. hash/revision number must be in the first capture group
- void setLogEntryPattern(const QRegExp &pattern);
+ void setLogEntryPattern(const QString &pattern);
+ // Pattern for annotation entry. hash/revision number must be in the first capture group
+ void setAnnotationEntryPattern(const QString &pattern);
+ // Pattern for annotation separator. Lookup will stop on match.
+ void setAnnotationSeparatorPattern(const QString &pattern);
virtual bool supportChangeLinks() const;
virtual QString fileNameForLine(int line) const;
@@ -246,7 +249,7 @@ protected:
// Implement to return a set of change identifiers in
// annotation mode
- virtual QSet<QString> annotationChanges() const = 0;
+ QSet<QString> annotationChanges() const;
// Implement to identify a change number at the cursor position
virtual QString changeUnderCursor(const QTextCursor &) const = 0;
// Factory functions for highlighters
diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
index 3dec0aeaefe..fa0e19928d7 100644
--- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
+++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp
@@ -163,6 +163,7 @@ VcsBaseSubmitEditorPrivate::VcsBaseSubmitEditorPrivate(SubmitEditorWidget *edito
VcsBaseSubmitEditor::VcsBaseSubmitEditor(SubmitEditorWidget *editorWidget)
{
+ setWidget(editorWidget);
d = new VcsBaseSubmitEditorPrivate(editorWidget, this);
}