From: Jason Harris Date: Sun, 13 Nov 2005 05:01:25 +0000 (+0000) Subject: Qt Designer wants widgets to have a ctor with only one argument: pointer X-Git-Tag: v3.80.2~220 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=6a4db5de0067b050a33843840be5e10ced57f5a0;p=libqmvoc.git Qt Designer wants widgets to have a ctor with only one argument: pointer to the parent widget. Adding such a ctor to ExtDateEdit and ExtDateTimeEdit. CCMAIL: kstars-devel@kde.org svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=480082 --- diff --git a/extdate/extdatetimeedit.cpp b/extdate/extdatetimeedit.cpp index eaa8cdf..8dbb010 100644 --- a/extdate/extdatetimeedit.cpp +++ b/extdate/extdatetimeedit.cpp @@ -55,6 +55,11 @@ ExtDateEdit::ExtDateEdit( int jd, QWidget *parent ) { ExtDateEdit( ed, parent ); } +ExtDateEdit::ExtDateEdit( QWidget *p ) { + ExtDate ed = ExtDate::currentDate(); + ExtDateEdit( ed, p ); +} + ExtDateEdit::~ExtDateEdit() { } @@ -129,7 +134,7 @@ void ExtDateEdit::stepBy( int steps ) { else setValue( v ); } -QValidator::State ExtDateEdit::validate( QString &input, int &pos ) { +QValidator::State ExtDateEdit::validate( QString &input, int & ) { if ( ExtDate::fromString( input, m_DateFormat ).isValid() ) return QValidator::Acceptable; else @@ -211,6 +216,11 @@ ExtDateTimeEdit::ExtDateTimeEdit( const ExtDate &date, const QTime &time, QWidge ExtDateTimeEdit( dt, parent ); } +ExtDateTimeEdit::ExtDateTimeEdit( QWidget *p ) { + ExtDateTime edt = ExtDateTime::currentDateTime(); + ExtDateTimeEdit( edt, p ); +} + ExtDateTimeEdit::~ExtDateTimeEdit() { } diff --git a/extdate/extdatetimeedit.h b/extdate/extdatetimeedit.h index 20a3da4..20caeed 100644 --- a/extdate/extdatetimeedit.h +++ b/extdate/extdatetimeedit.h @@ -50,10 +50,9 @@ #include #include #include -class QTime; -class QTimeEdit; -class ExtDate; -class ExtDateTime; +#include +#include +#include "extdatetime.h" class ExtDateEdit : public QSpinBox { Q_OBJECT @@ -66,6 +65,7 @@ class ExtDateEdit : public QSpinBox { *@p parent pointer to the parent widget (default: 0) */ ExtDateEdit( const ExtDate &date = ExtDate::currentDate(), QWidget *parent = 0 ); + /** *@short Constructor. Creates an ExtDateEdit displaying the *given date. @@ -75,6 +75,12 @@ class ExtDateEdit : public QSpinBox { *@p parent pointer to the parent widget (default: 0) */ ExtDateEdit( int jd, QWidget *parent = 0 ); + +/** + *@short Constructor for UI files (contains only a parent widget argument) + */ + ExtDateEdit( QWidget *parent ); + /** *@short Default destructor. Empty. */ @@ -236,11 +242,10 @@ class ExtDateTimeEdit : public QWidget { *to be displayed (defaults to the system's current date and time) *@p p pointer to the parent widget (default: 0) */ - ExtDateTimeEdit( const ExtDateTime &dt = ExtDateTime::currentDateTime(), -QWidget *p=0 ); + ExtDateTimeEdit( const ExtDateTime &dt = ExtDateTime::currentDateTime(), QWidget *p=0 ); /** - *@short Default Constructor. Displays the given Date and Time. + *@short Constructor. Displays the given Date and Time. * *This is essentially identical to the above function, differing only in *the type of its arguments. @@ -248,7 +253,12 @@ QWidget *p=0 ); *@p t reference to a QTime which is to be displayed in the time box *@p p pointer to the parent widget (default: 0) */ - ExtDateTimeEdit( const ExtDate &date, const QTime &time, QWidget *p=0 ); + ExtDateTimeEdit( const ExtDate &date, const QTime &time, QWidget *p=0 ); + +/** + *@short Constructor for UI files (contains only a parent widget argument) + */ + ExtDateTimeEdit( QWidget *p ); /** *@short Default Destructor. Empty.