Skip to content

Commit

Permalink
SIP file for new date time edit
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Sep 1, 2014
1 parent 834c630 commit 5c5deec
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions python/gui/gui.sip
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
%Include qgscolorschemelist.sip
%Include qgscomposerview.sip
%Include qgscredentialdialog.sip
%Include qgsdatetimeedit.sip
%Include qgsdetaileditemdata.sip
%Include qgsdetaileditemdelegate.sip
%Include qgsdialog.sip
Expand Down
38 changes: 38 additions & 0 deletions python/gui/qgsdatetimeedit.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

class QgsDateTimeEdit : QDateTimeEdit
{

%TypeHeaderCode
#include "qgsdatetimeedit.h"
%End


public:
explicit QgsDateTimeEdit( QWidget *parent /TransferThis/ = 0 );

//! determines if the widget allows setting null date/time.
void setAllowNull( bool allowNull );
bool allowNull() const;

/**
* @brief setDateTime set the date time in the widget and handles null date times.
* @note since QDateTimeEdit::setDateTime() is not virtual, setDateTime must be called for QgsDateTimeEdit.
*/
void setDateTime( const QDateTime &dateTime );

/**
* @brief dateTime returns the date time which can eventually be a null date/time
* @note since QDateTimeEdit::dateTime() is not virtual, dateTime must be called for QgsDateTimeEdit.
*/
QDateTime dateTime() const;

//! Set the current date as NULL
//! @note if the widget is not configured to accept NULL dates, this will have no effect
virtual void clear();


protected:
virtual void resizeEvent( QResizeEvent* event );

void mousePressEvent( QMouseEvent*event );
};
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsdatetimeedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GUI_EXPORT QgsDateTimeEdit : public QDateTimeEdit

//! determines if the widget allows setting null date/time.
void setAllowNull( bool allowNull );
bool allowNull() {return mAllowNull;}
bool allowNull() const {return mAllowNull;}

/**
* @brief setDateTime set the date time in the widget and handles null date times.
Expand Down

0 comments on commit 5c5deec

Please sign in to comment.