Skip to content
Permalink
Browse files

Start on base class for numeric format widgets

  • Loading branch information
nyalldawson committed Jan 7, 2020
1 parent 6088edd commit 552913cdebb78025a236951db5ee8731c0bb87ba
@@ -0,0 +1,60 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/numericformats/qgsnumericformatwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/


class QgsNumericFormatWidget : QgsPanelWidget
{
%Docstring
Base class for widgets which allow control over the properties of QgsNumericFormat subclasses

.. versionadded:: 3.12
%End

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

QgsNumericFormatWidget( QWidget *parent /TransferThis/ );
%Docstring
Constructor for QgsNumericFormatWidget.
%End

virtual void setFormat( QgsNumericFormat *format ) = 0;
%Docstring
Sets the ``format`` to show in the widget. Ownership is not transferred.

.. seealso:: :py:func:`format`
%End

virtual QgsNumericFormat *format() = 0 /TransferBack/;
%Docstring
Returns the format defined by the current settings in the widget.

Ownership of the returned object is transferred to the caller

.. seealso:: :py:func:`setFormat`
%End

signals:

void changed();
%Docstring
Emitted whenever the configuration of the numeric format is changed.
%End

};


/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/numericformats/qgsnumericformatwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -295,6 +295,7 @@
%Include auto_generated/layout/qgslayoutviewtoolzoom.sip
%Include auto_generated/locator/qgslocatorwidget.sip
%Include auto_generated/numericformats/qgsnumericformatselectorwidget.sip
%Include auto_generated/numericformats/qgsnumericformatwidget.sip
%Include auto_generated/processing/qgsprocessingalgorithmconfigurationwidget.sip
%Include auto_generated/processing/qgsprocessingalgorithmdialogbase.sip
%Include auto_generated/processing/qgsprocessinggui.sip
@@ -203,6 +203,7 @@ SET(QGIS_GUI_SRCS
locator/qgslocatorwidget.cpp

numericformats/qgsnumericformatselectorwidget.cpp
numericformats/qgsnumericformatwidget.cpp

ogr/qgsogrhelperfunctions.cpp
ogr/qgsnewogrconnection.cpp
@@ -794,6 +795,7 @@ SET(QGIS_GUI_HDRS
locator/qgslocatorwidget.h

numericformats/qgsnumericformatselectorwidget.h
numericformats/qgsnumericformatwidget.h

ogr/qgsnewogrconnection.h
ogr/qgsogrhelperfunctions.h
@@ -0,0 +1,16 @@
/***************************************************************************
qgsnumericformatwidget.cpp
--------------------------
begin : January 2020
copyright : (C) 2020 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "qgsnumericformatwidget.h"
@@ -0,0 +1,67 @@
/***************************************************************************
qgsnumericformatwidget.h
------------------------
begin : January 2020
copyright : (C) 2020 by Nyall Dawson
email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSNUMERICFORMATWIDGET_H
#define QGSNUMERICFORMATWIDGET_H

#include "qgis_sip.h"
#include "qgsnumericformat.h"
#include "qgspanelwidget.h"
#include <QStandardItemModel>

/**
* \ingroup gui
* \class QgsNumericFormatWidget
* Base class for widgets which allow control over the properties of QgsNumericFormat subclasses
* \since QGIS 3.12
*/
class GUI_EXPORT QgsNumericFormatWidget : public QgsPanelWidget
{
Q_OBJECT

public:

/**
* Constructor for QgsNumericFormatWidget.
*/
QgsNumericFormatWidget( QWidget *parent SIP_TRANSFERTHIS )
: QgsPanelWidget( parent )
{}

/**
* Sets the \a format to show in the widget. Ownership is not transferred.
* \see format()
*/
virtual void setFormat( QgsNumericFormat *format ) = 0;

/**
* Returns the format defined by the current settings in the widget.
*
* Ownership of the returned object is transferred to the caller
*
* \see setFormat()
*/
virtual QgsNumericFormat *format() = 0 SIP_TRANSFERBACK;

signals:

/**
* Emitted whenever the configuration of the numeric format is changed.
*/
void changed();

};


#endif // QGSNUMERICFORMATWIDGET_H

0 comments on commit 552913c

Please sign in to comment.
You can’t perform that action at this time.