Mailinglist Archive: opensuse-programming (84 mails)
| < Previous | Next > |
Again the output format of QDate, addDays() and currentDate()
- From: Prabu Subroto <prabu_subroto@xxxxxxxxx>
- Date: Mon, 9 Aug 2004 10:48:03 -0700 (PDT)
- Message-id: <20040809174803.42921.qmail@xxxxxxxxxxxxxxxxxxxxxxx>
Dear my friends..
I am still confused how to use the QDate and
QDateEdit.
1. How can I issue the current date with QDate.
2. I want to add the currectDate with some days
(addDays() ).
3. I want to detemine the output of the QDateEdit to
become "yyyy-MM-dd".
Here what I've done:
=============
QDate tgl;
QDate appdate = tgl->currentDate();
if ( appdateEdit->isEnabled() ){
appdate = appdateEdit->date();
}
else{
if ( hari1radioButton->isChecked() ){
appdate = tgl->addDays(1);
}
if ( minggu1radioButton->isChecked() ){
appdate = tgl->addDays(7);
}
if ( hari14radioButton->isChecked() ){
appdate = tgl->addDays(14);
}
if ( minggu4radioButton->isChecked() ){
appdate = tgl->addDays(28);
}
}
QTime apptime = apptimeEdit->time();
QString warned = "N";
QString sqlapprep = QString("insert into
appointment (noapp, custid, salesid, date, time,done,
warned) values('%1', '%1', '%1', '%1', '%1', 'N',
'N')")
.arg(noapp)
.arg(cid)
.arg(sid)
.arg(
appdate.toString("yyyy-MM-dd")
.arg( apptime.toString );
===============
And here is the error message as I compiled my code:
In file included from .ui/funonseqform.cpp:38:
funonseqform.ui.h: In member function `virtual void
funonseqForm::sendreportSlot()':
funonseqform.ui.h:279: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:287: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:290: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:293: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:296: error: base operand of `->' has
non-pointer type `QDate'
make: *** [.obj/funonseqform.o] Error 1
patrixlinux@patrix:~/arsip/proyek/qt/kv/client>
========
Please tell me where my mistake.
Thank you very much in advance.
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
I am still confused how to use the QDate and
QDateEdit.
1. How can I issue the current date with QDate.
2. I want to add the currectDate with some days
(addDays() ).
3. I want to detemine the output of the QDateEdit to
become "yyyy-MM-dd".
Here what I've done:
=============
QDate tgl;
QDate appdate = tgl->currentDate();
if ( appdateEdit->isEnabled() ){
appdate = appdateEdit->date();
}
else{
if ( hari1radioButton->isChecked() ){
appdate = tgl->addDays(1);
}
if ( minggu1radioButton->isChecked() ){
appdate = tgl->addDays(7);
}
if ( hari14radioButton->isChecked() ){
appdate = tgl->addDays(14);
}
if ( minggu4radioButton->isChecked() ){
appdate = tgl->addDays(28);
}
}
QTime apptime = apptimeEdit->time();
QString warned = "N";
QString sqlapprep = QString("insert into
appointment (noapp, custid, salesid, date, time,done,
warned) values('%1', '%1', '%1', '%1', '%1', 'N',
'N')")
.arg(noapp)
.arg(cid)
.arg(sid)
.arg(
appdate.toString("yyyy-MM-dd")
.arg( apptime.toString );
===============
And here is the error message as I compiled my code:
In file included from .ui/funonseqform.cpp:38:
funonseqform.ui.h: In member function `virtual void
funonseqForm::sendreportSlot()':
funonseqform.ui.h:279: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:287: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:290: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:293: error: base operand of `->' has
non-pointer type `QDate'
funonseqform.ui.h:296: error: base operand of `->' has
non-pointer type `QDate'
make: *** [.obj/funonseqform.o] Error 1
patrixlinux@patrix:~/arsip/proyek/qt/kv/client>
========
Please tell me where my mistake.
Thank you very much in advance.
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
| < Previous | Next > |