Commit 15f16ced authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use auto + const variable

parent 5923142b
Pipeline #88782 passed with stage
in 4 minutes and 28 seconds
......@@ -18,7 +18,7 @@ MultiplyingLineEditor::MultiplyingLineEditor(MultiplyingLineFactory *factory, QW
: QWidget(parent)
, mMultiplyingLineFactory(factory)
{
QBoxLayout *topLayout = new QHBoxLayout(this);
auto topLayout = new QHBoxLayout(this);
topLayout->setContentsMargins(0, 0, 0, 0);
mView = new MultiplyingLineView(mMultiplyingLineFactory, this);
......
......@@ -116,7 +116,7 @@ void MultiplyingLineView::slotReturnPressed(MultiplyingLine *line)
void MultiplyingLineView::slotDownPressed(MultiplyingLine *line)
{
int pos = mLines.indexOf(line);
const int pos = mLines.indexOf(line);
if (pos >= (mLines.count() - 1)) {
Q_EMIT focusDown();
} else if (pos >= 0) {
......@@ -126,7 +126,7 @@ void MultiplyingLineView::slotDownPressed(MultiplyingLine *line)
void MultiplyingLineView::slotUpPressed(MultiplyingLine *line)
{
int pos = mLines.indexOf(line);
const int pos = mLines.indexOf(line);
if (pos > 0) {
activateLine(mLines.at(pos - 1));
} else {
......@@ -157,7 +157,7 @@ void MultiplyingLineView::slotDeleteLine()
MultiplyingLine *line = mCurDelLine;
line->aboutToBeDeleted();
int pos = mLines.indexOf(line);
const int pos = mLines.indexOf(line);
if (mCurDelLine->isActive()) {
int newPos;
......@@ -389,7 +389,7 @@ void MultiplyingLineView::setAutoResize(bool resize)
}
}
bool MultiplyingLineView::autoResize()
bool MultiplyingLineView::autoResize() const
{
return mAutoResize;
}
......
......@@ -68,14 +68,14 @@ public:
@param resize turn on or off this behavior of auto resizing
*/
void setAutoResize(bool resize);
bool autoResize();
Q_REQUIRED_RESULT bool autoResize() const;
/**
* Sets whether the size hint of the editor shall be calculated
* dynamically by the number of lines. Default is @c true.
*/
void setDynamicSizeHint(bool dynamic);
bool dynamicSizeHint() const;
Q_REQUIRED_RESULT bool dynamicSizeHint() const;
QList<MultiplyingLine *> lines() const;
MultiplyingLine *addLine(bool showDialogBox);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment