Skip to content

Commit 5c5deec

Browse files
committedSep 1, 2014
SIP file for new date time edit
1 parent 834c630 commit 5c5deec

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed
 

‎python/gui/gui.sip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
%Include qgscolorschemelist.sip
4040
%Include qgscomposerview.sip
4141
%Include qgscredentialdialog.sip
42+
%Include qgsdatetimeedit.sip
4243
%Include qgsdetaileditemdata.sip
4344
%Include qgsdetaileditemdelegate.sip
4445
%Include qgsdialog.sip

‎python/gui/qgsdatetimeedit.sip

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
class QgsDateTimeEdit : QDateTimeEdit
3+
{
4+
5+
%TypeHeaderCode
6+
#include "qgsdatetimeedit.h"
7+
%End
8+
9+
10+
public:
11+
explicit QgsDateTimeEdit( QWidget *parent /TransferThis/ = 0 );
12+
13+
//! determines if the widget allows setting null date/time.
14+
void setAllowNull( bool allowNull );
15+
bool allowNull() const;
16+
17+
/**
18+
* @brief setDateTime set the date time in the widget and handles null date times.
19+
* @note since QDateTimeEdit::setDateTime() is not virtual, setDateTime must be called for QgsDateTimeEdit.
20+
*/
21+
void setDateTime( const QDateTime &dateTime );
22+
23+
/**
24+
* @brief dateTime returns the date time which can eventually be a null date/time
25+
* @note since QDateTimeEdit::dateTime() is not virtual, dateTime must be called for QgsDateTimeEdit.
26+
*/
27+
QDateTime dateTime() const;
28+
29+
//! Set the current date as NULL
30+
//! @note if the widget is not configured to accept NULL dates, this will have no effect
31+
virtual void clear();
32+
33+
34+
protected:
35+
virtual void resizeEvent( QResizeEvent* event );
36+
37+
void mousePressEvent( QMouseEvent*event );
38+
};

‎src/gui/editorwidgets/qgsdatetimeedit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class GUI_EXPORT QgsDateTimeEdit : public QDateTimeEdit
3434

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.