Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/GUI/BoxesList/boolpropertywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void BoolPropertyWidget::paintEvent(QPaintEvent *) {
p.end();
}

void BoolPropertyWidget::enterEvent(QEvent *) {
void BoolPropertyWidget::enterEvent(QtEnterEvent *) {
mHovered = true;
update();
}
Expand Down
3 changes: 2 additions & 1 deletion src/app/GUI/BoxesList/boolpropertywidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QWidget>
#include "Properties/boolproperty.h"
#include "Properties/boolpropertycontainer.h"
#include "../ui/enterevent.h"

class BoolPropertyWidget : public QWidget {
Q_OBJECT
Expand All @@ -40,7 +41,7 @@ class BoolPropertyWidget : public QWidget {
protected:
void mousePressEvent(QMouseEvent *);
void paintEvent(QPaintEvent *);
void enterEvent(QEvent *);
void enterEvent(QtEnterEvent *);
void leaveEvent(QEvent *);
private:
bool mHovered = false;
Expand Down
37 changes: 26 additions & 11 deletions src/app/GUI/BoxesList/boxscroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,22 @@ void BoxScroller::stopScrolling() {
}
}

void BoxScroller::dropEvent(QDropEvent *event) {
void BoxScroller::dropEvent(QDropEvent *event)
{
stopScrolling();
mCurrentMimeData = event->mimeData();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
mLastDragMoveY = event->pos().y();
#else
mLastDragMoveY = event->position().toPoint().y();
#endif
updateDropTarget();
if(mDropTarget.isValid()) {
if (mDropTarget.isValid()) {
const auto targetAbs = mDropTarget.fTargetParent;
const auto target = targetAbs->getTarget();
if(mDropTarget.fDropType == DropType::on) {
if (mDropTarget.fDropType == DropType::on) {
target->SWT_drop(mCurrentMimeData);
} else if(mDropTarget.fDropType == DropType::into) {
} else if (mDropTarget.fDropType == DropType::into) {
target->SWT_dropInto(mDropTarget.fTargetId, mCurrentMimeData);
}
planScheduleUpdateVisibleWidgetsContent();
Expand All @@ -200,13 +205,18 @@ void BoxScroller::dropEvent(QDropEvent *event) {
mDropTarget.reset();
}

void BoxScroller::dragEnterEvent(QDragEnterEvent *event) {
void BoxScroller::dragEnterEvent(QDragEnterEvent *event)
{
const auto mimeData = event->mimeData();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
mLastDragMoveY = event->pos().y();
#else
mLastDragMoveY = event->position().toPoint().y();
#endif
mCurrentMimeData = mimeData;
updateDropTarget();
//mDragging = true;
if(mCurrentMimeData) event->acceptProposedAction();
if (mCurrentMimeData) { event->acceptProposedAction(); }
update();
}

Expand All @@ -218,18 +228,23 @@ void BoxScroller::dragLeaveEvent(QDragLeaveEvent *event) {
update();
}

void BoxScroller::dragMoveEvent(QDragMoveEvent *event) {
void BoxScroller::dragMoveEvent(QDragMoveEvent *event)
{
event->acceptProposedAction();
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
const int yPos = event->pos().y();
#else
const int yPos = event->position().toPoint().y();
#endif

if(yPos < 30) {
if(!mScrollTimer->isActive()) {
if (yPos < 30) {
if (!mScrollTimer->isActive()) {
connect(mScrollTimer, &QTimer::timeout,
this, &BoxScroller::scrollUp);
mScrollTimer->start(300);
}
} else if(yPos > height() - 30) {
if(!mScrollTimer->isActive()) {
} else if (yPos > height() - 30) {
if (!mScrollTimer->isActive()) {
connect(mScrollTimer, &QTimer::timeout,
this, &BoxScroller::scrollDown);
mScrollTimer->start(300);
Expand Down
8 changes: 6 additions & 2 deletions src/app/GUI/BoxesList/boxsinglewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,11 @@ void BoxSingleWidget::mousePressEvent(QMouseEvent *event) {
PropertyMenu pMenu(&menu, mParent->currentScene(), MainWindow::sGetInstance());
pTarget->prp_setupTreeViewMenu(&pMenu);
}
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
menu.exec(event->globalPos());
#else
menu.exec(event->globalPosition().toPoint());
#endif
setSelected(false);
} else {
mDragPressPos = event->pos().x() > mFillWidget->x();
Expand Down Expand Up @@ -713,7 +717,7 @@ void BoxSingleWidget::mouseReleaseEvent(QMouseEvent *event)
const auto target = mTarget->getTarget();

const auto bbox = enve_cast<BoundingBox*>(target);
if (event->button() == Qt::MidButton && bbox) {
if (event->button() == Qt::MiddleButton && bbox) {
PropertyNameDialog::sRenameBox(bbox, this);
return;
}
Expand All @@ -734,7 +738,7 @@ void BoxSingleWidget::mouseReleaseEvent(QMouseEvent *event)
}
}

void BoxSingleWidget::enterEvent(QEvent *)
void BoxSingleWidget::enterEvent(QtEnterEvent *)
{
#ifdef Q_OS_MAC
setFocus();
Expand Down
4 changes: 3 additions & 1 deletion src/app/GUI/BoxesList/boxsinglewidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include "smartPointers/ememory.h"
#include "framerange.h"
#include "Animators/SmartPath/smartpathanimator.h"
#include "../ui/enterevent.h"

class QrealAnimatorValueSlider;
class TimelineMovable;
class Key;
Expand Down Expand Up @@ -101,7 +103,7 @@ class BoxSingleWidget : public SingleWidget {
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);

void enterEvent(QEvent *);
void enterEvent(QtEnterEvent *);
void leaveEvent(QEvent *);

#ifdef Q_OS_MAC
Expand Down
57 changes: 32 additions & 25 deletions src/app/GUI/Expressions/expressiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,35 +554,42 @@ void ExpressionDialog::updateScriptDefinitions()
}

{
QRegExp funcDefs("(class|function)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(\\([a-zA-Z0-9_, ]*\\))");
int pos = 0;
while ((pos = funcDefs.indexIn(scriptContext, pos)) != -1) {
QStringList funcs = funcDefs.capturedTexts();
for (int i = 2; i < funcs.count() - 1; i += 3) {
const auto& func = funcs.at(i);
const auto& funcArgs = funcs.at(i + 1);
if (func.isEmpty()) { continue; }
mScriptApi->add(func + funcArgs);
mScriptLexer->addDefinition(func);
mDefsLexer->addDefinition(func);
}
pos += funcDefs.matchedLength();
QRegularExpression funcDefs("(class|function)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*(\\([a-zA-Z0-9_, ]*\\))");
auto matchIterator = funcDefs.globalMatch(scriptContext);

while (matchIterator.hasNext()) {
QRegularExpressionMatch match = matchIterator.next();
QStringList funcs = match.capturedTexts();

for (int i = 2; i < funcs.count() - 1; i += 3) {
const auto& func = funcs.at(i);
const auto& funcArgs = funcs.at(i + 1);
if (func.isEmpty()) { continue; }

mScriptApi->add(func + funcArgs);
mScriptLexer->addDefinition(func);
mDefsLexer->addDefinition(func);
}
}
}

{
QRegExp varDefs("([a-zA-Z_][a-zA-Z0-9_]*)\\s*=\\s*(?!=)");
int pos = 0;
while ((pos = varDefs.indexIn(scriptContext, pos)) != -1) {
QStringList vars = varDefs.capturedTexts();
for (int i = 1; i < vars.count(); i++) {
const auto& var = vars.at(i);
if (var.isEmpty()) { continue; }
mScriptApi->add(var);
mScriptLexer->addDefinition(var);
mDefsLexer->addDefinition(var);
}
pos += varDefs.matchedLength();
QRegularExpression varDefs("([a-zA-Z_][a-zA-Z0-9_]*)\\s*=\\s*(?!=)");

auto matchIterator = varDefs.globalMatch(scriptContext);

while (matchIterator.hasNext()) {
QRegularExpressionMatch match = matchIterator.next();
QStringList vars = match.capturedTexts();

for (int i = 1; i < vars.count(); i++) {
const auto& var = vars.at(i);
if (var.isEmpty()) { continue; }

mScriptApi->add(var);
mScriptLexer->addDefinition(var);
mDefsLexer->addDefinition(var);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/Expressions/expressioneditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void ExpressionEditor::keyPressEvent(QKeyEvent *e) {
} else if(key == Qt::Key_Tab) {
return QWidget::keyPressEvent(e);
} else QTextEdit::keyPressEvent(e);
const bool input = e->text().contains(QRegExp("[A-Za-z0-9_ \\.\\$]"));
const bool input = e->text().contains(QRegularExpression("[A-Za-z0-9_ \\.\\$]"));
const bool deletion = key == Qt::Key_Delete ||
key == Qt::Key_Backspace;
const bool arrows = key == Qt::Key_Right ||
Expand Down
2 changes: 0 additions & 2 deletions src/app/GUI/RenderWidgets/closablecontainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ ClosableContainer::ClosableContainer(QWidget *parent) : QWidget(parent) {
mVLayout->addWidget(mContWidget);
mContWidget->setContentsMargins(0, 0, 0, 0);
mContWidget->setLayout(mContLayout);
//mContLayout->setMargin(0);
mContLayout->setAlignment(Qt::AlignTop);
mContLayout->setContentsMargins(0, 0, 0, 0);
mContLayout->setSpacing(0);
mVLayout->setSpacing(0);
mVLayout->setMargin(0);
mVLayout->setContentsMargins(0, 0, 0, 0);
setContentVisible(false);
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/GUI/RenderWidgets/outputsettingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ void OutputSettingsDialog::setupFormatOptionsTree()

container->setContentsMargins(10, 0, 10, 0);
container->setMinimumHeight(150);
containerLayout->setMargin(0);
containerLayout->setContentsMargins(0, 0, 0, 0);
containerLayout->addWidget(area);

containerInner->setContentsMargins(0, 0, 0, 0);
containerInnerLayout->setMargin(0);
containerInnerLayout->setContentsMargins(0, 0, 0, 0);

mFormatOptionsTree->setHeaderLabels(QStringList()
<< tr("Type")
Expand Down Expand Up @@ -436,7 +436,7 @@ void OutputSettingsDialog::setupFormatOptionsTree()
});

showHideWidget->setContentsMargins(0, 0, 10, 0);
showHideLayout->setMargin(0);
showHideLayout->setContentsMargins(0, 0, 0, 0);
showHideLayout->addStretch();
showHideLayout->addWidget(showHideButton);

Expand Down
11 changes: 6 additions & 5 deletions src/app/GUI/RenderWidgets/renderinstancewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "outputsettingsprofilesdialog.h"
#include "outputsettingsdisplaywidget.h"
#include "rendersettingsdisplaywidget.h"
#include "Private/esettings.h"
#include "GUI/edialogs.h"

#include "appsupport.h"
Expand Down Expand Up @@ -142,7 +141,7 @@ void RenderInstanceWidget::iniGUI()
QWidget *outputSettingsOptWidget = new QWidget(this);
outputSettingsOptWidget->setContentsMargins(0, 0, 0, 0);
const auto outputSettingsOptLayout = new QHBoxLayout(outputSettingsOptWidget);
outputSettingsOptLayout->setMargin(0);
outputSettingsOptLayout->setContentsMargins(0, 0, 0, 0);
outputSettingsOptLayout->addWidget(mOutputSettingsProfilesButton);
outputSettingsOptLayout->addWidget(mOutputSettingsButton);

Expand Down Expand Up @@ -193,7 +192,7 @@ void RenderInstanceWidget::iniGUI()
QWidget *outputDestinationWidget = new QWidget(this);
outputDestinationWidget->setContentsMargins(0, 0, 0, 0);
const auto outputDesinationLayout = new QHBoxLayout(outputDestinationWidget);
outputDesinationLayout->setMargin(0);
outputDesinationLayout->setContentsMargins(0, 0, 0, 0);

outputDesinationLayout->addWidget(mOutputDestinationButton);
outputDesinationLayout->addWidget(mOutputDestinationLineEdit);
Expand All @@ -203,7 +202,6 @@ void RenderInstanceWidget::iniGUI()

mContentLayout->addWidget(outputSettingsLabelWidget);

mContentLayout->setMargin(0);
mContentLayout->setSpacing(0);
mContentLayout->setContentsMargins(0, 0, 0, 0);
}
Expand Down Expand Up @@ -284,7 +282,11 @@ void RenderInstanceWidget::mousePressEvent(QMouseEvent *e)
delAct->setData(1);
delAct->setEnabled(deletable);

#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
const auto act = menu.exec(e->globalPos());
#else
const auto act = menu.exec(e->globalPosition().toPoint());
#endif
if (act) {
switch (act->data().toInt()) {
case 0:
Expand Down Expand Up @@ -489,7 +491,6 @@ void RenderInstanceWidget::updateRenderSettings()
updateFromSettings();
}

#include "Private/esettings.h"
OutputProfilesListButton::OutputProfilesListButton(RenderInstanceWidget *parent) :
QPushButton(parent) {
mParentWidget = parent;
Expand Down
4 changes: 2 additions & 2 deletions src/app/GUI/RenderWidgets/renderwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RenderWidget::RenderWidget(QWidget *parent)
, mState(RenderState::none)
{
mMainLayout = new QVBoxLayout(this);
mMainLayout->setMargin(0);
mMainLayout->setContentsMargins(0, 0, 0, 0);
mMainLayout->setSpacing(0);
setLayout(mMainLayout);

Expand Down Expand Up @@ -131,7 +131,7 @@ RenderWidget::RenderWidget(QWidget *parent)
mContWidget->setContentsMargins(0, 0, 0, 0);
mContLayout = new QVBoxLayout(mContWidget);
mContLayout->setAlignment(Qt::AlignTop);
mContLayout->setMargin(0);
mContLayout->setContentsMargins(0, 0, 0, 0);
mContLayout->setSpacing(0);
mContWidget->setLayout(mContLayout);
mScrollArea = new ScrollArea(this);
Expand Down
3 changes: 1 addition & 2 deletions src/app/GUI/Settings/generalsettingswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget *parent)
mAutoSaveWidget->setContentsMargins(0, 0, 0, 0);
const auto mAutoSaveLayout = new QHBoxLayout(mAutoSaveWidget);
mAutoSaveLayout->setContentsMargins(0, 0, 0, 0);
mAutoSaveLayout->setMargin(0);
mAutoSaveLayout->setContentsMargins(0, 0, 0, 0);

mAutoSave = new QCheckBox(tr("Enable Auto Save"), this);
mAutoSave->setCheckable(true);
Expand Down Expand Up @@ -147,7 +147,6 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget *parent)
mImportFileWidget->setContentsMargins(0, 0, 0, 0);
const auto mImportFileLayout = new QHBoxLayout(mImportFileWidget);
mImportFileLayout->setContentsMargins(0, 0, 0, 0);
mImportFileLayout->setMargin(0);

const auto mImportFileLabel = new QLabel(tr("Default import directory"), this);
mImportFileDir = new QComboBox(this);
Expand Down
4 changes: 2 additions & 2 deletions src/app/GUI/canvaswindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CanvasWindow : public GLWindow, public KeyFocusTarget
QWidget * const parent = nullptr);
~CanvasWindow();
Canvas *getCurrentCanvas();
const QMatrix& getViewTransform() const
const QTransform& getViewTransform() const
{ return mViewTransform; }

void setCurrentCanvas(Canvas * const canvas);
Expand Down Expand Up @@ -132,7 +132,7 @@ class CanvasWindow : public GLWindow, public KeyFocusTarget
Actions& mActions;

QSize mOldSize{-1, -1};
QMatrix mViewTransform;
QTransform mViewTransform;
QPointF mPrevMousePos;
QPointF mPrevPressPos;
//bool mValidPaintTarget = false;
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/graphboxeslist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void KeysView::graphPaint(QPainter *p) {

p->setRenderHint(QPainter::Antialiasing);

QMatrix transform;
QTransform transform;
transform.translate(-mPixelsPerFrame*(mMinViewedFrame - 0.5),
height() + mPixelsPerValUnit*mMinShownVal);
transform.scale(mPixelsPerFrame, -mPixelsPerValUnit);
Expand Down
2 changes: 1 addition & 1 deletion src/app/GUI/keysview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void KeysView::wheelEvent(QWheelEvent *e)
}
#endif

const QPoint pos = e->pos();
const QPoint pos = e->position().toPoint();
const QPoint posU = pos + QPoint(-eSizesUI::widget/2, 0);
const qreal currentHoverFrame = static_cast<qreal>(posU.x()) / mPixelsPerFrame + mMinViewedFrame;
// qDebug() << "currentHoverFrame" << currentHoverFrame;
Expand Down
Loading
Loading