Skip to content

Commit 4ae8065

Browse files
committedMay 10, 2017
fix QgsExternalResourceWidget valueChanged signal
also add some missing ConvertToClassCode
1 parent a6883f7 commit 4ae8065

File tree

4 files changed

+45
-10
lines changed

4 files changed

+45
-10
lines changed
 

‎python/gui/qgsexternalresourcewidget.sip

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11

2+
%ModuleHeaderCode
3+
// fix to allow compilation with sip 4.7 that for some reason
4+
// doesn't add this include to the file where the code from
5+
// ConvertToSubClassCode goes.
6+
#include "qgsexternalresourcewidget.h"
7+
%End
8+
29
class QgsExternalResourceWidget : QWidget
310
{
411
%TypeHeaderCode
5-
#include <qgsexternalresourcewidget.h>
12+
#include "qgsexternalresourcewidget.h"
13+
%End
14+
15+
%ConvertToSubClassCode
16+
if (dynamic_cast<QgsExternalResourceWidget*>(sipCpp) != NULL)
17+
sipType = sipType_QgsExternalResourceWidget;
18+
else
19+
sipType = NULL;
620
%End
721

822
public:

‎python/gui/qgsfilewidget.sip

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11

2+
%ModuleHeaderCode
3+
// fix to allow compilation with sip 4.7 that for some reason
4+
// doesn't add this include to the file where the code from
5+
// ConvertToSubClassCode goes.
6+
#include "qgsfilewidget.h"
7+
%End
8+
29
class QgsFileWidget : QWidget
310
{
411
%TypeHeaderCode
512
#include <qgsfilewidget.h>
613
%End
714

15+
%ConvertToSubClassCode
16+
if (dynamic_cast<QgsFileWidget*>(sipCpp) != NULL)
17+
sipType = sipType_QgsFileWidget;
18+
else
19+
sipType = NULL;
20+
%End
21+
822
public:
923
/**
1024
* @brief The StorageMode enum determines if the file picker should pick files or directories

‎python/gui/qgsfilterlineedit.sip

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
/** \class QgsFilterLineEdit
2-
* \ingroup gui
3-
* QLineEdit subclass with built in support for clearing the widget's value and
4-
* handling custom null value representations.
5-
*
6-
* When using QgsFilterLineEdit the value(), setValue() and clearValue() methods should be used
7-
* instead of QLineEdit's text(), setText() and clear() methods, and the valueChanged()
8-
* signal should be used instead of textChanged().
9-
**/
1+
%ModuleHeaderCode
2+
// fix to allow compilation with sip 4.7 that for some reason
3+
// doesn't add this include to the file where the code from
4+
// ConvertToSubClassCode goes.
5+
#include "qgsfilterlineedit.h"
6+
%End
7+
108
class QgsFilterLineEdit : QLineEdit
119
{
1210
%TypeHeaderCode
1311
#include <qgsfilterlineedit.h>
1412
%End
13+
14+
%ConvertToSubClassCode
15+
if (dynamic_cast<QgsFilterLineEdit*>(sipCpp) != NULL)
16+
sipType = sipType_QgsFilterLineEdit;
17+
else
18+
sipType = NULL;
19+
%End
20+
1521
public:
1622

1723
//! Behaviour when clearing value of widget

‎src/gui/qgsexternalresourcewidget.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ QgsExternalResourceWidget::QgsExternalResourceWidget( QWidget *parent )
5959
setLayout( layout );
6060

6161
connect( mFileWidget, SIGNAL( fileChanged( QString ) ), this, SLOT( loadDocument( QString ) ) );
62+
connect( mFileWidget, SIGNAL( fileChanged( QString ) ), this, SIGNAL( valueChanged( QString ) ) );
6263
}
6364

6465
QVariant QgsExternalResourceWidget::documentPath( QVariant::Type type ) const

0 commit comments

Comments
 (0)
Please sign in to comment.