Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Swap all QScrollAreas to QgsScrollAreas
  • Loading branch information
nyalldawson committed Mar 20, 2017
1 parent 907ad02 commit 8e6d792
Show file tree
Hide file tree
Showing 55 changed files with 600 additions and 278 deletions.
8 changes: 7 additions & 1 deletion python/console/console_settings.ui
Expand Up @@ -46,7 +46,7 @@
</widget>
</item>
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<widget class="QgsScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down Expand Up @@ -1139,6 +1139,12 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header location="global">qgis.gui</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
Expand Down
1 change: 1 addition & 0 deletions python/gui/gui.sip
Expand Up @@ -154,6 +154,7 @@
%Include qgsscalerangewidget.sip
%Include qgsscalevisibilitydialog.sip
%Include qgsscalewidget.sip
%Include qgsscrollarea.sip
%Include qgssearchquerybuilder.sip
%Include qgsshortcutsmanager.sip
%Include qgsslider.sip
Expand Down
15 changes: 15 additions & 0 deletions python/gui/qgsscrollarea.sip
@@ -0,0 +1,15 @@
class QgsScrollArea : QScrollArea
{
%TypeHeaderCode
#include <qgsscrollarea.h>
%End

public:
explicit QgsScrollArea( QWidget *parent /TransferThis/ = 0 );
void scrollOccurred();
bool hasScrolled() const;

protected:
void wheelEvent( QWheelEvent *event );

};
7 changes: 4 additions & 3 deletions python/plugins/processing/modeler/ModelerParametersDialog.py
Expand Up @@ -30,13 +30,14 @@
from qgis.PyQt.QtCore import Qt, QUrl, QMetaObject
from qgis.PyQt.QtWidgets import (QDialog, QDialogButtonBox, QLabel, QLineEdit,
QFrame, QPushButton, QSizePolicy, QVBoxLayout,
QHBoxLayout, QTabWidget, QWidget, QScrollArea,
QHBoxLayout, QTabWidget, QWidget,
QTextBrowser)
from qgis.PyQt.QtNetwork import QNetworkRequest, QNetworkReply

from qgis.core import QgsNetworkAccessManager

from qgis.gui import QgsMessageBar
from qgis.gui import (QgsMessageBar,
QgsScrollArea)

from processing.gui.wrappers import InvalidParameterValue
from processing.gui.MultipleInputPanel import MultipleInputPanel
Expand Down Expand Up @@ -187,7 +188,7 @@ def setupUi(self):
self.tabWidget.setMinimumWidth(300)
self.paramPanel = QWidget()
self.paramPanel.setLayout(self.verticalLayout)
self.scrollArea = QScrollArea()
self.scrollArea = QgsScrollArea()
self.scrollArea.setWidget(self.paramPanel)
self.scrollArea.setWidgetResizable(True)
self.tabWidget.addTab(self.scrollArea, self.tr('Parameters'))
Expand Down
11 changes: 8 additions & 3 deletions python/plugins/processing/ui/DlgModeler.ui
Expand Up @@ -44,7 +44,7 @@
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_1">
<widget class="QgsScrollArea" name="scrollArea_1">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -138,7 +138,7 @@
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_2">
<widget class="QgsScrollArea" name="scrollArea_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -222,7 +222,7 @@
<number>2</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea_3">
<widget class="QgsScrollArea" name="scrollArea_3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -505,6 +505,11 @@
</action>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgis.gui</header>
</customwidget>
<customwidget>
<class>QgsFilterLineEdit</class>
<extends>QLineEdit</extends>
Expand Down
8 changes: 7 additions & 1 deletion python/plugins/processing/ui/widgetParametersPanel.ui
Expand Up @@ -21,7 +21,7 @@
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<widget class="QgsScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down Expand Up @@ -88,6 +88,12 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgis.gui</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
Expand Down
1 change: 0 additions & 1 deletion src/app/composer/qgsattributeselectiondialog.cpp
Expand Up @@ -29,7 +29,6 @@
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QScrollArea>
#include <QSpinBox>
#include <QSortFilterProxyModel>

