Skip to content

Commit

Permalink
Moved support classes into own private header
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Jun 2, 2017
1 parent 7082649 commit d62d444
Show file tree
Hide file tree
Showing 6 changed files with 747 additions and 940 deletions.
291 changes: 2 additions & 289 deletions python/gui/qgsbrowserdockwidget.sip
Expand Up @@ -9,165 +9,19 @@



class QgsBrowserPropertiesWrapLabel : QTextEdit
{
%Docstring
Hack to show wrapped text without spaces
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

QgsBrowserPropertiesWrapLabel( const QString &text, QWidget *parent = 0 );
%Docstring
Constructor for QgsBrowserPropertiesWrapLabel
\param text label text
\param parent parent widget
%End

};

class QgsBrowserPropertiesWidget : QWidget
{
%Docstring
The QgsBrowserPropertiesWidget base class
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsBrowserPropertiesWidget( QWidget *parent = 0 );
%Docstring
Constructor for QgsBrowserPropertiesWidget
\param parent parent widget
%End
static QgsBrowserPropertiesWidget *createWidget( QgsDataItem *item, QWidget *parent = 0 ) /Factory/;
%Docstring
Factory method to create a new browser widget
:rtype: QgsBrowserPropertiesWidget
%End
virtual void setItem( QgsDataItem *item );
%Docstring
Stub
%End
virtual void setWidget( QWidget *widget );
%Docstring
Set content widget, usually item paramWidget. Takes ownership.
%End

virtual void setCondensedMode( bool condensedMode );
%Docstring
Sets whether the properties widget should display in condensed mode, ie, for display in a dock
widget rather than it's own separate dialog.
\param condensedMode set to true to enable condensed mode
.. versionadded:: 2.10
%End
};

class QgsBrowserLayerProperties : QgsBrowserPropertiesWidget
{
%Docstring
The QgsBrowserLayerProperties class
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsBrowserLayerProperties( QWidget *parent = 0 );
%Docstring
Constructor for QgsBrowserLayerProperties
\param parent parent widget
%End
virtual void setItem( QgsDataItem *item );

%Docstring
Set item
%End

virtual void setCondensedMode( bool condensedMode );
%Docstring
Sets whether the properties widget should display in condensed mode, ie, for display in a dock
widget rather than it's own separate dialog.
\param condensedMode set to true to enable condensed mode
.. versionadded:: 2.10
%End

};

class QgsBrowserDirectoryProperties : QgsBrowserPropertiesWidget
{
%Docstring
The QgsBrowserDirectoryProperties class
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsBrowserDirectoryProperties( QWidget *parent = 0 );
%Docstring
Constructor for QgsBrowserDirectoryProperties
\param parent parent widget
%End

virtual void setItem( QgsDataItem *item );

%Docstring
Create widget from the given item and add it
%End
};

class QgsBrowserPropertiesDialog : QDialog
{
%Docstring
The QgsBrowserPropertiesDialog class
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

QgsBrowserPropertiesDialog( const QString &settingsSection, QWidget *parent = 0 );
%Docstring
Constructor for QgsBrowserPropertiesDialog
\param settingsSection prefix for settings (from the object name)
\param parent parent widget
%End
~QgsBrowserPropertiesDialog();

void setItem( QgsDataItem *item );
%Docstring
Create dialog from the given item and add it
%End

};

