Reinserts original comments

This commit is contained in:
torsten committed 2026-10-14 12:56:16 +00:00
1 parent 1dd1e86355
commit b662e4daf9
112 files changed
+7113 -5131

No files matched your search

@@ -1,15 +1,15 @@
// **************************************************************************
//
// (C) Copyright 2009 Swiss SIMTEC AG
//
// **************************************************************************
//
// $HeadURL$
// $LastChangedBy$
// $LastChangedDate$
// $LastChangedRevision$
//
// **************************************************************************
#include "LogViewValueEdit.hpp"
#include "LogViewField.hpp"
@@ -18,7 +18,7 @@
namespace N_LogView
{
// ---------------------------------------------------------------
LogViewValueEdit::LogViewValueEdit(LogViewField* a_field, QWidget* a_parent, const bool a_readonly)
: QLineEdit(a_parent)
, LogViewWidget(a_field, this, a_parent, a_readonly)
@@ -31,10 +31,10 @@ LogViewValueEdit::LogViewValueEdit(LogViewField* a_field, QWidget* a_parent, con
setText(valueText);
// checkAndOvertakeContent();
updateToolTip(valueText);
// make proper width of widget
QFontMetrics fm(font());
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
setMinimumWidth(fm.width(QLatin1Char(' ') + valueText + QLatin1Char(' ')));
@@ -55,28 +55,28 @@ LogViewValueEdit::LogViewValueEdit(LogViewField* a_field, QWidget* a_parent, con
}
// ---------------------------------------------------------------
void LogViewValueEdit::checkAndOvertakeContent()
{
bool ok;
int64_t intValue = 0;
double floatValue = 0.0;
// get the calculated and checked value
if (m_IsFloat)
floatValue = getFloat(text(), (uint64_t&)intValue, ok);
else
intValue = getInteger(text(), ok);
// handle errors
if (!ok)
{
setFocus();
selectAll();
return;
return; // abort
}
// update
if (m_IsFloat)
setText(QString::number(floatValue));
else
@@ -86,10 +86,10 @@ void LogViewValueEdit::checkAndOvertakeContent()
}
// ---------------------------------------------------------------
// Writes the content into telegram.
// Returns true if successful.
// ---------------------------------------------------------------
bool LogViewValueEdit::saveContent(LogViewTelegram* a_telegram)
{
if (m_Valid)
@@ -97,7 +97,7 @@ bool LogViewValueEdit::saveContent(LogViewTelegram* a_telegram)
bool ok;
if (m_IsFloat)
{
// save the float or double-value
uint64_t valueAsUint64;
const double value = getFloat(text(), valueAsUint64, ok);
if (ok)
@@ -117,7 +117,7 @@ bool LogViewValueEdit::saveContent(LogViewTelegram* a_telegram)
}
else
{
// save the integer-value
qint64 intValue = getInteger(text(), ok);
if (ok)
{
@@ -132,4 +132,4 @@ bool LogViewValueEdit::saveContent(LogViewTelegram* a_telegram)
return false;
}
}
} // namespace N_LogView