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>
126 lines
3.4 KiB
C++
126 lines
3.4 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* ComboBox, optimized for tablets (bigger dropdown/popup and more comfortable completer)
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*
|
|
* Created by Mike Wille, SLSE, 2016-03-09
|
|
*/
|
|
|
|
#include "lts_combo_box.h"
|
|
#include "lts_selection_popup.h"
|
|
#include "lts_message_dialog.h"
|
|
|
|
#include <QGuiApplication>
|
|
#include <QShowEvent>
|
|
|
|
//#define NEVER
|
|
#ifdef NEVER
|
|
# include <QDebug>
|
|
#endif // NEVER
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
|
|
bool LtsComboBox::s_useSelectionDialog = false;
|
|
|
|
LtsComboBox::LtsComboBox(QWidget *parent)
|
|
: QComboBox(parent)
|
|
, m_currentIndex(-1)
|
|
{
|
|
connect(this, &LtsComboBox::signalExternallyChanged,
|
|
this, &LtsComboBox::signalRefill); // sig on sig (to fetch cbx as sender)
|
|
}
|
|
|
|
void LtsComboBox::setUseSelectionDialog(bool bUseSelectionDialog)
|
|
{
|
|
s_useSelectionDialog = bUseSelectionDialog;
|
|
}
|
|
|
|
void LtsComboBox::showEvent(QShowEvent *e)
|
|
{
|
|
QComboBox::showEvent(e);
|
|
|
|
m_currentIndex = currentIndex();
|
|
}
|
|
|
|
void LtsComboBox::enterEvent(QEvent *e)
|
|
{
|
|
BaseClass::enterEvent(e);
|
|
emit signalEnterEvent();
|
|
}
|
|
|
|
void LtsComboBox::leaveEvent(QEvent *e)
|
|
{
|
|
BaseClass::leaveEvent(e);
|
|
emit signalLeaveEvent();
|
|
}
|
|
|
|
void LtsComboBox::showPopup()
|
|
{
|
|
bool bUseSelectionDialog = s_useSelectionDialog;
|
|
if (QGuiApplication::queryKeyboardModifiers() == Qt::ControlModifier)
|
|
bUseSelectionDialog = !bUseSelectionDialog;
|
|
if (!bUseSelectionDialog)
|
|
{
|
|
QComboBox::showPopup(); // show original popup when CTRL is pressed
|
|
return;
|
|
}
|
|
|
|
if (!model()->rowCount()) // nothing to show? tell the user.
|
|
{
|
|
LtsWidgets::LtsMessageDialog::showMessage(this, tr("There are no items available!"));
|
|
return;
|
|
}
|
|
|
|
// create the touch-friendly, screen-centered custom popup and show it
|
|
LtsSelectionPopup* popup = new LtsSelectionPopup(model(), currentIndex(), this);
|
|
popup->setAttribute(Qt::WA_DeleteOnClose); // dialog must delete itself, as there is no Dialog Helper
|
|
|
|
#ifdef NEVER
|
|
// debugging :
|
|
// // highlighted -> UserInteraction
|
|
// connect(popup, static_cast<void (LtsSelectionPopup::*)(int)>(&LtsSelectionPopup::highlighted), this, [](int idx){
|
|
// qCritical() << " LtsComboBox: called: highlighted(int), idx=" << idx;
|
|
// });
|
|
|
|
// currentIndexChanged -> programmatically & UserInteraction
|
|
connect(popup, static_cast<void (LtsSelectionPopup::*)(int)>(&LtsSelectionPopup::currentIndexChanged), this, [](int idx){
|
|
qCritical() << " LtsComboBox: called: currentIndexChanged(int), idx=" << idx;
|
|
});
|
|
|
|
// activated -> UserInteraction
|
|
connect(popup, static_cast<void (LtsSelectionPopup::*)(int)>(&LtsSelectionPopup::activated), this, [](int idx){
|
|
qCritical() << " LtsComboBox: called: activated(int), idx=" << idx;
|
|
});
|
|
// : debugging
|
|
#endif // NEVER
|
|
|
|
// Although we derive from QComboBox, there seems to be no signal emitted implicitly.
|
|
// Therefore we have to listen to our popup:
|
|
connect(popup, &LtsSelectionPopup::currentIndexChanged,
|
|
this, &LtsComboBox::userChangedIndex); // listen on changes
|
|
connect(popup, &LtsSelectionPopup::activated,
|
|
this, static_cast<void (LtsComboBox::*)(int)>(&LtsComboBox::activated)); // SIGNAL on SIGNAL !
|
|
|
|
popup->show();
|
|
}
|
|
|
|
|
|
void LtsComboBox::userChangedIndex(int index)
|
|
{
|
|
m_currentIndex = index;
|
|
setCurrentIndex(index);
|
|
}
|
|
|
|
|
|
bool LtsComboBox::hasValueChanged() const
|
|
{
|
|
if (m_currentIndex == -1)
|
|
return false;
|
|
return !(currentIndex() == m_currentIndex);
|
|
}
|
|
|
|
} // namespace LtsWidgets
|