Files
qt-migration-legatus/qt5-before/dlbo/Lts/Viewer/SituationMap/Map/text_style.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

205 lines
5.0 KiB
C++

/**
* @RDE_HEADER@
* TextStyle
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
// Own
#include "situation_map_types.h"
#include <situation_map_export.h>
// Qt
#include <QColor>
//----------------------------------------------------------------------------
namespace SituationMap
{
/*!
\brief Horizontal alignment for text.
*/
enum class HorizontalAlignment
{
Left,
Center,
Right,
Justify // ???
};
/*!
\brief Vertical alignment for text.
*/
enum class VerticalAlignment
{
Bottom,
Middle,
Top,
BaseLine
};
/**
* @brief The TextStyle class contains text parameter like color, size, font....
*
* The default TextSymbol size is 15.0.
* The default TextSymbol color is black.
* The default TextSymbol horizontal alignment is left.
* The default TextSymbol vertical alignment is bottom.
*/
class SITUATIONMAP_EXPORT TextStyle final
{
public:
/*! \name Construction, Destruction */
//@{
/**
* @brief Constructor
*/
TextStyle() = default;
/**
* @brief Constructor
*/
explicit TextStyle(const QColor &textColor);
/**
* @brief Constructor
*/
TextStyle(const QColor &textColor, float size);
/**
* @brief Destructor
*/
~TextStyle() = default;
//@}
/** \name Parameters
* Set and get methods for the different parameters.
*/
//@{
QColor textColor() const;
void setTextColor(const QColor &textColor);
float size() const;
void setSize(float size);
float angle() const;
void setAngle(float angleDegree);
const QString &fontFamily() const;
void setFontFamily(const QString &fontFamily);
bool bold() const;
void setBold(bool bold);
bool italic() const;
void setItalic(bool italic);
bool underline() const;
void setUnderline(bool underline);
bool strikeThrough() const;
void setStrikeThrough(bool strikeThrough);
float textOutlineWidth() const;
void setTextOutlineWidth(float textOutlineWidth);
QColor textOutlineColor() const;
void setTextOutlineColor(const QColor &textOutlineColor);
QColor backgroundColor() const;
void setBackgroundColor(const QColor &backgroundColor);
HorizontalAlignment horizontalAlignment() const;
void setHorizontalAlignment(const HorizontalAlignment &horizontalAlignment);
VerticalAlignment verticalAlignment() const;
void setVerticalAlignment(const VerticalAlignment &verticalAlignment);
bool antiAliased() const;
void setAntiAliased(bool antiAliased);
//@}
/**
* @brief operator== Compare two objects
* @param other to be compared with
* @return true if identical, otherwise false.
*/
bool operator==(const TextStyle &other) const
{
return ((this->m_textColor == other.m_textColor) &&
(this->m_size == other.m_size) &&
(this->m_angle == other.m_angle) &&
(this->m_fontFamily == other.m_fontFamily) &&
(this->m_bold == other.m_bold) &&
(this->m_italic == other.m_italic) &&
(this->m_underline == other.m_underline) &&
(this->m_strikeThrough == other.m_strikeThrough) &&
(this->m_textOutlineWidth == other.m_textOutlineWidth) &&
(this->m_textOutlineColor == other.m_textOutlineColor) &&
(this->m_backgroundColor == other.m_backgroundColor) &&
(this->m_horizontalAlignment == other.m_horizontalAlignment) &&
(this->m_verticalAlignment == other.m_verticalAlignment) &&
(this->m_antiAliased == other.m_antiAliased)
);
}
/**
* @brief operator!= Compare two objects
* @param other to be compared with
* @return true if NOT identical, otherwise false.
*/
bool operator!=(const TextStyle &other) const
{
return !(*this == other);
}
private:
QColor m_textColor = Qt::black;
float m_size = 15.0;
float m_angle = 0.0; // degree
QString m_fontFamily;
bool m_bold = false;
bool m_italic = false;
bool m_underline = false;
bool m_strikeThrough = false;
float m_textOutlineWidth = -1;
QColor m_textOutlineColor;
QColor m_backgroundColor; // Invalid is intended
// Alignment
HorizontalAlignment m_horizontalAlignment = HorizontalAlignment::Left;
VerticalAlignment m_verticalAlignment = VerticalAlignment::Bottom;
bool m_antiAliased = true; // Esri 10.2.5: antiAlias = true
};
//-----------------------------------------------------------------------------
// output operator:
//-----------------------------------------------------------------------------
SITUATIONMAP_EXPORT std::ostream &operator<< (std::ostream &stream,
const TextStyle &value);
} // namespace SituationMap