Skip to content

Commit 920a02e

Browse files
dakejahlDonLakeFlyer
authored andcommitted
qtimer change from pointer
1 parent 2e15875 commit 920a02e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/QmlControls/ParameterEditorController.cc

+5-6
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,19 @@ QGC_LOGGING_CATEGORY(ParameterEditorControllerLog, "qgc.qmlcontrols.parameteredi
1919
ParameterEditorController::ParameterEditorController(QObject *parent)
2020
: FactPanelController(parent)
2121
, _parameterMgr(_vehicle->parameterManager())
22-
, _searchTimer(new QTimer(this))
2322
{
2423
// qCDebug(ParameterEditorControllerLog) << Q_FUNC_INFO << this;
2524

2625
_buildLists();
2726

28-
_searchTimer->setSingleShot(true);
29-
_searchTimer->setInterval(300);
27+
_searchTimer.setSingleShot(true);
28+
_searchTimer.setInterval(300);
3029

3130
connect(this, &ParameterEditorController::currentCategoryChanged, this, &ParameterEditorController::_currentCategoryChanged);
3231
connect(this, &ParameterEditorController::currentGroupChanged, this, &ParameterEditorController::_currentGroupChanged);
3332
connect(this, &ParameterEditorController::searchTextChanged, this, &ParameterEditorController::_searchTextChanged);
3433
connect(this, &ParameterEditorController::showModifiedOnlyChanged, this, &ParameterEditorController::_searchTextChanged);
35-
connect(_searchTimer, &QTimer::timeout, this, &ParameterEditorController::_performSearch);
34+
connect(&_searchTimer, &QTimer::timeout, this, &ParameterEditorController::_performSearch);
3635
connect(_parameterMgr, &ParameterManager::factAdded, this, &ParameterEditorController::_factAdded);
3736

3837
ParameterEditorCategory* category = _categories.count() ? _categories.value<ParameterEditorCategory*>(0) : nullptr;
@@ -375,8 +374,8 @@ bool ParameterEditorController::_shouldShow(Fact* fact) const
375374

376375
void ParameterEditorController::_searchTextChanged(void)
377376
{
378-
if (!_searchTimer->isActive()) {
379-
_searchTimer->start();
377+
if (!_searchTimer.isActive()) {
378+
_searchTimer.start();
380379
}
381380
}
382381

src/QmlControls/ParameterEditorController.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private slots:
146146
private:
147147
ParameterManager* _parameterMgr = nullptr;
148148
QString _searchText;
149-
QTimer* _searchTimer;
149+
QTimer _searchTimer;
150150
ParameterEditorCategory* _currentCategory = nullptr;
151151
ParameterEditorGroup* _currentGroup = nullptr;
152152
bool _showModifiedOnly = false;

0 commit comments

Comments
 (0)