Expand Down
3 changes: 2 additions & 1 deletion src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -28,6 +28,7 @@
#include "qgsorganizetablecolumnsdialog.h"
#include "qgseditorwidgetregistry.h"
#include "qgssettings.h"
#include "qgsscrollarea.h"

#include <QClipboard>
#include <QDialog>
Expand Down Expand Up @@ -95,7 +96,7 @@ void QgsDualView::init( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const Qg
mAttributeForm = new QgsAttributeForm( mLayer, QgsFeature(), mEditorContext );
if ( !context.parentContext() )
{
mAttributeEditorScrollArea = new QScrollArea();
mAttributeEditorScrollArea = new QgsScrollArea();
mAttributeEditorScrollArea->setWidgetResizable( true );
mAttributeEditor->layout()->addWidget( mAttributeEditorScrollArea );
mAttributeEditorScrollArea->setWidget( mAttributeForm );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/attributetable/qgsdualview.h
Expand Up @@ -29,7 +29,7 @@
class QgsFeatureRequest;
class QSignalMapper;
class QgsMapLayerAction;
class QScrollArea;
class QgsScrollArea;

/** \ingroup gui
* This widget is used to show the attributes of a set of features of a {@link QgsVectorLayer}.
Expand Down Expand Up @@ -351,7 +351,7 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
QgsDistanceArea mDistanceArea;
QString mDisplayExpression;
QgsAttributeTableConfig mConfig;
QScrollArea *mAttributeEditorScrollArea = nullptr;
QgsScrollArea *mAttributeEditorScrollArea = nullptr;
QgsMapCanvas *mMapCanvas = nullptr;

friend class TestQgsDualView;
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -31,6 +31,7 @@
#include "qgslogger.h"
#include "qgstabwidget.h"
#include "qgssettings.h"
#include "qgsscrollarea.h"

#include <QDir>
#include <QTextStream>
Expand All @@ -42,7 +43,6 @@
#include <QKeyEvent>
#include <QLabel>
#include <QPushButton>
#include <QScrollArea>
#include <QUiLoader>
#include <QMessageBox>
#include <QToolButton>
Expand Down Expand Up @@ -1210,7 +1210,7 @@ void QgsAttributeForm::init()
if ( mContext.formMode() != QgsAttributeEditorContext::Embed )
{
// put the form into a scroll area to nicely handle cases with lots of attributes
QScrollArea *scrollArea = new QScrollArea( this );
QgsScrollArea *scrollArea = new QgsScrollArea( this );
scrollArea->setWidget( formWidget );
scrollArea->setWidgetResizable( true );
scrollArea->setFrameShape( QFrame::NoFrame );
Expand Down Expand Up @@ -1599,7 +1599,7 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt

if ( context.formMode() != QgsAttributeEditorContext::Embed )
{
QScrollArea *scrollArea = new QScrollArea( parent );
QgsScrollArea *scrollArea = new QgsScrollArea( parent );

scrollArea->setWidget( myContainer );
scrollArea->setWidgetResizable( true );
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsattributetypeloaddialog.cpp
Expand Up @@ -29,7 +29,6 @@
#include <QComboBox>
#include <QLabel>
#include <QFrame>
#include <QScrollArea>
#include <QCompleter>
#include <QSpinBox>
#include <QPushButton>
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/evis/eventbrowser/evisimagedisplaywidget.cpp
Expand Up @@ -27,6 +27,7 @@
#include "evisimagedisplaywidget.h"

#include "qgsapplication.h"
#include "qgsscrollarea.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
Expand Down Expand Up @@ -76,7 +77,7 @@ eVisImageDisplayWidget::eVisImageDisplayWidget( QWidget *parent, Qt::WindowFlags
myButtonBar->setLayout( myButtonBarLayout );

//setup display area
mDisplayArea = new QScrollArea();
mDisplayArea = new QgsScrollArea();

QVBoxLayout *myLayout = new QVBoxLayout;
myLayout->addWidget( myButtonBar );
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/evis/eventbrowser/evisimagedisplaywidget.h
Expand Up @@ -29,12 +29,12 @@

#include <QLabel>
#include <QWidget>
#include <QScrollArea>
#include <QPushButton>
#include <QBuffer>

#include <QResizeEvent>

class QgsScrollArea;

/**
* \class eVisGenericEventBrowserGui
* \brief Generic viewer for browsing event
Expand Down Expand Up @@ -81,7 +81,7 @@ class eVisImageDisplayWidget : public QWidget
int mCurrentZoomStep;

//! \brief widget to display the image in
QScrollArea *mDisplayArea = nullptr;
QgsScrollArea *mDisplayArea = nullptr;

//! \brief Method that actually display the image in the widget
void displayImage();
Expand Down
Expand Up @@ -37,6 +37,7 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorfilewriter.h"
#include "qgssettings.h"
#include "qgsscrollarea.h"

QString QgsGeometryCheckerResultTab::sSettingsGroup = QStringLiteral( "/geometry_checker/default_fix_methods/" );

Expand Down Expand Up @@ -550,7 +551,7 @@ void QgsGeometryCheckerResultTab::setDefaultResolutionMethods()

QVBoxLayout *layout = new QVBoxLayout( &dialog );

QScrollArea *scrollArea = new QScrollArea( &dialog );
QgsScrollArea *scrollArea = new QgsScrollArea( &dialog );
scrollArea->setFrameShape( QFrame::NoFrame );
layout->setContentsMargins( 0, 0, 0, 0 );
layout->addWidget( scrollArea );
Expand Down
10 changes: 9 additions & 1 deletion src/plugins/geometry_checker/ui/qgsgeometrycheckerresulttab.ui
Expand Up @@ -27,7 +27,7 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<widget class="QgsScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down Expand Up @@ -401,6 +401,14 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>scrollArea</tabstop>
<tabstop>tableWidgetErrors</tabstop>
Expand Down
Expand Up @@ -27,7 +27,7 @@
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QScrollArea" name="scrollArea">
<widget class="QgsScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down Expand Up @@ -723,6 +723,12 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsMapLayerComboBox</class>
<extends>QComboBox</extends>
Expand Down
5 changes: 2 additions & 3 deletions src/plugins/grass/qgsgrassmoduleoptions.cpp
Expand Up @@ -16,8 +16,6 @@

#include <QDomElement>
#include <QFileDialog>
#include <QMessageBox>
#include <QScrollArea>
#include <QTextCodec>

#include "qgisinterface.h"
Expand All @@ -30,6 +28,7 @@
#include "qgsrasterlayer.h"
#include "qgsvectorlayer.h"
#include "qgsvectordataprovider.h"
#include "qgsscrollarea.h"

#include "qgsgrass.h"
#include "qgsgrassmodule.h"
Expand Down Expand Up @@ -90,7 +89,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
//
QVBoxLayout *mypOuterLayout = new QVBoxLayout( this );
mypOuterLayout->setContentsMargins( 0, 0, 0, 0 );
QScrollArea *mypScrollArea = new QScrollArea();
QgsScrollArea *mypScrollArea = new QgsScrollArea();
//transfers scroll area ownership so no need to call delete
mypOuterLayout->addWidget( mypScrollArea );
QFrame *mypInnerFrame = new QFrame();
Expand Down
12 changes: 9 additions & 3 deletions src/providers/grass/qgsgrassoptionsbase.ui
Expand Up @@ -228,7 +228,7 @@
<widget class="QWidget" name="mModulesPage">
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QScrollArea" name="mModulesScrollArea">
<widget class="QgsScrollArea" name="mModulesScrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down Expand Up @@ -329,7 +329,7 @@
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="mBrowserScrollArea">
<widget class="QgsScrollArea" name="mBrowserScrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
Expand Down Expand Up @@ -566,6 +566,12 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
Expand All @@ -580,8 +586,8 @@
</customwidget>
</customwidgets>
<resources>
<include location="../../../images/images.qrc"/>
<include location="../../plugins/grass/qgsgrass_plugin.qrc"/>
<include location="../../../images/images.qrc"/>
</resources>
<connections>
<connection>
Expand Down

0 comments on commit 8e6d792

Please sign in to comment.