]> Git trees. - libqmvoc.git/commitdiff
Qt Designer wants widgets to have a ctor with only one argument: pointer
authorJason Harris <kstars@30doradus.org>
Sun, 13 Nov 2005 05:01:25 +0000 (05:01 +0000)
committerJason Harris <kstars@30doradus.org>
Sun, 13 Nov 2005 05:01:25 +0000 (05:01 +0000)
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

extdate/extdatetimeedit.cpp
extdate/extdatetimeedit.h

index eaa8cdf770570d9213de234945c1a552752f069d..8dbb0103baf57a0fbcd3283cc09e9f9d6a93bcdf 100644 (file)
@@ -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() {
 }
 
index 20a3da434e7c35992eddf9a863587fd7ba63e43e..20caeeda9db9b938ff3802aedb1c24054ce8d67d 100644 (file)
 #include <QSpinBox>
 #include <QWidget>
 #include <QLineEdit>
-class QTime;
-class QTimeEdit;
-class ExtDate;
-class ExtDateTime;
+#include <QTime>
+#include <QTimeEdit>
+#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.