mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-02-01 10:30:08 -05:00
8086cfa731
--User changes -Allow users to set the Exp value when using the Exp temporal filter type. -Set the default temporal filter type to be Box, which does not alter the palette values at all during animation. This is done to avoid confusion when using Gaussian or Exp which can produce darkened images. --Bug fixes -Sending a sequence to the final render dialog when the keyframes had non zero rotate and center Y values would produce off center animations when rendered. -Temporal filters were being unnecessarily recreated many times when rendering or generating sequences. -Exp filter was always treated like a Box filter. --Code changes -Add a new member function SaveCurrentAsXml(QString filename = "") to the controllers which is only used for testing. -Modernize some C++ code.
59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "FractoriumPch.h"
|
|
|
|
/// <summary>
|
|
/// TableWidget class.
|
|
/// </summary>
|
|
|
|
/// <summary>
|
|
/// The purpose of this subclass is to allow for dragging the contents of a table cell.
|
|
/// It's used in the palette preview table.
|
|
/// </summary>
|
|
class TableWidget : public QTableWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
/// <summary>
|
|
/// Constructor that passes the parent to the base and installs
|
|
/// the event filter.
|
|
/// </summary>
|
|
/// <param name="p">The parent widget</param>
|
|
explicit TableWidget(QWidget* p = nullptr)
|
|
: QTableWidget(p)
|
|
{
|
|
viewport()->installEventFilter(this);
|
|
}
|
|
|
|
|
|
signals:
|
|
void MouseDragged(const QPointF& local, const QPoint& global);
|
|
void MouseReleased();
|
|
|
|
protected:
|
|
|
|
/// <summary>
|
|
/// Event filter to handle dragging and releasing the mouse.
|
|
/// Sadly, QTableWidget makes these hard to get to, so we must handle them here.
|
|
/// </summary>
|
|
/// <param name="obj">The object sending the event</param>
|
|
/// <param name="e">The event</param>
|
|
/// <returns>The result of calling the base fucntion.</returns>
|
|
bool eventFilter(QObject* obj, QEvent* e) override
|
|
{
|
|
if (e->type() == QEvent::MouseMove)
|
|
{
|
|
if (const auto me = dynamic_cast<QMouseEvent*>(e))
|
|
{
|
|
emit MouseDragged(me->localPos(), me->globalPos());
|
|
}
|
|
}
|
|
else if (e->type() == QEvent::MouseButtonRelease)
|
|
{
|
|
emit MouseReleased();
|
|
}
|
|
|
|
return QTableWidget::eventFilter(obj, e);
|
|
}
|
|
};
|