瀏覽代碼

UI: Initialize max length of LineEditAutoResize in constructor

LineEditAutoResize didn't have its maxLength initialized in the
constructor, leaving it to be a random value until set via setMaxLength.
The one place where LineEditAutoResize was used immediately set this
after calling the constructor, but if we use this anywhere else in the
future it makes sense to have this initialized.
As it is meant to mostly behave like a QLineEdit, lets use the same
default value of 32767.

Detected by PVS-Studio.
gxalpha 1 年之前
父節點
當前提交
f462ffb224
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      UI/lineedit-autoresize.cpp

+ 1 - 1
UI/lineedit-autoresize.cpp

@@ -1,6 +1,6 @@
 #include "lineedit-autoresize.hpp"
 
-LineEditAutoResize::LineEditAutoResize()
+LineEditAutoResize::LineEditAutoResize() : m_maxLength(32767)
 {
 	connect(this, &LineEditAutoResize::textChanged, this,
 		&LineEditAutoResize::checkTextLength);