Skip to content
Permalink
Browse files

Make QgsNewDatabaseTableNameWidget a QgsPanelWidget, tweak toolbar size

  • Loading branch information
nyalldawson committed Mar 25, 2020
1 parent 9b0db6e commit f1ca840e3143708bcc7fe947eabda447de8e3e7f
@@ -10,7 +10,7 @@



class QgsNewDatabaseTableNameWidget : QWidget
class QgsNewDatabaseTableNameWidget : QgsPanelWidget
{
%Docstring
The QgsNewDatabaseTableNameWidget class embeds the browser view to
@@ -23,6 +23,7 @@
#include "qgsproviderregistry.h"
#include "qgsprovidermetadata.h"
#include "qgssettings.h"
#include "qgsguiutils.h"

#include <QDialogButtonBox>
#include <QPushButton>
@@ -34,7 +35,7 @@ QgsNewDatabaseTableNameWidget::QgsNewDatabaseTableNameWidget(
QgsBrowserGuiModel *browserModel,
const QStringList &providersFilter,
QWidget *parent )
: QWidget( parent )
: QgsPanelWidget( parent )
{

// Initialize the browser
@@ -74,6 +75,8 @@ QgsNewDatabaseTableNameWidget::QgsNewDatabaseTableNameWidget(
}
}

mBrowserToolbar->setIconSize( QgsGuiUtils::iconSize( true ) );

mBrowserProxyModel.setBrowserModel( mBrowserModel );
// If a filter was specified but the data provider could not be found
// this makes sure no providers are shown instead of ALL of them
@@ -22,6 +22,7 @@
#include "qgis_gui.h"
#include "qgsbrowserguimodel.h"
#include "qgsbrowserproxymodel.h"
#include "qgspanelwidget.h"

#include <QWidget>
#include <QDialog>
@@ -40,7 +41,7 @@
*
* \since QGIS 3.14
*/
class GUI_EXPORT QgsNewDatabaseTableNameWidget : public QWidget, private Ui::QgsNewDatabaseTableNameWidget
class GUI_EXPORT QgsNewDatabaseTableNameWidget : public QgsPanelWidget, private Ui::QgsNewDatabaseTableNameWidget
{
Q_OBJECT

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QgsNewDatabaseTableNameWidget</class>
<widget class="QWidget" name="QgsNewDatabaseTableNameWidget">
<widget class="QgsPanelWidget" name="QgsNewDatabaseTableNameWidget">
<property name="geometry">
<rect>
<x>0</x>
@@ -12,33 +12,43 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>4</number>
<number>0</number>
</property>
<property name="topMargin">
<number>4</number>
<number>0</number>
</property>
<property name="rightMargin">
<number>4</number>
<number>0</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QToolBar" name="mBrowserToolbar">
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="floatable">
<bool>false</bool>
<property name="bottomMargin">
<number>0</number>
</property>
<addaction name="mActionRefresh"/>
</widget>
</item>
<item>
<widget class="QgsBrowserTreeView" name="mBrowserTreeView"/>
<item>
<widget class="QToolBar" name="mBrowserToolbar">
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="floatable">
<bool>false</bool>
</property>
<addaction name="mActionRefresh"/>
</widget>
</item>
<item>
<widget class="QgsBrowserTreeView" name="mBrowserTreeView"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
@@ -79,6 +89,12 @@
</action>
</widget>
<customwidgets>
<customwidget>
<class>QgsPanelWidget</class>
<extends>QWidget</extends>
<header>qgspanelwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsBrowserTreeView</class>
<extends>QTreeView</extends>

0 comments on commit f1ca840

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