fix Warning
This commit is contained in:
1 parent
593c221d23
commit
8345470273
316 files changed
+1246
-929
No files matched your search
@@ -49,6 +49,7 @@ void LtsAbstractSequenceWidget::getValue(QWidget *data,
|
||||
return;
|
||||
|
||||
data = findChild<QWidget *>(findObjectName);
|
||||
Q_UNUSED(data);
|
||||
}
|
||||
|
||||
void LtsAbstractSequenceWidget::setMemberCount(int count)
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <QtWidgets/QCheckBox>
|
||||
#include <QtWidgets/QCompleter>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QTimeZone>
|
||||
#include <QtWidgets/QGridLayout>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtGui/QKeyEvent>
|
||||
@@ -248,7 +249,7 @@ int getItemValue(QSpinBox *spinBox)
|
||||
LtsDateTimeEdit::LtsDateTimeEdit(QWidget *parent, bool withNowButton, bool checkable)
|
||||
: QWidget(parent)
|
||||
// , m_uiLe(new Ui::LtsDateTimeEditLe)
|
||||
, m_scFixed(new QShortcut(QKeySequence(Qt::ShiftModifier + Qt::Key_F2), this, SLOT(setFixedDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
|
||||
, m_scFixed(new QShortcut(QKeySequence(Qt::ShiftModifier | Qt::Key_F2), this, SLOT(setFixedDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
|
||||
, m_scOffset(new QShortcut(QKeySequence(Qt::Key_F2), this, SLOT(setOffsetDateTime()), nullptr, Qt::WidgetWithChildrenShortcut))
|
||||
, m_checkable(checkable) // see below
|
||||
, m_withNowButton(withNowButton) // see below
|
||||
@@ -551,7 +552,7 @@ bool LtsDateTimeEdit::setMsecsSinceEpoch(qint64 msec, bool setToNearestPossible)
|
||||
m_curTimeMSec = msec;
|
||||
|
||||
const qint64 offsetTimeZoneMsec = getTimezoneAsSecs() * 1000;
|
||||
const QDateTime datetime(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec + offsetTimeZoneMsec, Qt::UTC));
|
||||
const QDateTime datetime(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec + offsetTimeZoneMsec, QTimeZone(0)));
|
||||
const QDate date(datetime.date());
|
||||
const QTime time(datetime.time());
|
||||
|
||||
@@ -940,7 +941,7 @@ bool LtsDateTimeEdit::isDataAcceptable()
|
||||
return false;
|
||||
}
|
||||
|
||||
qint64 msec = QDateTime(QDate(getYear(), getMonth(), getDay()), QTime(getHour(), getMinute(), getSecond()), Qt::UTC).toMSecsSinceEpoch();
|
||||
qint64 msec = QDateTime(QDate(getYear(), getMonth(), getDay()), QTime(getHour(), getMinute(), getSecond()), QTimeZone(0)).toMSecsSinceEpoch();
|
||||
msec -= DTG::timezone2Secs(getTimezone()) * 1000LL;
|
||||
if (m_minTimeMSec > 0 && m_maxTimeMSec > 0 && m_minTimeMSec < m_maxTimeMSec)
|
||||
{
|
||||
@@ -1539,7 +1540,7 @@ void LtsDateTimeEdit::onFocusOutDay()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setDay(dt.date().day());
|
||||
}
|
||||
}
|
||||
@@ -1571,7 +1572,7 @@ void LtsDateTimeEdit::onFocusOutHHMMSS()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setHHMMSS(dt.time().hour(), dt.time().minute(), dt.time().second());
|
||||
}
|
||||
}
|
||||
@@ -1632,7 +1633,7 @@ void LtsDateTimeEdit::onFocusOutMonth()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setMonth(dt.date().month());
|
||||
}
|
||||
}
|
||||
@@ -1671,7 +1672,7 @@ void LtsDateTimeEdit::onFocusOutYear()
|
||||
{
|
||||
if (m_getCurrentTimeCallback)
|
||||
{
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), Qt::UTC));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_getCurrentTimeCallback(), QTimeZone(0)));
|
||||
setYear(dt.date().year());
|
||||
}
|
||||
}
|
||||
@@ -1768,7 +1769,7 @@ void LtsDateTimeEdit::onMonthWheelEvent(bool bForward, int cursorPos)
|
||||
if (!isMonthAcceptable())
|
||||
return;
|
||||
const int ofs = bForward ? 1 : -1;
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, Qt::UTC).addMonths(ofs));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, QTimeZone(0)).addMonths(ofs));
|
||||
setMsecsSinceEpoch(dt.toMSecsSinceEpoch(), true);
|
||||
m_uiLe->leLongMonth->setCursorPosition(cursorPos);
|
||||
m_uiLe->leLongMonth->setSelection(0, 3);
|
||||
@@ -1782,7 +1783,7 @@ void LtsDateTimeEdit::onYearWheelEvent(bool bForward, int cursorPos)
|
||||
if (!isYearAcceptable())
|
||||
return;
|
||||
const int ofs = bForward ? 1 : -1;
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, Qt::UTC).addYears(ofs));
|
||||
const QDateTime dt(QDateTime::fromMSecsSinceEpoch(m_curTimeMSec, QTimeZone(0)).addYears(ofs));
|
||||
setMsecsSinceEpoch(dt.toMSecsSinceEpoch(), true);
|
||||
m_uiLe->leLongYear->setCursorPosition(cursorPos);
|
||||
m_uiLe->leLongYear->setSelection(0, 2);
|
||||
|
||||
@@ -389,7 +389,7 @@ void LtsDialog::addConnections(QWidget *widget)
|
||||
if (addChangesMadeSignal<QLineEdit>(widget, &QLineEdit::textChanged)) return;
|
||||
if (addChangesMadeSignal<QDateTimeEdit>(widget, &QDateTimeEdit::dateTimeChanged)) return;
|
||||
if (addChangesMadeSignal<QComboBox>(widget, &QComboBox::currentTextChanged)) return;
|
||||
if (addChangesMadeSignal<QCheckBox>(widget, &QCheckBox::stateChanged)) return;
|
||||
if (addChangesMadeSignal<QCheckBox>(widget, &QCheckBox::checkStateChanged)) return;
|
||||
if (addChangesMadeSignal<QSpinBox>(widget, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged))) return;
|
||||
if (addChangesMadeSignal<QDoubleSpinBox>(widget, static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged))) return;
|
||||
if (addChangesMadeSignal<QSlider>(widget, &QSlider::valueChanged)) return;
|
||||
|
||||
@@ -437,7 +437,7 @@ private:
|
||||
for (WidgetType *widget : children)
|
||||
{
|
||||
QVariant lastState = widget->property("lastReadOnlyState");
|
||||
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert(QMetaType::Bool))
|
||||
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert<bool>())
|
||||
widget->setReadOnly(lastState.toBool());
|
||||
}
|
||||
}
|
||||
@@ -449,7 +449,7 @@ private:
|
||||
for (WidgetType *widget : children)
|
||||
{
|
||||
QVariant lastState = widget->property("lastEnabledState");
|
||||
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert(QMetaType::Bool))
|
||||
if (lastState.isValid() && !lastState.isNull() && lastState.canConvert<bool>())
|
||||
widget->setEnabled(lastState.toBool());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ void bt()
|
||||
}
|
||||
|
||||
//qWarning() << "frame" << i << address << function << offset;
|
||||
(void)offset;
|
||||
}
|
||||
|
||||
free(symbols);
|
||||
|
||||
@@ -84,12 +84,12 @@ void LtsMSecDateTimeEdit::setTimezoneHoursOffset(int timezoneHoursOffset)
|
||||
void LtsMSecDateTimeEdit::setDateTime(const QDateTime &dateTime)
|
||||
{
|
||||
// TODO: doesn't make sense, as toMSecsSinceEpoch returns the *UTC version* of the dt, so the timespec stuff does nothing
|
||||
setMsecsSinceEpoch(QDateTime::fromMSecsSinceEpoch(dateTime.toMSecsSinceEpoch(), Qt::TimeSpec::OffsetFromUTC, m_timezoneHoursOffset * 3600).toMSecsSinceEpoch());
|
||||
setMsecsSinceEpoch(QDateTime::fromMSecsSinceEpoch(dateTime.toMSecsSinceEpoch(), QTimeZone(m_timezoneHoursOffset * 3600)).toMSecsSinceEpoch());
|
||||
}
|
||||
|
||||
void LtsMSecDateTimeEdit::setMsecsSinceEpoch(qint64 msecs)
|
||||
{
|
||||
QDateTimeEdit::setDateTime(QDateTime::fromMSecsSinceEpoch(msecs, Qt::TimeSpec::OffsetFromUTC, m_timezoneHoursOffset * 3600));
|
||||
QDateTimeEdit::setDateTime(QDateTime::fromMSecsSinceEpoch(msecs, QTimeZone(m_timezoneHoursOffset * 3600)));
|
||||
}
|
||||
|
||||
int LtsMSecDateTimeEdit::msecStepSize() const
|
||||
|
||||
@@ -50,11 +50,14 @@ QValidator::State LtsMultiRangeSpinBox::validate(QString &input, int &pos) const
|
||||
// int value = input.toInt();
|
||||
// value -= minimum();
|
||||
// return (value % singleStep() == 0) ? QValidator::Acceptable : QValidator::Intermediate;
|
||||
Q_UNUSED(input);
|
||||
Q_UNUSED(pos);
|
||||
return QValidator::Acceptable;
|
||||
}
|
||||
|
||||
void LtsMultiRangeSpinBox::fixup(QString &str) const
|
||||
{
|
||||
Q_UNUSED(str);
|
||||
|
||||
// QSpinBox::fixup(str);
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ LtsSelectionPopup::~LtsSelectionPopup()
|
||||
|
||||
void LtsSelectionPopup::slotFilterChanged()
|
||||
{
|
||||
m_filter->setFilterWildcard(m_ui->leSearch->text().count() ? m_ui->leSearch->text() : QStringLiteral("*") /* show everything if nothing was entered */);
|
||||
m_filter->setFilterWildcard(m_ui->leSearch->text().size() ? m_ui->leSearch->text() : QStringLiteral("*") /* show everything if nothing was entered */);
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,6 @@ void LtsTextEditor::slotTextBold()
|
||||
if (m_ui->textEdit->document()->isEmpty())
|
||||
{
|
||||
const QString &f = m_ui->cbFonts->currentText();
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
fmt.setForeground(m_foregroundColor);
|
||||
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
|
||||
@@ -158,7 +157,6 @@ void LtsTextEditor::slotTextUnderline()
|
||||
if (m_ui->textEdit->document()->isEmpty())
|
||||
{
|
||||
const QString &f = m_ui->cbFonts->currentText();
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
fmt.setForeground(m_foregroundColor);
|
||||
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
|
||||
@@ -177,7 +175,6 @@ void LtsTextEditor::slotTextItalic()
|
||||
if (m_ui->textEdit->document()->isEmpty())
|
||||
{
|
||||
const QString &f = m_ui->cbFonts->currentText();
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
fmt.setForeground(m_foregroundColor);
|
||||
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
|
||||
@@ -202,7 +199,6 @@ void LtsTextEditor::slotTextFamily(int index)
|
||||
fmt.setForeground(m_foregroundColor);
|
||||
}
|
||||
const QString f = m_ui->cbFonts->currentText();
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
slotMergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
@@ -223,7 +219,6 @@ void LtsTextEditor::slotTextSize(int index)
|
||||
if (m_ui->textEdit->document()->isEmpty())
|
||||
{
|
||||
const QString &f = m_ui->cbFonts->currentText();
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
fmt.setForeground(m_foregroundColor);
|
||||
|
||||
@@ -273,7 +268,6 @@ void LtsTextEditor::slotTextColor()
|
||||
fmt.setFontWeight(m_ui->pbBold->isChecked() ? QFont::Bold : QFont::Normal);
|
||||
|
||||
const QString &f = m_ui->cbFonts->currentText();
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
const qreal pointSize = (m_ui->cbFontSize->currentText().toFloat() > 0 ? m_ui->cbFontSize->currentText().toFloat() : 11);
|
||||
fmt.setFontPointSize(pointSize);
|
||||
|
||||
@@ -652,7 +652,7 @@ void LtsTextEditor2::onTextItalic()
|
||||
void LtsTextEditor2::onTextFamily(const QString &f)
|
||||
{
|
||||
QTextCharFormat fmt;
|
||||
fmt.setFontFamily(f);
|
||||
fmt.setFontFamilies({f});
|
||||
mergeFormatOnWordOrSelection(fmt);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user