Skip to content

Commit c4115cf

Browse files
committedJan 7, 2013
Show scroll bars for drag and drop attribute editor if necessary
1 parent 6b231a1 commit c4115cf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed
 

‎src/gui/qgsattributeeditor.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <qgsmaplayerregistry.h>
2727
#include <qgslogger.h>
2828

29+
#include <QScrollArea>
2930
#include <QPushButton>
3031
#include <QLineEdit>
3132
#include <QTextEdit>
@@ -987,13 +988,23 @@ QWidget* QgsAttributeEditor::createWidgetFromDef( const QgsAttributeEditorElemen
987988
QGroupBox* groupBox = new QGroupBox( parent );
988989
groupBox->setTitle( container->name() );
989990
myContainer = groupBox;
991+
newWidget = myContainer;
990992
}
991993
else
992994
{
993-
myContainer = new QWidget( parent );
995+
QScrollArea *scrollArea = new QScrollArea( parent );
996+
997+
myContainer = new QWidget( scrollArea );
998+
999+
scrollArea->setWidget( myContainer );
1000+
scrollArea->setWidgetResizable( true );
1001+
scrollArea->setFrameShape( QFrame::NoFrame );
1002+
1003+
newWidget = scrollArea;
9941004
}
9951005

9961006
QGridLayout* gbLayout = new QGridLayout( myContainer );
1007+
myContainer->setLayout( gbLayout );
9971008

9981009
int index = 0;
9991010

@@ -1026,7 +1037,6 @@ QWidget* QgsAttributeEditor::createWidgetFromDef( const QgsAttributeEditorElemen
10261037
}
10271038
gbLayout->addItem( new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding ), index , 0 );
10281039

1029-
newWidget = myContainer;
10301040
break;
10311041
}
10321042

0 commit comments

Comments
 (0)