Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Also scan for 'new QScrollArea'
(cherry picked from commit 48834f6)
  • Loading branch information
nyalldawson committed Jan 25, 2022
1 parent 933b4a0 commit da44e7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/vector/qgsattributesformproperties.cpp
Expand Up @@ -1340,7 +1340,7 @@ void QgsAttributesDnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int colum
expressionWidgetBox->layout()->addWidget( addExpressionButton );
qmlCodeBox->layout()->addWidget( qmlCode );
layout->addWidget( qmlCodeBox );
QScrollArea *qmlPreviewBox = new QScrollArea();
QScrollArea *qmlPreviewBox = new QgsScrollArea();
qmlPreviewBox->setLayout( new QGridLayout );
qmlPreviewBox->setMinimumWidth( 400 );
qmlPreviewBox->layout()->addWidget( qmlWrapper->widget() );
Expand Down Expand Up @@ -1421,7 +1421,7 @@ void QgsAttributesDnDTree::onItemDoubleClicked( QTreeWidgetItem *item, int colum
expressionWidgetBox->layout()->addWidget( expressionWidget );
expressionWidgetBox->layout()->addWidget( addExpressionButton );
layout->addWidget( htmlCode );
QScrollArea *htmlPreviewBox = new QScrollArea();
QScrollArea *htmlPreviewBox = new QgsScrollArea();
htmlPreviewBox->setLayout( new QGridLayout );
htmlPreviewBox->setMinimumWidth( 400 );
htmlPreviewBox->layout()->addWidget( htmlWrapper->widget() );
Expand Down
11 changes: 11 additions & 0 deletions tests/code_layout/test_qgsscrollarea.sh
Expand Up @@ -18,6 +18,17 @@ if [[ ${FOUND} ]]; then
RES=1
fi

FOUND=$(git grep "new QScrollArea" -- 'src' | grep --invert-match skip-keyword-check)

if [[ ${FOUND} ]]; then
echo "Base QScrollArea class used in file!"
echo " -> Use QgsScrollArea class instead"
echo " or mark with // skip-keyword-check" echo
echo "${FOUND}"
echo
RES=1
fi


popd > /dev/null || exit

Expand Down

0 comments on commit da44e7c

Please sign in to comment.