qtimer change from pointer

This commit is contained in:
Jacob Dahl
2025-02-07 11:13:08 -09:00
committed by Don Gagne
parent 2e15875228
commit 920a02e14f
2 changed files with 6 additions and 7 deletions
+5 -6
View File
@@ -19,20 +19,19 @@ QGC_LOGGING_CATEGORY(ParameterEditorControllerLog, "qgc.qmlcontrols.parameteredi
ParameterEditorController::ParameterEditorController(QObject *parent)
: FactPanelController(parent)
, _parameterMgr(_vehicle->parameterManager())
, _searchTimer(new QTimer(this))
{
// qCDebug(ParameterEditorControllerLog) << Q_FUNC_INFO << this;
_buildLists();
_searchTimer->setSingleShot(true);
_searchTimer->setInterval(300);
_searchTimer.setSingleShot(true);
_searchTimer.setInterval(300);
connect(this, &ParameterEditorController::currentCategoryChanged, this, &ParameterEditorController::_currentCategoryChanged);
connect(this, &ParameterEditorController::currentGroupChanged, this, &ParameterEditorController::_currentGroupChanged);
connect(this, &ParameterEditorController::searchTextChanged, this, &ParameterEditorController::_searchTextChanged);
connect(this, &ParameterEditorController::showModifiedOnlyChanged, this, &ParameterEditorController::_searchTextChanged);
connect(_searchTimer, &QTimer::timeout, this, &ParameterEditorController::_performSearch);
connect(&_searchTimer, &QTimer::timeout, this, &ParameterEditorController::_performSearch);
connect(_parameterMgr, &ParameterManager::factAdded, this, &ParameterEditorController::_factAdded);
ParameterEditorCategory* category = _categories.count() ? _categories.value<ParameterEditorCategory*>(0) : nullptr;
@@ -375,8 +374,8 @@ bool ParameterEditorController::_shouldShow(Fact* fact) const
void ParameterEditorController::_searchTextChanged(void)
{
if (!_searchTimer->isActive()) {
_searchTimer->start();
if (!_searchTimer.isActive()) {
_searchTimer.start();
}
}
+1 -1
View File
@@ -146,7 +146,7 @@ private:
private:
ParameterManager* _parameterMgr = nullptr;
QString _searchText;
QTimer* _searchTimer;
QTimer _searchTimer;
ParameterEditorCategory* _currentCategory = nullptr;
ParameterEditorGroup* _currentGroup = nullptr;
bool _showModifiedOnly = false;