mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-16 00:05:45 -04:00
Hide useless action buttons when list widget is read only
This commit is contained in:
parent
63c1d5cfc0
commit
317aae6f0e
@ -71,4 +71,15 @@ void QgsTableWidgetBase::setReadOnly( bool readOnly )
|
|||||||
|
|
||||||
addButton->setEnabled( !mReadOnly );
|
addButton->setEnabled( !mReadOnly );
|
||||||
removeButton->setEnabled( !mReadOnly && tableView->selectionModel()->hasSelection() );
|
removeButton->setEnabled( !mReadOnly && tableView->selectionModel()->hasSelection() );
|
||||||
|
|
||||||
|
if ( mReadOnly )
|
||||||
|
{
|
||||||
|
mWidgetActions->hide();
|
||||||
|
layout()->setSpacing( 0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mWidgetActions->show();
|
||||||
|
layout()->setSpacing( 6 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,20 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="mActionLayout">
|
<widget class="QWidget" name="mWidgetActions" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="addButton">
|
<widget class="QToolButton" name="addButton">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
@ -104,9 +117,15 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>tableView</tabstop>
|
||||||
|
<tabstop>addButton</tabstop>
|
||||||
|
<tabstop>removeButton</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../images/images.qrc"/>
|
<include location="../../images/images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user