Qt6 migration: LtsWidgets API fixes, LtsWebSocket logger init, RTI Docker install
- LtsWidgets: Fixed Qt6 API compatibility issues - QWheelEvent::delta() → angleDelta().y() - QStyleOption::init() → initFrom() - QComboBox activated signal signature change - QTextCodec removal (UTF-8 default in Qt6) - Missing widget includes added - LtsWebSocket: Fixed m_logger reference initialization - Added NGLLoggerBootstrap includes - Proper initialization in constructor initializer lists - CMake: Added BUILD_LTSWEBSOCKET option for temporary exclusion - Docker: RTI Connext permanent installation script added - ci/install-rti-in-docker.sh for persistent RTI setup - Removes need for volume mounting RTI into container - BUILD options: FilterManagement, RTI, Codification, Grantlee, LtsWebSocket can be disabled for partial builds during migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
69 files changed
+12765
-14202
No files matched your search
Executable → Regular
+69
-84
@@ -1,116 +1,101 @@
|
||||
|
||||
|
||||
|
||||
#include "lts_image_editor.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QPaintEvent>
|
||||
#include <QBrush>
|
||||
#include <QEvent>
|
||||
#include <QPaintEvent>
|
||||
#include <QPainter>
|
||||
#include <QPen>
|
||||
#include <QRect>
|
||||
#include <QEvent>
|
||||
|
||||
using namespace LtsWidgets;
|
||||
|
||||
|
||||
LtsImageEditor::LtsImageEditor(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_isHovered(false)
|
||||
, m_menuEnabled(true)
|
||||
, m_bDrawOuterRect(true)
|
||||
{}
|
||||
|
||||
|
||||
void LtsImageEditor::setPixmap(const QPixmap &pixmap)
|
||||
LtsImageEditor::LtsImageEditor(QWidget* parent)
|
||||
: QWidget(parent), m_isHovered(false), m_menuEnabled(true), m_bDrawOuterRect(true)
|
||||
{
|
||||
if (pixmap.isNull())
|
||||
m_pixmap = QPixmap(QStringLiteral(":style/noimage.png"));
|
||||
else
|
||||
m_pixmap = pixmap;
|
||||
|
||||
update();
|
||||
emit imageChanged();
|
||||
}
|
||||
|
||||
|
||||
void LtsImageEditor::enterEvent(QEvent *)
|
||||
void LtsImageEditor::setPixmap(const QPixmap& pixmap)
|
||||
{
|
||||
|
||||
m_isHovered = true;
|
||||
update();
|
||||
}
|
||||
if (pixmap.isNull())
|
||||
m_pixmap = QPixmap(QStringLiteral(":style/noimage.png"));
|
||||
else
|
||||
m_pixmap = pixmap;
|
||||
|
||||
|
||||
void LtsImageEditor::leaveEvent(QEvent *)
|
||||
{
|
||||
|
||||
m_isHovered = false;
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
bool LtsImageEditor::event(QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonPress && m_menuEnabled)
|
||||
{
|
||||
emit signalClicked();
|
||||
event->accept();
|
||||
m_isHovered = false;
|
||||
update();
|
||||
return true;
|
||||
}
|
||||
|
||||
return QWidget::event(event);
|
||||
emit imageChanged();
|
||||
}
|
||||
|
||||
|
||||
void LtsImageEditor::paintEvent(QPaintEvent* event)
|
||||
void LtsImageEditor::enterEvent(QEnterEvent*)
|
||||
{
|
||||
QPainter p(this);
|
||||
|
||||
|
||||
p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
|
||||
QBrush brush = QColor(QStringLiteral("white"));
|
||||
m_isHovered = true;
|
||||
update();
|
||||
}
|
||||
|
||||
void LtsImageEditor::leaveEvent(QEvent*)
|
||||
{
|
||||
|
||||
if (!m_pixmap.isNull())
|
||||
{
|
||||
if (!(m_isHovered && m_menuEnabled))
|
||||
m_isHovered = false;
|
||||
update();
|
||||
}
|
||||
|
||||
bool LtsImageEditor::event(QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonPress && m_menuEnabled)
|
||||
{
|
||||
const QSize s(size());
|
||||
const QPixmap pixmap(m_pixmap.scaled(s, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
const int x = qRound((s.width() - pixmap.width()) / 2.);
|
||||
const int y = qRound((s.height() - pixmap.height()) / 2.);
|
||||
if (m_bDrawOuterRect)
|
||||
{
|
||||
p.setPen(QPen(QColor("gray"), 2));
|
||||
p.drawRect(rect());
|
||||
}
|
||||
p.drawPixmap(x, y, pixmap);
|
||||
event->accept();
|
||||
return;
|
||||
emit signalClicked();
|
||||
event->accept();
|
||||
m_isHovered = false;
|
||||
update();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
|
||||
p.setPen(QPen(QColor("gray"), 2));
|
||||
p.setBrush(brush);
|
||||
p.drawRect(rect());
|
||||
void LtsImageEditor::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QPainter p(this);
|
||||
|
||||
p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
|
||||
QBrush brush = QColor(QStringLiteral("white"));
|
||||
|
||||
|
||||
if (m_isHovered && m_menuEnabled)
|
||||
{
|
||||
p.setPen(QPen(QColor(QStringLiteral("gray")), (size().height() / 48 * 2)));
|
||||
if (!m_pixmap.isNull())
|
||||
{
|
||||
if (!(m_isHovered && m_menuEnabled))
|
||||
{
|
||||
const QSize s(size());
|
||||
const QPixmap pixmap(m_pixmap.scaled(s, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
const int x = qRound((s.width() - pixmap.width()) / 2.);
|
||||
const int y = qRound((s.height() - pixmap.height()) / 2.);
|
||||
if (m_bDrawOuterRect)
|
||||
{
|
||||
p.setPen(QPen(QColor("gray"), 2));
|
||||
p.drawRect(rect());
|
||||
}
|
||||
p.drawPixmap(x, y, pixmap);
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
double xc = size().width()/2.012;
|
||||
double yc = size().height()/2.012;
|
||||
p.setPen(QPen(QColor("gray"), 2));
|
||||
p.setBrush(brush);
|
||||
p.drawRect(rect());
|
||||
|
||||
p.drawLine(QPointF(xc - (xc/2.01f), yc - (yc/3.01f)), QPointF(xc + (xc/2.02f), yc - (yc/3.02f)));
|
||||
p.drawLine(QPointF(xc - (xc/2.01f), yc - 0.01f), QPointF(xc + (xc/2.02f), yc - 0));
|
||||
p.drawLine(QPointF(xc - (xc/2.01f), yc + (yc/3.01f)), QPointF(xc + (xc/2.02f), yc + (yc/3.02f)));
|
||||
}
|
||||
if (m_isHovered && m_menuEnabled)
|
||||
{
|
||||
p.setPen(QPen(QColor(QStringLiteral("gray")), (size().height() / 48 * 2)));
|
||||
|
||||
double xc = size().width() / 2.012;
|
||||
double yc = size().height() / 2.012;
|
||||
|
||||
p.drawLine(QPointF(xc - (xc / 2.01f), yc - (yc / 3.01f)), QPointF(xc + (xc / 2.02f), yc - (yc / 3.02f)));
|
||||
p.drawLine(QPointF(xc - (xc / 2.01f), yc - 0.01f), QPointF(xc + (xc / 2.02f), yc - 0));
|
||||
p.drawLine(QPointF(xc - (xc / 2.01f), yc + (yc / 3.01f)), QPointF(xc + (xc / 2.02f), yc + (yc / 3.02f)));
|
||||
}
|
||||
|
||||
event->accept();
|
||||
event->accept();
|
||||
}
|
||||
Reference in new issue
Block a user