Files
qt-migration-legatus/qt5-before/dlbo/Lts/Common/LtsVirtualKeyboard/LtsKeyPushButton.h
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

96 lines
3.9 KiB
C++

/**
* @RDE_HEADER@
* PushPutton for Virtual Keyboard
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2018-06-07
*/
#pragma once
#include <QToolButton>
#include <LtsVirtualKeyboard/ltsvirtualkeyboard_export.h>
#define DEFAULT_BACKGROUND_BUTTON "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #8C8F8C, stop: 1 #333831);"
#define CHANGED_BACKGROUND_BUTTON "background:lightgray;color:darkred;"
//#define DEFAULT_BACKGROUND_BUTTON "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #f6f7fa, stop: 1 #dadbde);"
//#define CHANGED_BACKGROUND_BUTTON "background:lightblue;"
#define DEFAULT_STYLE_BUTTON "color:white;border: 1px solid #000000;border-radius:6px;"
//#define DEFAULT_STYLE_BUTTON "border: 1px solid #8f8f91;border-radius:5px;"
#define STYLE_FOCUS_TEXT "border: 1px solid red"
//#define DEFAULT_STYLE_BUTTON "color:white;border: 2px solid black;border-radius:5px;font-weight: bold;font-size:17px;"
//#define DEFAULT_BACKGROUND_BUTTON "background:gray;"
//#define CHANGED_BACKGROUND_BUTTON "background:red;"
//
namespace LtsVirtualKeyboard
{
class LTSVIRTUALKEYBOARD_EXPORT LtsKeyPushButton : public QToolButton
{
Q_OBJECT
#define KEY_TAB LtsKeyPushButton::tr("TAB")
#define KEY_ALT LtsKeyPushButton::tr("!?#")
#define KEY_ALT2 LtsKeyPushButton::tr("Abc")
#define KEY_CAPS QStringLiteral("CAPS")
#define KEY_CTRL_LEFT LtsKeyPushButton::tr("CTRL")
#define KEY_CUT_LEFT LtsKeyPushButton::tr("cut")
#define KEY_COPY LtsKeyPushButton::tr("copy")
#define KEY_PASTE LtsKeyPushButton::tr("paste")
#define KEY_BACKSPACE LtsKeyPushButton::tr("<--")
#define KEY_HIDECHAR LtsKeyPushButton::tr("echo")
#define KEY_CANC QStringLiteral("->")
#define KEY_RETURN QStringLiteral("RETURN")
#define KEY_FIN QStringLiteral("Ok")
#define KEY_SHIFT QStringLiteral("SHIFT")
#define KEY_SPACE " "
//
#define IS_KEY(keyTextPressed, keyValCompare) (keyTextPressed).contains((keyValCompare), Qt::CaseInsensitive)
#define IS_TAB(text) IS_KEY(text, KEY_TAB)
#define IS_ALT(text) IS_KEY(text, KEY_ALT)
#define IS_ALT2(text) IS_KEY(text, KEY_ALT2)
#define IS_CAPS(text) IS_KEY(text, KEY_CAPS)
#define IS_CTRL_LEFT(text) IS_KEY(text, KEY_CTRL_LEFT)
#define IS_CUT_LEFT(text) IS_KEY(text, KEY_CUT_LEFT)
#define IS_BACK(text) IS_KEY(text, KEY_BACKSPACE)
#define IS_CANC(text) IS_KEY(text, KEY_CANC)
#define IS_RETURN(text) IS_KEY(text, KEY_RETURN)
#define IS_FIN(text) IS_KEY(text, KEY_FIN)
#define IS_SHIFT(text) IS_KEY(text, KEY_SHIFT)
#define IS_SPACE(text) IS_KEY(text, QStringLiteral(KEY_SPACE))
#define IS_PASSWORD(text) IS_KEY(text, KEY_HIDECHAR)
#define IS_COPY(text) IS_KEY(text, KEY_COPY)
#define IS_PASTE(text) IS_KEY(text, KEY_PASTE)
#define NO_SPECIAL_KEY(text) ((text).length() == 1)
public:
LtsKeyPushButton(const QString &notTranslatedText, const QString &notTranslatedTextAlt, QWidget *parent = nullptr);
void setAltMode(bool altmode);
void setCapsMode(bool caps);
private slots:
void getKeyPress();
signals:
void pressedKey();
private:
QWidget *m_parent;
QString m_notTranslatedText;
QString m_notTranslatedTextAlt;
int m_oldYKey;
bool m_altMode;
bool m_capsMode;
protected:
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void changeEvent(QEvent *event);
};
} //namespace LtsVirtualKeyboard