summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-05-05 21:32:19 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-05-05 21:32:52 +0200
commit865403b646abd8f870ba45749fca955cac84dc0a (patch)
tree9e51efa4b5fcb81ba23bb0cd5cb2aec78fb61375 /src
parentd8f43e60a2f604359bba8844bb3a5b833b60f8b8 (diff)
Use parented_ptr instead of a plain pointer
Diffstat (limited to 'src')
-rw-r--r--src/widget/wsearchlineedit.cpp2
-rw-r--r--src/widget/wsearchlineedit.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/widget/wsearchlineedit.cpp b/src/widget/wsearchlineedit.cpp
index fc00d866d8..9f2400e5dd 100644
--- a/src/widget/wsearchlineedit.cpp
+++ b/src/widget/wsearchlineedit.cpp
@@ -64,7 +64,7 @@ void WSearchLineEdit::setDebouncingTimeoutMillis(int debouncingTimeoutMillis) {
WSearchLineEdit::WSearchLineEdit(QWidget* pParent)
: QLineEdit(pParent),
WBaseWidget(this),
- m_clearButton(new QToolButton(this)) {
+ m_clearButton(make_parented<QToolButton>(this)) {
DEBUG_ASSERT(kEmptySearch.isEmpty());
DEBUG_ASSERT(!kEmptySearch.isNull());
diff --git a/src/widget/wsearchlineedit.h b/src/widget/wsearchlineedit.h
index b4989b3f90..f3807ce003 100644
--- a/src/widget/wsearchlineedit.h
+++ b/src/widget/wsearchlineedit.h
@@ -6,6 +6,7 @@
#include <QTimer>
#include <QToolButton>
+#include "util/parented_ptr.h"
#include "widget/wbasewidget.h"
class SkinContext;
@@ -69,7 +70,7 @@ class WSearchLineEdit : public QLineEdit, public WBaseWidget {
// Update the displayed text without (re-)starting the timer
void setTextBlockSignals(const QString& text);
- QToolButton* const m_clearButton;
+ parented_ptr<QToolButton> const m_clearButton;
int m_frameWidth;
int m_innerHeight;