From 335e3d8dd129521185ebcfced51122e49efb1443 Mon Sep 17 00:00:00 2001 From: Stanislav Ratseburzhinsky <rsl@viedu.ru> Date: Fri, 25 Feb 2022 14:30:48 +0500 Subject: [PATCH 1/3] bugs-5617|[*]The bug report field cannot be changed if the number of characters is 200 --- forms/ui/bugreports.cpp | 32 ++++++++++++++++++++++---------- forms/ui/bugreports.h | 1 + 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/forms/ui/bugreports.cpp b/forms/ui/bugreports.cpp index 2424d5444..786f50846 100644 --- a/forms/ui/bugreports.cpp +++ b/forms/ui/bugreports.cpp @@ -267,25 +267,37 @@ void BugReports::updateData (QString &a_text, int a_len) /* check if limit reachced */ if(a_text.length() <= MAX_LENGTH) + { + m_bugReportText = a_text; return; + } _textHook = true; /* fix text length */ - int diff = a_text.length() - MAX_LENGTH; - a_text.chop (diff); - m_edit->setPlainText (a_text); +// int diff = a_text.length() - MAX_LENGTH; +// a_text.chop (diff); + int position = m_edit->textCursor().position(); + qDebug() << m_edit->textCursor().position(); + qDebug() << a_text; + qDebug() << m_bugReportText; + m_edit->setPlainText(m_bugReportText); + QTextCursor cur = m_edit->textCursor(); + cur.setPosition(position-1); + m_edit->setTextCursor(cur); + qDebug() << m_edit->textCursor().position(); + /* kill focus */ - ui->editReport->unfocus(); - QGuiApplication::inputMethod()->hide(); +// ui->editReport->unfocus(); +// QGuiApplication::inputMethod()->hide(); /* fix cursor pos */ - QMetaObject::invokeMethod(this, [=] () { - auto cur = m_edit->textCursor(); - cur.movePosition (QTextCursor::End, QTextCursor::MoveAnchor); - m_edit->setTextCursor (cur); - }, Qt::QueuedConnection); +// QMetaObject::invokeMethod(this, [=] () { +// auto cur = m_edit->textCursor(); +// cur.movePosition (QTextCursor::End, QTextCursor::MoveAnchor); +// m_edit->setTextCursor (cur); +// }, Qt::QueuedConnection); _textHook = false; } diff --git a/forms/ui/bugreports.h b/forms/ui/bugreports.h index df1e5a76e..c0443e382 100644 --- a/forms/ui/bugreports.h +++ b/forms/ui/bugreports.h @@ -74,6 +74,7 @@ private: /// testing radio map @see slotRadioTest QMap<QObject *, Mode> p_radioTestToMode; bool _textHook, _spacer; + QString m_bugReportText; /// @} /****************************************//** -- GitLab From 836e39ab90be9497688a179a42fefe8c270ae1f5 Mon Sep 17 00:00:00 2001 From: Stanislav Ratseburzhinsky <rsl@viedu.ru> Date: Fri, 25 Feb 2022 22:08:47 +0500 Subject: [PATCH 2/3] Increased the height of the error field in dashboard interface to be able to show three lines --- forms/ui/brand_ui/KelVPN/dashboard.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/forms/ui/brand_ui/KelVPN/dashboard.ui b/forms/ui/brand_ui/KelVPN/dashboard.ui index d555631e4..5f2b6156b 100644 --- a/forms/ui/brand_ui/KelVPN/dashboard.ui +++ b/forms/ui/brand_ui/KelVPN/dashboard.ui @@ -191,13 +191,13 @@ <property name="minimumSize"> <size> <width>0</width> - <height>95</height> + <height>120</height> </size> </property> <property name="maximumSize"> <size> <width>16777215</width> - <height>95</height> + <height>120</height> </size> </property> <property name="styleSheet"> -- GitLab From 1cbd5e301d9d4199e876893da1155410aec8807f Mon Sep 17 00:00:00 2001 From: Stanislav Ratseburzhinsky <rsl@viedu.ru> Date: Fri, 25 Feb 2022 22:18:54 +0500 Subject: [PATCH 3/3] bugs-5617|[*]Removed debug information --- forms/ui/bugreports.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/forms/ui/bugreports.cpp b/forms/ui/bugreports.cpp index 786f50846..216d7b83e 100644 --- a/forms/ui/bugreports.cpp +++ b/forms/ui/bugreports.cpp @@ -275,29 +275,11 @@ void BugReports::updateData (QString &a_text, int a_len) _textHook = true; /* fix text length */ -// int diff = a_text.length() - MAX_LENGTH; -// a_text.chop (diff); int position = m_edit->textCursor().position(); - qDebug() << m_edit->textCursor().position(); - qDebug() << a_text; - qDebug() << m_bugReportText; m_edit->setPlainText(m_bugReportText); QTextCursor cur = m_edit->textCursor(); cur.setPosition(position-1); m_edit->setTextCursor(cur); - qDebug() << m_edit->textCursor().position(); - - - /* kill focus */ -// ui->editReport->unfocus(); -// QGuiApplication::inputMethod()->hide(); - - /* fix cursor pos */ -// QMetaObject::invokeMethod(this, [=] () { -// auto cur = m_edit->textCursor(); -// cur.movePosition (QTextCursor::End, QTextCursor::MoveAnchor); -// m_edit->setTextCursor (cur); -// }, Qt::QueuedConnection); _textHook = false; } -- GitLab