Skip to content

Commit

Permalink
fix QgsExternalResourceWidget valueChanged signal
Browse files Browse the repository at this point in the history
also add some missing ConvertToClassCode
  • Loading branch information
3nids committed May 10, 2017
1 parent a6883f7 commit 4ae8065
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
16 changes: 15 additions & 1 deletion python/gui/qgsexternalresourcewidget.sip
@@ -1,8 +1,22 @@

%ModuleHeaderCode
// fix to allow compilation with sip 4.7 that for some reason
// doesn't add this include to the file where the code from
// ConvertToSubClassCode goes.
#include "qgsexternalresourcewidget.h"
%End

class QgsExternalResourceWidget : QWidget
{
%TypeHeaderCode
#include <qgsexternalresourcewidget.h>
#include "qgsexternalresourcewidget.h"
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsExternalResourceWidget*>(sipCpp) != NULL)
sipType = sipType_QgsExternalResourceWidget;
else
sipType = NULL;
%End

public:
Expand Down
14 changes: 14 additions & 0 deletions python/gui/qgsfilewidget.sip
@@ -1,10 +1,24 @@

%ModuleHeaderCode
// fix to allow compilation with sip 4.7 that for some reason
// doesn't add this include to the file where the code from
// ConvertToSubClassCode goes.
#include "qgsfilewidget.h"
%End

class QgsFileWidget : QWidget
{
%TypeHeaderCode
#include <qgsfilewidget.h>
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsFileWidget*>(sipCpp) != NULL)
sipType = sipType_QgsFileWidget;
else
sipType = NULL;
%End

public:
/**
* @brief The StorageMode enum determines if the file picker should pick files or directories
Expand Down
24 changes: 15 additions & 9 deletions python/gui/qgsfilterlineedit.sip
@@ -1,17 +1,23 @@
/** \class QgsFilterLineEdit
* \ingroup gui
* QLineEdit subclass with built in support for clearing the widget's value and
* handling custom null value representations.
*
* When using QgsFilterLineEdit the value(), setValue() and clearValue() methods should be used
* instead of QLineEdit's text(), setText() and clear() methods, and the valueChanged()
* signal should be used instead of textChanged().
**/
%ModuleHeaderCode
// fix to allow compilation with sip 4.7 that for some reason
// doesn't add this include to the file where the code from
// ConvertToSubClassCode goes.
#include "qgsfilterlineedit.h"
%End

class QgsFilterLineEdit : QLineEdit
{
%TypeHeaderCode
#include <qgsfilterlineedit.h>
%End

%ConvertToSubClassCode
if (dynamic_cast<QgsFilterLineEdit*>(sipCpp) != NULL)
sipType = sipType_QgsFilterLineEdit;
else
sipType = NULL;
%End

public:

//! Behaviour when clearing value of widget
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsexternalresourcewidget.cpp
Expand Up @@ -59,6 +59,7 @@ QgsExternalResourceWidget::QgsExternalResourceWidget( QWidget *parent )
setLayout( layout );

connect( mFileWidget, SIGNAL( fileChanged( QString ) ), this, SLOT( loadDocument( QString ) ) );
connect( mFileWidget, SIGNAL( fileChanged( QString ) ), this, SIGNAL( valueChanged( QString ) ) );
}

QVariant QgsExternalResourceWidget::documentPath( QVariant::Type type ) const
Expand Down

0 comments on commit 4ae8065

Please sign in to comment.