Skip to content
Permalink
Browse files
Show scroll bars for drag and drop attribute editor if necessary
  • Loading branch information
m-kuhn committed Jan 7, 2013
1 parent 6b231a1 commit c4115cf14108e9649ee09295f3ff24bbd3a9f9cf
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/gui/qgsattributeeditor.cpp
@@ -26,6 +26,7 @@
#include <qgsmaplayerregistry.h>
#include <qgslogger.h>

#include <QScrollArea>
#include <QPushButton>
#include <QLineEdit>
#include <QTextEdit>
@@ -987,13 +988,23 @@ QWidget* QgsAttributeEditor::createWidgetFromDef( const QgsAttributeEditorElemen
QGroupBox* groupBox = new QGroupBox( parent );
groupBox->setTitle( container->name() );
myContainer = groupBox;
newWidget = myContainer;
}
else
{
myContainer = new QWidget( parent );
QScrollArea *scrollArea = new QScrollArea( parent );

myContainer = new QWidget( scrollArea );

scrollArea->setWidget( myContainer );
scrollArea->setWidgetResizable( true );
scrollArea->setFrameShape( QFrame::NoFrame );

newWidget = scrollArea;
}

QGridLayout* gbLayout = new QGridLayout( myContainer );
myContainer->setLayout( gbLayout );

int index = 0;

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

newWidget = myContainer;
break;
}

0 comments on commit c4115cf

Please sign in to comment.