Merge remote-tracking branch 'origin/4.10'

Conflicts:
	src/plugins/python/CMakeLists.txt

Change-Id: I18808710dd99b97d4e1e7c3d223b7f814083de31
This commit is contained in:
Eike Ziller
2019-08-12 17:04:12 +02:00
29 changed files with 99 additions and 40 deletions

View File

@@ -121,10 +121,14 @@ you can check out from the public Git repository. For example:
## Debugging
* Added pretty printer for `QMargin`
* Fixed pretty printer for `std::vector` and `std::basic_string` with custom allocator
* Fixed pretty printer for `std::map<K,V>::iterator`
* Fixed pretty printers for `QFile`, `QStandardItem`,
`std::vector` and `std::basic_string` with custom allocator, and `std::map<K,V>::iterator`
* Fixed issues with restoring layout (QTCREATORBUG-21669)
### LLDB
* Fixed running with command line arguments with spaces (QTCREATORBUG-22811)
### CDB
* Fixed loading of custom debugging helpers (QTCREATORBUG-20481)
@@ -152,6 +156,7 @@ you can check out from the public Git repository. For example:
* Added all fonts from project directory to font selector (QDS-100)
* Updated properties of `Flickable`
* Improved handling of errors in state editor (QDS-695)
* Improved selection behavior (QDS-853)
## Version Control Systems
@@ -188,6 +193,10 @@ you can check out from the public Git repository. For example:
* Removed support for MIPS64
### iOS
* Fixed simulator detection with Xcode 11 (QTCREATORBUG-22757)
### Remote Linux
* Added deployment method that deploys everything that is installed by the build system

View File

@@ -25,6 +25,8 @@
#include "proxyaction.h"
#include "stringutils.h"
using namespace Utils;
ProxyAction::ProxyAction(QObject *parent) :
@@ -167,10 +169,9 @@ void ProxyAction::updateToolTipWithKeySequence()
QString ProxyAction::stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut)
{
QString s = str;
s.replace(QLatin1String("&&"), QLatin1String("&"));
return QString::fromLatin1("%1 <span style=\"color: gray; font-size: small\">%2</span>").
arg(s, shortcut.toString(QKeySequence::NativeText));
const QString s = stripAccelerator(str);
return QString::fromLatin1("%1 <span style=\"color: gray; font-size: small\">%2</span>")
.arg(s, shortcut.toString(QKeySequence::NativeText));
}
ProxyAction *ProxyAction::proxyActionWithIcon(QAction *original, const QIcon &newIcon)

View File

