Merge remote-tracking branch 'origin/4.10'
Change-Id: I4d24269ef040c45e2143dfa86d1be3f7e8008521
@@ -20,6 +20,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
option(WITH_TESTS "Build Tests" OFF)
|
||||
option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality (e.g. source file disk checking)" OFF)
|
||||
option(BUILD_WITH_PCH "Build with precompiled headers" ON)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
@@ -35,7 +36,7 @@ endif()
|
||||
|
||||
find_package(Qt5
|
||||
COMPONENTS Concurrent Core Network PrintSupport Qml Quick QuickWidgets
|
||||
Sql ${_TEST_QT_COMPONENT}
|
||||
Sql Widgets ${_TEST_QT_COMPONENT}
|
||||
REQUIRED
|
||||
)
|
||||
|
||||
|
@@ -250,6 +250,42 @@ function(qtc_plugin_enabled varName name)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(enable_pch target)
|
||||
if (BUILD_WITH_PCH)
|
||||
get_target_property(target_sources ${target} SOURCES)
|
||||
list(LENGTH target_sources target_sources_number)
|
||||
if (${target_sources_number} GREATER "3")
|
||||
set(PCH_FILE "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_pch.h")
|
||||
|
||||
function(_recursively_collect_dependencies input_target)
|
||||
get_target_property(input_type ${input_target} TYPE)
|
||||
if (${input_type} STREQUAL "INTERFACE_LIBRARY")
|
||||
set(prefix "INTERFACE_")
|
||||
endif()
|
||||
get_target_property(link_libraries ${input_target} ${prefix}LINK_LIBRARIES)
|
||||
foreach(library IN LISTS link_libraries)
|
||||
if(TARGET ${library} AND NOT ${library} IN_LIST dependencies)
|
||||
list(APPEND dependencies ${library})
|
||||
_recursively_collect_dependencies(${library})
|
||||
endif()
|
||||
endforeach()
|
||||
set(dependencies ${dependencies} PARENT_SCOPE)
|
||||
endfunction()
|
||||
_recursively_collect_dependencies(${target})
|
||||
|
||||
if ("Qt5::Widgets" IN_LIST dependencies)
|
||||
set(PCH_FILE "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h")
|
||||
endif()
|
||||
|
||||
if (EXISTS ${PCH_FILE})
|
||||
set_target_properties(${target} PROPERTIES PRECOMPILE_HEADERS ${PCH_FILE})
|
||||
endif()
|
||||
elseif(WITH_DEBUG_CMAKE)
|
||||
message(STATUS "Skipped PCH for ${target}")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# Public API functions
|
||||
#
|
||||
@@ -330,6 +366,7 @@ function(add_qtc_library name)
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${IDE_LIBRARY_PATH}"
|
||||
${_arg_PROPERTIES}
|
||||
)
|
||||
enable_pch(${name})
|
||||
|
||||
unset(NAMELINK_OPTION)
|
||||
if (library_type STREQUAL "SHARED")
|
||||
@@ -534,6 +571,7 @@ function(add_qtc_plugin target_name)
|
||||
OUTPUT_NAME "${name}"
|
||||
${_arg_PROPERTIES}
|
||||
)
|
||||
enable_pch(${target_name})
|
||||
|
||||
foreach(file IN LISTS _arg_EXPLICIT_MOC)
|
||||
set_explicit_moc(${target_name} "${file}")
|
||||
@@ -595,6 +633,15 @@ function(extend_qtc_target target_name)
|
||||
set(_arg_SOURCES ${prefixed_sources})
|
||||
endif()
|
||||
target_sources(${target_name} PRIVATE ${_arg_SOURCES})
|
||||
|
||||
if (APPLE AND BUILD_WITH_PCH)
|
||||
foreach(source IN LISTS _arg_SOURCES)
|
||||
if (source MATCHES "^.*\.mm$")
|
||||
set_source_files_properties(${source} PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set_public_headers(${target_name} "${_arg_SOURCES}")
|
||||
|
||||
foreach(file IN LISTS _arg_EXPLICIT_MOC)
|
||||
@@ -662,6 +709,7 @@ function(add_qtc_executable name)
|
||||
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${_DESTINATION}"
|
||||
${_arg_PROPERTIES}
|
||||
)
|
||||
enable_pch(${name})
|
||||
|
||||
if (NOT _arg_SKIP_INSTALL)
|
||||
install(TARGETS ${name} DESTINATION "${_DESTINATION}")
|
||||
@@ -702,6 +750,7 @@ function(add_qtc_test name)
|
||||
BUILD_RPATH "${_RPATH_BASE}/${_RPATH}"
|
||||
INSTALL_RPATH "${_RPATH_BASE}/${_RPATH}"
|
||||
)
|
||||
enable_pch(${name})
|
||||
|
||||
if (NOT _arg_GTEST)
|
||||
add_test(NAME ${name} COMMAND ${name})
|
||||
|
@@ -68,6 +68,8 @@ Loader {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: gradientDialogLoader.visible = false
|
||||
preventStealing: true
|
||||
hoverEnabled: true
|
||||
}
|
||||
Rectangle {
|
||||
id: background
|
||||
|
@@ -28,7 +28,7 @@ import QtQuick.Layouts 1.0
|
||||
import QtQuickDesignerTheme 1.0
|
||||
import StudioControls 1.0 as StudioControls
|
||||
|
||||
StudioControls.SpinBox {
|
||||
StudioControls.RealSpinBox {
|
||||
id: spinBox
|
||||
width: 82
|
||||
Layout.minimumWidth: 82
|
||||
@@ -36,9 +36,10 @@ StudioControls.SpinBox {
|
||||
property string propertyName
|
||||
actionIndicatorVisible: false
|
||||
|
||||
from: -9999
|
||||
to: 9999
|
||||
Component.onCompleted: spinBox.value = gradientLine.model.readGradientProperty(propertyName)
|
||||
onCompressedValueModified: gradientLine.model.setGradientProperty(propertyName, spinBox.value)
|
||||
stepSize: 1
|
||||
realFrom: -9999
|
||||
realTo: 9999
|
||||
realStepSize: 1
|
||||
|
||||
Component.onCompleted: spinBox.realValue = gradientLine.model.readGradientProperty(propertyName)
|
||||
onCompressedRealValueModified: gradientLine.model.setGradientProperty(propertyName, spinBox.realValue)
|
||||
}
|
||||
|
@@ -37,7 +37,6 @@ RowLayout {
|
||||
|
||||
property string filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg"
|
||||
|
||||
|
||||
FileResourcesModel {
|
||||
modelNodeBackendProperty: modelNodeBackend
|
||||
filter: urlChooser.filter
|
||||
@@ -63,15 +62,20 @@ RowLayout {
|
||||
|
||||
property bool isComplete: false
|
||||
|
||||
property bool dirty: false
|
||||
|
||||
onEditTextChanged: comboBox.dirty = true
|
||||
|
||||
function setCurrentText(text) {
|
||||
if (text === "")
|
||||
return
|
||||
|
||||
|
||||
var index = comboBox.find(textValue)
|
||||
var index = comboBox.find(text)
|
||||
if (index === -1)
|
||||
currentIndex = -1
|
||||
editText = textValue
|
||||
|
||||
editText = text
|
||||
comboBox.dirty = false
|
||||
}
|
||||
|
||||
property string textValue: {
|
||||
@@ -81,9 +85,7 @@ RowLayout {
|
||||
return backendValue.valueToString
|
||||
}
|
||||
|
||||
onTextValueChanged: {
|
||||
setCurrentText(textValue)
|
||||
}
|
||||
onTextValueChanged: setCurrentText(textValue)
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -97,25 +99,41 @@ RowLayout {
|
||||
|
||||
setCurrentText(textValue)
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
if (!comboBox.isComplete)
|
||||
return;
|
||||
|
||||
if (backendValue.value !== currentText)
|
||||
backendValue.value = currentText;
|
||||
if (backendValue.value !== editText)
|
||||
backendValue.value = editText;
|
||||
|
||||
comboBox.dirty = false
|
||||
}
|
||||
|
||||
onActivated: {
|
||||
var cText = textAt(index)
|
||||
print(cText)
|
||||
if (backendValue === undefined)
|
||||
onFocusChanged: {
|
||||
if (comboBox.dirty)
|
||||
handleActivate(comboBox.currentIndex)
|
||||
}
|
||||
|
||||
onActivated: handleActivate(index)
|
||||
|
||||
function handleActivate(index)
|
||||
{
|
||||
var cText = comboBox.textAt(index)
|
||||
|
||||
if (index === -1)
|
||||
cText = comboBox.editText
|
||||
|
||||
if (urlChooser.backendValue === undefined)
|
||||
return;
|
||||
|
||||
if (!comboBox.isComplete)
|
||||
return;
|
||||
|
||||
if (backendValue.value !== cText)
|
||||
backendValue.value = cText;
|
||||
if (urlChooser.backendValue.value !== cText)
|
||||
urlChooser.backendValue.value = cText;
|
||||
|
||||
comboBox.dirty = false
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
@@ -524,7 +524,8 @@ QStringList GccToolChain::gccPrepareArguments(const QStringList &flags,
|
||||
const QString &flag = allFlags.at(i);
|
||||
if (flag.startsWith("-stdlib=") || flag.startsWith("--gcc-toolchain=")
|
||||
|| flag.startsWith("-B") || flag.startsWith("--target=")
|
||||
|| (flag.startsWith("-isystem") && flag.length() > 8)) {
|
||||
|| (flag.startsWith("-isystem") && flag.length() > 8)
|
||||
|| flag == "-nostdinc" || flag == "-nostdinc++") {
|
||||
arguments << flag;
|
||||
} else if ((flag == "-target" || flag == "-gcc-toolchain" || flag == "-isystem"
|
||||
|| flag == "-arch")
|
||||
|
@@ -327,6 +327,22 @@ void AnimationCurve::analyze()
|
||||
|
||||
if (frame.position().y() > m_maxY)
|
||||
m_maxY = frame.position().y();
|
||||
|
||||
if (frame.hasLeftHandle()) {
|
||||
if (frame.leftHandle().y() < m_minY)
|
||||
m_minY = frame.leftHandle().y();
|
||||
|
||||
if (frame.leftHandle().y() > m_maxY)
|
||||
m_maxY = frame.leftHandle().y();
|
||||
}
|
||||
|
||||
if (frame.hasRightHandle()) {
|
||||
if (frame.rightHandle().y() < m_minY)
|
||||
m_minY = frame.rightHandle().y();
|
||||
|
||||
if (frame.rightHandle().y() > m_maxY)
|
||||
m_maxY = frame.rightHandle().y();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -42,12 +42,12 @@ CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent)
|
||||
, m_tree(new TreeView(model, this))
|
||||
, m_view(new GraphicsView(model))
|
||||
{
|
||||
QSplitter *splitter = new QSplitter;
|
||||
auto *splitter = new QSplitter;
|
||||
splitter->addWidget(m_tree);
|
||||
splitter->addWidget(m_view);
|
||||
splitter->setStretchFactor(1, 2);
|
||||
|
||||
QVBoxLayout *box = new QVBoxLayout;
|
||||
auto *box = new QVBoxLayout;
|
||||
box->addWidget(createToolBar());
|
||||
box->addWidget(splitter);
|
||||
setLayout(box);
|
||||
@@ -72,12 +72,12 @@ void CurveEditor::clearCanvas()
|
||||
|
||||
QToolBar *CurveEditor::createToolBar()
|
||||
{
|
||||
QToolBar *bar = new QToolBar;
|
||||
auto *bar = new QToolBar;
|
||||
bar->setFloatable(false);
|
||||
|
||||
QAction *tangentLinearAction = bar->addAction("Linear");
|
||||
QAction *tangentStepAction = bar->addAction("Step");
|
||||
QAction *tangentSplineAction = bar->addAction("Spline");
|
||||
QAction *tangentLinearAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsLinearIcon.png"), "Linear");
|
||||
QAction *tangentStepAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsStepIcon.png"), "Step");
|
||||
QAction *tangentSplineAction = bar->addAction(QIcon(":/curveeditor/images/tangetToolsSplineIcon.png"), "Spline");
|
||||
QAction *tangentDefaultAction = bar->addAction("Set Default");
|
||||
|
||||
auto setLinearInterpolation = [this]() {
|
||||
|
@@ -44,3 +44,6 @@ SOURCES += \
|
||||
$$PWD/detail/utils.cpp \
|
||||
$$PWD/keyframe.cpp \
|
||||
$$PWD/treeitem.cpp
|
||||
|
||||
RESOURCES += \
|
||||
$$PWD/curveeditor.qrc
|
||||
|
@@ -0,0 +1,20 @@
|
||||
<RCC>
|
||||
<qresource prefix="/curveeditor">
|
||||
<file>images/tangetToolsSplineIcon.png</file>
|
||||
<file>images/tangetToolsSplineIcon@2x.png</file>
|
||||
<file>images/tangetToolsLinearIcon.png</file>
|
||||
<file>images/tangetToolsLinearIcon@2x.png</file>
|
||||
<file>images/tangetToolsStepIcon.png</file>
|
||||
<file>images/tangetToolsStepIcon@2x.png</file>
|
||||
<file>images/treeview_eye.png</file>
|
||||
<file>images/treeview_eye@2x.png</file>
|
||||
<file>images/treeview_pin.png</file>
|
||||
<file>images/treeview_pin@2x.png</file>
|
||||
<file>images/treeview_unpin.png</file>
|
||||
<file>images/treeview_unpin@2x.png</file>
|
||||
<file>images/treeview_unlock@2x.png</file>
|
||||
<file>images/treeview_lock.png</file>
|
||||
<file>images/treeview_lock@2x.png</file>
|
||||
<file>images/treeview_unlock.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "detail/shortcut.h"
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QBitmap>
|
||||
#include <QBrush>
|
||||
#include <QColor>
|
||||
@@ -39,10 +41,10 @@ namespace DesignTools {
|
||||
struct TreeItemStyleOption
|
||||
{
|
||||
double margins;
|
||||
QIcon pinnedIcon = QIcon(":/ICON_PINNED");
|
||||
QIcon unpinnedIcon = QIcon(":/ICON_UNPINNED");
|
||||
QIcon lockedIcon = QIcon(":/ICON_LOCKED");
|
||||
QIcon unlockedIcon = QIcon(":/ICON_UNLOCKED");
|
||||
QIcon pinnedIcon = QIcon(":/curveeditor/images/treeview_pin.png");
|
||||
QIcon unpinnedIcon = QIcon(":/curveeditor/images/treeview_unpin.png");
|
||||
QIcon lockedIcon = QIcon(":/curveeditor/images/treeview_lock.png");
|
||||
QIcon unlockedIcon = QIcon(":/curveeditor/images/treeview_unlock.png");
|
||||
};
|
||||
|
||||
struct HandleItemStyleOption
|
||||
@@ -87,7 +89,9 @@ struct Shortcuts
|
||||
Shortcut frameAll = Shortcut(Qt::NoModifier, Qt::Key_A);
|
||||
|
||||
Shortcut insertKeyframe = Shortcut(Qt::MiddleButton, Qt::NoModifier);
|
||||
Shortcut deleteKeyframe = Shortcut(Qt::NoModifier, Qt::Key_Delete);
|
||||
|
||||
Shortcut deleteKeyframe = Utils::HostOsInfo::isMacHost() ?
|
||||
Shortcut(Qt::NoModifier, Qt::Key_Backspace) : Shortcut(Qt::NoModifier, Qt::Key_Delete);
|
||||
};
|
||||
|
||||
struct CurveEditorStyle
|
||||
|
@@ -85,13 +85,19 @@ int CurveItem::type() const
|
||||
|
||||
QRectF CurveItem::boundingRect() const
|
||||
{
|
||||
if (m_keyframes.empty())
|
||||
return QRectF();
|
||||
|
||||
auto bbox = [](QRectF &bounds, const Keyframe &frame) {
|
||||
grow(bounds, frame.position());
|
||||
if (frame.hasLeftHandle())
|
||||
grow(bounds, frame.leftHandle());
|
||||
if (frame.hasRightHandle())
|
||||
grow(bounds, frame.rightHandle());
|
||||
};
|
||||
|
||||
QRectF bounds;
|
||||
QPointF init = m_keyframes[0]->keyframe().position();
|
||||
QRectF bounds(init, init);
|
||||
for (auto *item : m_keyframes)
|
||||
bbox(bounds, item->keyframe());
|
||||
|
||||
@@ -213,9 +219,7 @@ std::vector<AnimationCurve> CurveItem::curves() const
|
||||
if (tmp.size() >= 2)
|
||||
out.push_back(AnimationCurve(tmp));
|
||||
|
||||
out.push_back(
|
||||
AnimationCurve(
|
||||
current.data().value<QEasingCurve>(),
|
||||
out.push_back(AnimationCurve(current.data().value<QEasingCurve>(),
|
||||
previous.position(),
|
||||
current.position()));
|
||||
|
||||
|
@@ -141,8 +141,7 @@ void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
|
||||
const auto itemList = items();
|
||||
for (auto *item : itemList) {
|
||||
if (auto *curveItem = qgraphicsitem_cast<CurveItem *>(item)) {
|
||||
|
||||
// CurveItems might becom invalid after a keyframe-drag operation.
|
||||
// CurveItems might become invalid after a keyframe-drag operation.
|
||||
curveItem->restore();
|
||||
|
||||
if (curveItem->contains(mouseEvent->scenePos()))
|
||||
@@ -155,6 +154,9 @@ void GraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_dirty)
|
||||
graphicsView()->setZoomY(0.0);
|
||||
}
|
||||
|
||||
bool GraphicsScene::hasActiveKeyframe() const
|
||||
|
@@ -333,8 +333,6 @@ void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
|
||||
painter->fillRect(scene()->sceneRect(), m_style.backgroundAlternateBrush);
|
||||
|
||||
drawGrid(painter, rect);
|
||||
drawExtremaX(painter, rect);
|
||||
drawExtremaY(painter, rect);
|
||||
}
|
||||
|
||||
int GraphicsView::mapTimeToX(double time) const
|
||||
@@ -378,13 +376,16 @@ void GraphicsView::applyZoom(double x, double y, const QPoint &pivot)
|
||||
double minTime = minimumTime();
|
||||
double maxTime = maximumTime();
|
||||
|
||||
double minValue = minimumValue();
|
||||
double maxValue = maximumValue();
|
||||
|
||||
QRectF canvas = canvasRect();
|
||||
|
||||
double xZoomedOut = canvas.width() / (maxTime - minTime);
|
||||
double xZoomedIn = m_style.zoomInWidth;
|
||||
double scaleX = lerp(clamp(m_zoomX, 0.0, 1.0), xZoomedOut, xZoomedIn);
|
||||
|
||||
double yZoomedOut = canvas.height() / maximumValue();
|
||||
double yZoomedOut = canvas.height() / (maxValue - minValue);
|
||||
double yZoomedIn = m_style.zoomInHeight;
|
||||
double scaleY = lerp(clamp(m_zoomY, 0.0, 1.0), -yZoomedOut, -yZoomedIn);
|
||||
|
||||
@@ -453,6 +454,7 @@ void GraphicsView::drawGrid(QPainter *painter, const QRectF &rect)
|
||||
painter->restore();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void GraphicsView::drawExtremaX(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
auto drawVerticalLine = [rect, painter](double position) {
|
||||
@@ -480,10 +482,9 @@ void GraphicsView::drawExtremaY(QPainter *painter, const QRectF &rect)
|
||||
drawHorizontalLine(mapValueToY(m_scene.minimumValue()));
|
||||
drawHorizontalLine(mapValueToY(m_scene.maximumValue()));
|
||||
|
||||
drawHorizontalLine(mapValueToY(0.0));
|
||||
|
||||
painter->restore();
|
||||
}
|
||||
#endif
|
||||
|
||||
void GraphicsView::drawTimeScale(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
|
@@ -130,9 +130,11 @@ private:
|
||||
|
||||
void drawGrid(QPainter *painter, const QRectF &rect);
|
||||
|
||||
#if 0
|
||||
void drawExtremaX(QPainter *painter, const QRectF &rect);
|
||||
|
||||
void drawExtremaY(QPainter *painter, const QRectF &rect);
|
||||
#endif
|
||||
|
||||
void drawTimeScale(QPainter *painter, const QRectF &rect);
|
||||
|
||||
|
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 383 B |
After Width: | Height: | Size: 463 B |
After Width: | Height: | Size: 902 B |
After Width: | Height: | Size: 168 B |
After Width: | Height: | Size: 252 B |
After Width: | Height: | Size: 218 B |
After Width: | Height: | Size: 946 B |
After Width: | Height: | Size: 237 B |
After Width: | Height: | Size: 909 B |
After Width: | Height: | Size: 278 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 354 B |
After Width: | Height: | Size: 245 B |
After Width: | Height: | Size: 1.1 KiB |
@@ -37,6 +37,8 @@
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagebox.h>
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
enum {
|
||||
debug = false
|
||||
};
|
||||
@@ -181,10 +183,11 @@ void StatesEditorModel::renameState(int internalNodeId, const QString &newName)
|
||||
return;
|
||||
|
||||
if (newName.isEmpty() ||! m_statesEditorView->validStateName(newName)) {
|
||||
Core::AsynchronousMessageBox::warning(tr("Invalid state name"),
|
||||
auto w = Core::AsynchronousMessageBox::warning(tr("Invalid state name"),
|
||||
newName.isEmpty() ?
|
||||
tr("The empty string as a name is reserved for the base state.") :
|
||||
tr("Name already used in another state"));
|
||||
w->setAttribute(Qt::WA_ShowModal, false);
|
||||
reset();
|
||||
} else {
|
||||
m_statesEditorView->renameState(internalNodeId, newName);
|
||||
|
@@ -56,31 +56,35 @@ DesignTools::CurveEditorStyle AnimationCurveEditorModel::style() const
|
||||
{
|
||||
// Pseudo auto generated. See: CurveEditorStyleDialog
|
||||
DesignTools::CurveEditorStyle out;
|
||||
out.backgroundBrush = QBrush(QColor(55, 55, 55));
|
||||
out.backgroundAlternateBrush = QBrush(QColor(0, 0, 50));
|
||||
out.backgroundBrush = QBrush(QColor(21, 21, 21));
|
||||
out.backgroundAlternateBrush = QBrush(QColor(32, 32, 32));
|
||||
out.fontColor = QColor(255, 255, 255);
|
||||
out.gridColor = QColor(114, 116, 118);
|
||||
out.canvasMargin = 15;
|
||||
out.zoomInWidth = 99;
|
||||
out.zoomInHeight = 99;
|
||||
out.timeAxisHeight = 40;
|
||||
out.timeAxisHeight = 60;
|
||||
out.timeOffsetLeft = 10;
|
||||
out.timeOffsetRight = 10;
|
||||
out.rangeBarColor = QColor(46, 47, 48);
|
||||
out.rangeBarColor = QColor(50, 50, 255);
|
||||
out.rangeBarCapsColor = QColor(50, 50, 255);
|
||||
out.valueAxisWidth = 60;
|
||||
out.valueOffsetTop = 10;
|
||||
out.valueOffsetBottom = 10;
|
||||
out.handleStyle.size = 12;
|
||||
out.handleStyle.size = 10;
|
||||
out.handleStyle.lineWidth = 1;
|
||||
out.handleStyle.color = QColor(255, 255, 255);
|
||||
out.handleStyle.selectionColor = QColor(255, 255, 255);
|
||||
out.keyframeStyle.size = 13;
|
||||
out.keyframeStyle.size = 14;
|
||||
out.keyframeStyle.color = QColor(172, 210, 255);
|
||||
out.keyframeStyle.selectionColor = QColor(255, 255, 255);
|
||||
out.curveStyle.width = 1;
|
||||
out.curveStyle.width = 2;
|
||||
out.curveStyle.color = QColor(0, 200, 0);
|
||||
out.curveStyle.selectionColor = QColor(255, 255, 255);
|
||||
out.treeItemStyle.margins = 0;
|
||||
out.playhead.width = 20;
|
||||
out.playhead.radius = 4;
|
||||
out.playhead.color = QColor(200, 200, 0);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@@ -55,6 +55,8 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QGraphicsLinearLayout>
|
||||
#include <QGraphicsProxyWidget>
|
||||
@@ -66,6 +68,14 @@
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
static int deleteKey()
|
||||
{
|
||||
if (Utils::HostOsInfo::isMacHost())
|
||||
return Qt::Key_Backspace;
|
||||
|
||||
return Qt::Key_Delete;
|
||||
}
|
||||
|
||||
QList<QmlTimelineKeyframeGroup> allTimelineFrames(const QmlTimeline &timeline)
|
||||
{
|
||||
QList<QmlTimelineKeyframeGroup> returnList;
|
||||
@@ -159,6 +169,7 @@ void TimelineGraphicsScene::setWidth(int width)
|
||||
void TimelineGraphicsScene::invalidateLayout()
|
||||
{
|
||||
m_layout->invalidate();
|
||||
toolBar()->setCurrentTimeline(currentTimeline());
|
||||
}
|
||||
|
||||
void TimelineGraphicsScene::setCurrenFrame(const QmlTimeline &timeline, qreal frame)
|
||||
@@ -566,14 +577,8 @@ void TimelineGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
switch (keyEvent->key()) {
|
||||
case Qt::Key_Delete:
|
||||
if (deleteKey() == keyEvent->key())
|
||||
handleKeyframeDeletion();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
QGraphicsScene::keyReleaseEvent(keyEvent);
|
||||
}
|
||||
@@ -706,7 +711,7 @@ bool TimelineGraphicsScene::event(QEvent *event)
|
||||
{
|
||||
switch (event->type()) {
|
||||
case QEvent::ShortcutOverride:
|
||||
if (static_cast<QKeyEvent *>(event)->key() == Qt::Key_Delete) {
|
||||
if (static_cast<QKeyEvent *>(event)->key() == deleteKey()) {
|
||||
QGraphicsScene::keyPressEvent(static_cast<QKeyEvent *>(event));
|
||||
event->accept();
|
||||
return true;
|
||||
|
@@ -236,24 +236,35 @@ bool TarPackageCreationStep::appendFile(QFile &tarFile, const QFileInfo &fileInf
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool setFilePath(TarFileHeader &header, const QByteArray &filePath)
|
||||
{
|
||||
if (filePath.length() <= int(sizeof header.fileName)) {
|
||||
std::memcpy(&header.fileName, filePath.data(), filePath.length());
|
||||
return true;
|
||||
}
|
||||
int sepIndex = filePath.indexOf('/');
|
||||
while (sepIndex != -1) {
|
||||
const int fileNamePart = filePath.length() - sepIndex;
|
||||
if (sepIndex <= int(sizeof header.fileNamePrefix)
|
||||
&& fileNamePart <= int(sizeof header.fileName)) {
|
||||
std::memcpy(&header.fileNamePrefix, filePath.data(), sepIndex);
|
||||
std::memcpy(&header.fileName, filePath.data() + sepIndex + 1, fileNamePart);
|
||||
return true;
|
||||
}
|
||||
sepIndex = filePath.indexOf('/', sepIndex + 1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TarPackageCreationStep::writeHeader(QFile &tarFile, const QFileInfo &fileInfo,
|
||||
const QString &remoteFilePath)
|
||||
{
|
||||
TarFileHeader header;
|
||||
std::memset(&header, '\0', sizeof header);
|
||||
const QByteArray &filePath = remoteFilePath.toUtf8();
|
||||
const int maxFilePathLength = sizeof header.fileNamePrefix + sizeof header.fileName;
|
||||
if (filePath.count() > maxFilePathLength) {
|
||||
raiseError(tr("Cannot add file \"%1\" to tar-archive: path too long.")
|
||||
.arg(QDir::toNativeSeparators(remoteFilePath)));
|
||||
if (!setFilePath(header, remoteFilePath.toUtf8())) {
|
||||
raiseError(tr("Cannot add file \"%1\" to tar-archive: path too long.").arg(remoteFilePath));
|
||||
return false;
|
||||
}
|
||||
|
||||
const int fileNameBytesToWrite = qMin<int>(filePath.length(), sizeof header.fileName);
|
||||
const int fileNameOffset = filePath.length() - fileNameBytesToWrite;
|
||||
std::memcpy(&header.fileName, filePath.data() + fileNameOffset, fileNameBytesToWrite);
|
||||
if (fileNameOffset > 0)
|
||||
std::memcpy(&header.fileNamePrefix, filePath.data(), fileNameOffset);
|
||||
int permissions = (0400 * fileInfo.permission(QFile::ReadOwner))
|
||||
| (0200 * fileInfo.permission(QFile::WriteOwner))
|
||||
| (0100 * fileInfo.permission(QFile::ExeOwner))
|
||||
|
@@ -32,6 +32,9 @@
|
||||
#include <coreplugin/imode.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <extensionsystem/pluginspec.h>
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
@@ -127,11 +130,10 @@ ProjectModel::ProjectModel(QObject *parent)
|
||||
this,
|
||||
&ProjectModel::resetProjects);
|
||||
|
||||
#ifdef LICENSECHECKER
|
||||
|
||||
if (!Utils::findOrDefault(ExtensionSystem::PluginManager::plugins(),
|
||||
Utils::equal(&ExtensionSystem::PluginSpec::name, QString("LicenseChecker"))))
|
||||
m_communityVersion = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
int ProjectModel::rowCount(const QModelIndex &) const
|
||||
|