Skip to content
Permalink
Browse files

DnD forms: Make tabs scrollable

Fix #10389
  • Loading branch information
m-kuhn committed Jun 2, 2014
1 parent 402c0dc commit 7f21918e77cbf6b9b9ee3e1993849f2e950b22cb
Showing with 9 additions and 3 deletions.
  1. +6 −2 src/core/qgsvectorlayer.h
  2. +3 −1 src/gui/qgsattributeform.cpp
@@ -97,17 +97,21 @@ class CORE_EXPORT QgsAttributeEditorContainer : public QgsAttributeEditorElement
{
public:
QgsAttributeEditorContainer( QString name, QObject *parent )
: QgsAttributeEditorElement( AeTypeContainer, name, parent ) {}
: QgsAttributeEditorElement( AeTypeContainer, name, parent )
, mIsGroupBox( true )
{}

~QgsAttributeEditorContainer() {}

virtual QDomElement toDomElement( QDomDocument& doc ) const;
virtual void addChildElement( QgsAttributeEditorElement *widget );
virtual bool isGroupBox() const { return true; }
virtual void setIsGroupBox( bool isGroupBox ) { mIsGroupBox = isGroupBox; }
virtual bool isGroupBox() const { return mIsGroupBox; }
QList<QgsAttributeEditorElement*> children() const { return mChildren; }
virtual QList<QgsAttributeEditorElement*> findElements( AttributeEditorType type ) const;

private:
bool mIsGroupBox;
QList<QgsAttributeEditorElement*> mChildren;
};

@@ -321,7 +321,7 @@ void QgsAttributeForm::init()
QTabWidget* tabWidget = new QTabWidget( this );
layout()->addWidget( tabWidget );

Q_FOREACH( const QgsAttributeEditorElement *widgDef, mLayer->attributeEditorElements() )
Q_FOREACH( QgsAttributeEditorElement *widgDef, mLayer->attributeEditorElements() )
{
QWidget* tabPage = new QWidget( tabWidget );

@@ -330,6 +330,8 @@ void QgsAttributeForm::init()

if ( widgDef->type() == QgsAttributeEditorElement::AeTypeContainer )
{
QgsAttributeEditorContainer* containerDef = dynamic_cast<QgsAttributeEditorContainer*>( widgDef );
containerDef->setIsGroupBox( false ); // Toplevel widgets are tabs not groupboxes
QString dummy1;
bool dummy2;
tabPageLayout->addWidget( createWidgetFromDef( widgDef, tabPage, mLayer, mContext, dummy1, dummy2 ) );

0 comments on commit 7f21918

Please sign in to comment.
You can’t perform that action at this time.