Skip to content

Commit

Permalink
avoid overriding method in subclass
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 16, 2023
1 parent 4fe0cbd commit 166ad00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion python/pyplugin_installer/installer_data.py
Expand Up @@ -244,7 +244,7 @@ def timeForChecking(self) -> bool:
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:
Expand Down
9 changes: 8 additions & 1 deletion src/core/settings/qgssettingsentryimpl.h
Expand Up @@ -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;
Expand Down

0 comments on commit 166ad00

Please sign in to comment.