class QgsBrowserDockWidget : QgsDockWidget
{
%Docstring
The QgsBrowserDockWidget class
.. versionadded:: 2.10
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsBrowserDockWidget( const QString &name, QWidget *parent = 0 );
explicit QgsBrowserDockWidget( const QString &name, QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsBrowserDockWidget
\param name name of the widget
Expand Down Expand Up @@ -232,7 +86,6 @@ Apply filter to the model
Update project home directory
%End


void addSelectedLayers();
%Docstring
Add selected layers to the project
Expand Down Expand Up @@ -270,154 +123,14 @@ Emitted when drop uri list needs to be handled
%End

protected:
void refreshModel( const QModelIndex &index );
%Docstring
Refresh the model
%End
virtual void showEvent( QShowEvent *event );

%Docstring
Show event override
%End
void addLayer( QgsLayerItem *layerItem );
%Docstring
Add a layer
%End
void clearPropertiesWidget();
%Docstring
Clear the properties widget
%End
void setPropertiesWidget();
%Docstring
Set the properties widget
%End

int selectedItemsCount();
%Docstring
Count selected items
:rtype: int
%End
QString settingsSection();
%Docstring
Settings prefix (the object name)
:rtype: str
%End


};


class QgsDockBrowserTreeView : QgsBrowserTreeView
{
%Docstring
Utility class for correct drag&drop handling.

We want to allow user to drag layers to qgis window. At the same time we do not
accept drops of the items on our view - but if we ignore the drag enter action
then qgis application consumes the drag events and it is possible to drop the
items on the tree view although the drop is actually managed by qgis app.
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsDockBrowserTreeView( QWidget *parent );
%Docstring
Constructor for QgsDockBrowserTreeView
\param parent parent widget
%End
virtual void dragEnterEvent( QDragEnterEvent *e );

%Docstring
Overrides drag enter event
%End
virtual void dragMoveEvent( QDragMoveEvent *e );

%Docstring
Overrides drag move event
%End
virtual void dropEvent( QDropEvent *e );

%Docstring
Overrides drag stop event
%End
};

class QgsBrowserTreeFilterProxyModel : QSortFilterProxyModel
{
%Docstring
Utility class for filtering browser items
.. versionadded:: 2.10
%End

%TypeHeaderCode
#include "qgsbrowserdockwidget.h"
%End
public:

explicit QgsBrowserTreeFilterProxyModel( QObject *parent );
%Docstring
Constructor for QgsBrowserTreeFilterProxyModel
@param parent parent widget
%End
void setBrowserModel( QgsBrowserModel *model );
%Docstring
Set the browser model
%End
void setFilterSyntax( const QString &syntax );
%Docstring
Set the filter syntax
%End
void setFilter( const QString &filter );
%Docstring
Set the filter
%End
void setCaseSensitive( bool caseSensitive );
%Docstring
Set case sensitivity
%End
void updateFilter();
%Docstring
Update filter
%End

protected:


bool filterAcceptsString( const QString &value ) const;
%Docstring
Filter accepts string
:rtype: bool
%End

virtual bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;

%Docstring
It would be better to apply the filer only to expanded (visible) items, but using mapFromSource() + view here was causing strange errors
:rtype: bool
%End

bool filterAcceptsAncestor( const QModelIndex &sourceIndex ) const;
%Docstring
Returns true if at least one ancestor is accepted by filter
:rtype: bool
%End

bool filterAcceptsDescendant( const QModelIndex &sourceIndex ) const;
%Docstring
Returns true if at least one descendant s accepted by filter
:rtype: bool
%End

bool filterAcceptsItem( const QModelIndex &sourceIndex ) const;
%Docstring
Filter accepts item name
:rtype: bool
%End
};


/************************************************************************
Expand Down
3 changes: 3 additions & 0 deletions src/gui/CMakeLists.txt
Expand Up @@ -174,6 +174,7 @@ SET(QGIS_GUI_SRCS
qgsblendmodecombobox.cpp
qgsbrowsertreeview.cpp
qgsbrowserdockwidget.cpp
qgsbrowserdockwidget_p.cpp
qgsbusyindicatordialog.cpp
qgscharacterselectordialog.cpp
qgscheckablecombobox.cpp
Expand Down Expand Up @@ -363,6 +364,7 @@ SET(QGIS_GUI_MOC_HDRS
qgsdial.h
qgsdialog.h
qgsdockwidget.h
qgsbrowserdockwidget_p.h
qgsbrowserdockwidget.h
qgsencodingfiledialog.h
qgserrordialog.h
Expand Down Expand Up @@ -651,6 +653,7 @@ SET(QGIS_GUI_HDRS
qgstablewidgetitem.h
qgsuserinputdockwidget.h
qgsbrowserdockwidget.h
qgsbrowserdockwidget_p.h
qgsvertexmarker.h
qgsfiledownloader.h

Expand Down

0 comments on commit d62d444

Please sign in to comment.