avoid overriding method in subclass

This commit is contained in:
Denis Rouzaud 2023-01-13 21:35:56 +01:00
parent 4fe0cbd6ac
commit 166ad00f6c
3 changed files with 17 additions and 3 deletions

View File

@ -84,7 +84,14 @@ This constructor is intended to be used from plugins.
sipCpp = new sipQgsSettingsEntryVariant( QgsSettingsEntryVariant( *a0, QgsSettings::createPluginTreeElement( *a1 ), *a2, *a3, *a4 ) );
%End
SIP_PYOBJECT value( SIP_PYOBJECT type = 0 ) const;
SIP_PYOBJECT valueAs( SIP_PYOBJECT type ) const;
%Docstring
Returns settings value.
:param type: is the Python type of the value to be returned
%End
%MethodCode
typedef PyObject *( *pyqt5_from_qvariant_by_type )( QVariant &value, PyObject *type );
QVariant value;

View File

@ -244,7 +244,7 @@ class Repositories(QObject):
settings = QgsSettings()
try:
# QgsSettings may contain ivalid value...
interval = QgsSettings.createPluginTreeElement("_plugin_manager").childSetting('check-on-start-last-date').value(type=QDate).daysTo(QDate.currentDate())
interval = QgsSettings.createPluginTreeElement("_plugin_manager").childSetting('check-on-start-last-date').valueAs(type=QDate).daysTo(QDate.currentDate())
except:
interval = 0
if interval >= Repositories.CHECK_ON_START_INTERVAL:

View File

@ -90,7 +90,14 @@ class CORE_EXPORT QgsSettingsEntryVariant : public QgsSettingsEntryByReference<Q
#endif
#ifdef SIP_RUN
SIP_PYOBJECT value( SIP_PYOBJECT type = 0 ) const;
/**
* Returns settings value.
*
* \param type is the Python type of the value to be returned
*/
SIP_PYOBJECT valueAs( SIP_PYOBJECT type ) const;
% MethodCode
typedef PyObject *( *pyqt5_from_qvariant_by_type )( QVariant &value, PyObject *type );
QVariant value;