mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 05:00:06 -05:00
1dfbd4eff2
-Add new preset dimensions to the right click menu of the width and height fields in the editor. -Change QSS stylesheets to properly handle tabs. -Make tabs rectangular by default. For some reason, they had always been triangular. --Bug fixes -Incremental rendering times in the editor were wrong. --Code changes -Migrate to Qt6. There is probably more work to be done here. -Migrate to VS2022. -Migrate to Wix 4 installer. -Change installer to install to program files for all users. -Fix many VS2022 code analysis warnings. -No longer use byte typedef, because std::byte is now a type. Revert all back to unsigned char. -Upgrade OpenCL headers to version 3.0 and keep locally now rather than trying to look for system files. -No longer link to Nvidia or AMD specific OpenCL libraries. Use the generic installer located at OCL_ROOT too. -Add the ability to change OpenCL grid dimensions. This was attempted for investigating possible performance improvments, but made no difference. This has not been verified on Linux or Mac yet.
55 lines
1.4 KiB
C++
55 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 QPointF& 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<const QMouseEvent*>(e))
|
|
emit MouseDragged(me->position(), me->globalPosition());
|
|
}
|
|
else if (e->type() == QEvent::MouseButtonRelease)
|
|
emit MouseReleased();
|
|
|
|
return QTableWidget::eventFilter(obj, e);
|
|
}
|
|
};
|