@@ -94,7 +94,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
env.set(QLatin1String("ANDROID_NDK_HOST"),
AndroidConfigurations::currentConfig().toolchainHost());
const Utils::FilePath javaHome = AndroidConfigurations::currentConfig().openJDKLocation();
if (!javaHome.exists()) {
if (javaHome.exists()) {
env.set(QLatin1String("JAVA_HOME"), javaHome.toString());
const FilePath javaBin = javaHome.pathAppended("bin");
if (!Utils::contains(env.path(), [&javaBin](const Utils::FilePath &p) { return p == javaBin; }))

View File

@@ -1302,7 +1302,7 @@ void BreakpointItem::setState(BreakpointState state)
m_state = state;
// FIXME: updateMarker() should recognize the need for icon changes.
if (state == BreakpointInserted) {
if (state == BreakpointInserted || state == BreakpointInsertionRequested) {
destroyMarker();
updateMarker();
}

View File

@@ -56,6 +56,7 @@
#include <utils/fancylineedit.h>
#include <utils/qtcassert.h>
#include <utils/savedaction.h>
#include <utils/stringutils.h>
#include <utils/theme/theme.h>
#include <QApplication>
@@ -1583,8 +1584,7 @@ static QString removeWatchActionText(QString exp)
exp.truncate(30);
exp.append("...");
}
return WatchModel::tr("Remove Expression Evaluator for \"%1\"")
.arg(exp.replace('&', "&&"));
return WatchModel::tr("Remove Expression Evaluator for \"%1\"").arg(Utils::quoteAmpersands(exp));
}
static void copyToClipboard(const QString &clipboardText)

View File

@@ -56,8 +56,7 @@ QVariant OpenPagesModel::data(const QModelIndex &index, int role) const
case Qt::ToolTipRole:
return m_pages.at(index.row())->source().toString();
case Qt::DisplayRole: {
QString title = m_pages.at(index.row())->title();
title.replace('&', "&&");
const QString title = m_pages.at(index.row())->title();
return title.isEmpty() ? tr("(Untitled)") : title;
}
default:

View File

@@ -29,6 +29,7 @@
#include "openpagesmodel.h"
#include <coreplugin/coreconstants.h>
#include <utils/stringutils.h>
#include <QAbstractItemModel>
#include <QApplication>
@@ -86,10 +87,9 @@ void OpenPagesWidget::contextMenuRequested(QPoint pos)
if (index.column() == 1)
index = index.sibling(index.row(), 0);
QMenu contextMenu;
QAction *closeEditor = contextMenu.addAction(tr("Close %1").arg(index.data()
.toString()));
QAction *closeOtherEditors = contextMenu.addAction(tr("Close All Except %1")
.arg(index.data().toString()));
const QString displayString = Utils::quoteAmpersands(index.data().toString());
QAction *closeEditor = contextMenu.addAction(tr("Close %1").arg(displayString));
QAction *closeOtherEditors = contextMenu.addAction(tr("Close All Except %1").arg(displayString));
if (model()->rowCount() == 1) {
closeEditor->setEnabled(false);

View File

@@ -67,11 +67,16 @@ namespace Internal {
static const QLatin1String deviceTypeKey("Ios.device_type");
static QString displayName(const SimulatorInfo &device)
{
return QString("%1, %2").arg(device.name).arg(device.runtimeName);
}
static IosDeviceType toIosDeviceType(const SimulatorInfo &device)
{
IosDeviceType iosDeviceType(IosDeviceType::SimulatedDevice,
device.identifier,
QString("%1, %2").arg(device.name).arg(device.runtimeName));
displayName(device));
return iosDeviceType;
}
@@ -351,8 +356,7 @@ void IosDeviceTypeAspect::updateValues()
m_deviceTypeComboBox->setVisible(showDeviceSelector);
if (showDeviceSelector && m_deviceTypeModel.rowCount() == 0) {
foreach (const SimulatorInfo &device, SimulatorControl::availableSimulators()) {
QStandardItem *item = new QStandardItem(QString("%1, %2").arg(device.name)
.arg(device.runtimeName));
QStandardItem *item = new QStandardItem(Internal::displayName(device));
QVariant v;
v.setValue(device);
item->setData(v);

View File

@@ -61,6 +61,7 @@ const char deviceTypeTag[] = "devicetypes";
const char devicesTag[] = "devices";
const char availabilityTag[] = "availability";
const char unavailabilityToken[] = "unavailable";
const char availabilityTagNew[] = "isAvailable"; // at least since Xcode 10
const char identifierTag[] = "identifier";
const char runtimesTag[] = "runtimes";
const char nameTag[] = "name";
@@ -117,6 +118,13 @@ static bool launchSimulator(const QString &simUdid) {
return QProcess::startDetached(simulatorAppPath, {"--args", "-CurrentDeviceUDID", simUdid});
}
static bool isAvailable(const QJsonObject &object)
{
return object.contains(availabilityTagNew)
? object.value(availabilityTagNew).toBool()
: !object.value(availabilityTag).toString().contains(unavailabilityToken);
}
static QList<DeviceTypeInfo> getAvailableDeviceTypes()
{
QList<DeviceTypeInfo> deviceTypes;
@@ -127,7 +135,7 @@ static QList<DeviceTypeInfo> getAvailableDeviceTypes()
const QJsonArray runtimesArray = doc.object().value(deviceTypeTag).toArray();
foreach (const QJsonValue deviceTypeValue, runtimesArray) {
QJsonObject deviceTypeObject = deviceTypeValue.toObject();
if (!deviceTypeObject.value(availabilityTag).toString().contains(unavailabilityToken)) {
if (isAvailable(deviceTypeObject)) {
DeviceTypeInfo deviceType;
deviceType.name = deviceTypeObject.value(nameTag).toString("unknown");
deviceType.identifier = deviceTypeObject.value(identifierTag).toString("unknown");
@@ -151,7 +159,7 @@ static QList<RuntimeInfo> getAvailableRuntimes()
const QJsonArray runtimesArray = doc.object().value(runtimesTag).toArray();
foreach (const QJsonValue runtimeValue, runtimesArray) {
QJsonObject runtimeObject = runtimeValue.toObject();
if (!runtimeObject.value(availabilityTag).toString().contains(unavailabilityToken)) {
if (isAvailable(runtimeObject)) {
RuntimeInfo runtime;
runtime.name = runtimeObject.value(nameTag).toString("unknown");
runtime.build = runtimeObject.value(buildVersionTag).toString("unknown");
@@ -233,8 +241,7 @@ static QList<SimulatorInfo> getAllSimulatorDevices()
device.identifier = deviceObject.value(udidTag).toString();
device.name = deviceObject.value(nameTag).toString();
device.runtimeName = runtime;
const QString availableStr = deviceObject.value(availabilityTag).toString();
device.available = !availableStr.contains(unavailabilityToken);
device.available = isAvailable(deviceObject);
device.state = deviceObject.value(stateTag).toString();
simulatorDevices.append(device);
}

View File

@@ -1,5 +1,5 @@
add_qtc_plugin(Python
PLUGIN_DEPENDS Core QtSupport ProjectExplorer TextEditor
PLUGIN_DEPENDS Core ProjectExplorer TextEditor
SOURCES
python.qrc
pythoneditor.cpp pythoneditor.h

View File

@@ -8,7 +8,6 @@ QtcPlugin {
Depends { name: "Core" }
Depends { name: "TextEditor" }
Depends { name: "QtSupport" }
Depends { name: "ProjectExplorer" }
Group {

View File

@@ -5,5 +5,4 @@ QTC_LIB_DEPENDS += \
QTC_PLUGIN_DEPENDS += \
coreplugin \
texteditor \
qtsupport \
projectexplorer

View File

@@ -299,6 +299,13 @@ void GraphicsView::contextMenuEvent(QContextMenuEvent *event)
QAction *openEditorAction = menu.addAction(tr("Open Style Editor"));
connect(openEditorAction, &QAction::triggered, openStyleEditor);
menu.addSeparator();
auto insertKeyframes = [this, event]() {
insertKeyframe(globalToRaster(event->globalPos()).x(), true);
};
QAction *insertKeyframeAction = menu.addAction(tr("Insert Keyframe"));
connect(insertKeyframeAction, &QAction::triggered, insertKeyframes);
menu.exec(event->globalPos());
}
@@ -400,12 +407,14 @@ void GraphicsView::applyZoom(double x, double y, const QPoint &pivot)
}
}
void GraphicsView::insertKeyframe(double time)
void GraphicsView::insertKeyframe(double time, bool allVisibleCurves)
{
const auto itemList = items();
for (auto *item : itemList) {
if (auto *curveItem = qgraphicsitem_cast<CurveItem *>(item)) {
if (curveItem->isUnderMouse())
if (allVisibleCurves)
curveItem->insertKeyframeByTime(std::round(time));
else if (curveItem->isUnderMouse())
curveItem->insertKeyframeByTime(std::round(time));
}
}

View File

@@ -124,7 +124,7 @@ protected:
private:
void applyZoom(double x, double y, const QPoint &pivot = QPoint());
void insertKeyframe(double time);
void insertKeyframe(double time, bool allVisibleCurves = false);
void deleteSelectedKeyframes();

View File

@@ -58,14 +58,15 @@ void Selector::mousePress(QMouseEvent *event, GraphicsView *view)
if (view->hasActiveHandle())
return;
if (select(SelectionTool::Undefined, view->globalToScene(event->globalPos()), view))
applyPreSelection(view);
m_mouseInit = event->globalPos();
m_mouseCurr = event->globalPos();
QPointF click = view->globalToScene(m_mouseInit);
if (!isOverSelectedKeyframe(click, view))
if (select(SelectionTool::Undefined, click, view))
applyPreSelection(view);
m_lasso = QPainterPath(click);
m_lasso.closeSubpath();
@@ -119,6 +120,19 @@ void Selector::mouseRelease(QMouseEvent *event, GraphicsView *view)
m_rect = QRectF();
}
bool Selector::isOverSelectedKeyframe(const QPointF &pos, GraphicsView *view)
{
const auto itemList = view->items();
for (auto *item : itemList) {
if (auto *frame = qgraphicsitem_cast<KeyframeItem *>(item)) {
QRectF itemRect = frame->mapRectToScene(frame->boundingRect());
if (itemRect.contains(pos))
return frame->selected();
}
}
return false;
}
bool Selector::select(const SelectionTool &tool, const QPointF &pos, GraphicsView *view)
{
auto selectWidthTool = [this, tool](SelectionMode mode, const QPointF &pos, GraphicsView *view) {

View File

@@ -54,6 +54,8 @@ public:
void mouseRelease(QMouseEvent *event, GraphicsView *view);
private:
bool isOverSelectedKeyframe(const QPointF &pos, GraphicsView *view);
bool select(const SelectionTool &tool, const QPointF &pos, GraphicsView *view);
bool pressSelection(SelectionMode mode, const QPointF &pos, GraphicsView *view);

View File

@@ -112,12 +112,15 @@ DesignTools::ValueType typeFrom(const QmlTimelineKeyframeGroup &group)
if (group.valueType() == TypeName("double") || group.valueType() == TypeName("real"))
return DesignTools::ValueType::Double;
if (group.valueType() == TypeName("bool"))
if (group.valueType() == TypeName("boolean") || group.valueType() == TypeName("bool"))
return DesignTools::ValueType::Bool;
if (group.valueType() == TypeName("integer"))
if (group.valueType() == TypeName("integer") || group.valueType() == TypeName("int"))
return DesignTools::ValueType::Integer;
// Ignoring types:
// QColor / HAlignment / VAlignment
return DesignTools::ValueType::Undefined;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 139 B

View File

@@ -73,5 +73,7 @@
<file>images/timeline-16px.png</file>
<file>images/remove_timeline.png</file>
<file>images/remove_timeline@2x.png</file>
<file>images/curveGraphIcon.png</file>
<file>images/curveGraphIcon@2x.png</file>
</qresource>
</RCC>

View File

@@ -83,6 +83,8 @@ const Utils::Icon REMOVE_TIMELINE({
// Icons on the toolbars
const Utils::Icon ANIMATION({
{":/timelineplugin/images/animation.png", Utils::Theme::IconsBaseColor}});
const Utils::Icon CURVE_EDITORDIALOG({
{":/timelineplugin/images/curveGraphIcon.png", Utils::Theme::IconsBaseColor}});
const Utils::Icon TO_FIRST_FRAME({
{":/timelineplugin/images/to_first_frame.png", Utils::Theme::IconsBaseColor}});
const Utils::Icon BACK_ONE_FRAME({

View File

@@ -251,7 +251,7 @@ void TimelineToolBar::createLeftControls()
addActionToGroup(settingsAction);
auto *curveEditorAction = createAction(TimelineConstants::C_CURVE_EDITOR,
TimelineIcons::ANIMATION.icon(),
TimelineIcons::CURVE_EDITORDIALOG.icon(),
tr("Curve Editor"),
QKeySequence(Qt::Key_C));

View File

@@ -39,6 +39,8 @@
#include <qmlstate.h>
#include <qmltimeline.h>
#include <coreplugin/icore.h>
#include <theme.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h>
@@ -372,7 +374,7 @@ void TimelineWidget::openEasingCurveEditor()
QList<ModelNode> frames;
for (auto *item : graphicsScene()->selectedKeyframes())
frames.append(item->frameNode());
EasingCurveDialog::runDialog(frames);
EasingCurveDialog::runDialog(frames, Core::ICore::dialogParent());
}
}

View File

@@ -694,6 +694,10 @@ Project {
"texttool/textedititemwidget.h",
"texttool/texttool.cpp",
"texttool/texttool.h",
"timelineeditor/animationcurvedialog.cpp",
"timelineeditor/animationcurvedialog.h",
"timelineeditor/animationcurveeditormodel.cpp",
"timelineeditor/animationcurveeditormodel.h",
"timelineeditor/canvas.cpp",
"timelineeditor/canvas.h",
"timelineeditor/canvasstyledialog.cpp",

View File

@@ -249,10 +249,7 @@ void StudioWelcomePlugin::extensionsInitialized()
s_view->show();
s_view->raise();
QTimer::singleShot(15000, [](){
if (s_view)
s_view->close();
});
QTimer::singleShot(15000, [this](){ closeSplashScreen(); });
});
}
}

View File

@@ -38,6 +38,7 @@ endif()
add_subdirectory(qml2puppet)
# add_subdirectory(qtcdebugger) ## windows only
# add_subdirectory(qtcrashhandler)
add_subdirectory(qtc-askpass)
add_subdirectory(qtcreatorcrashhandler)
# add_subdirectory(qtcreatorwidgets) ## qbs does not build this either
add_subdirectory(qtpromaker)

View File

@@ -0,0 +1,5 @@
add_qtc_executable(qtc-askpass
DEPENDS Qt5::Widgets
SOURCES
qtc-askpass-main.cpp
)