you've been reading? So you saw this http://qt-project.org/doc/qt-4.8/qdatetime.html#setDate ?
you've been reading? So you saw this http://qt-project.org/doc/qt-4.8/qdatetime.html#setDate ?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
And what does this method return? Does it return QDate? Or QDate & ? If it returns QDate, then this is a temporary, a copy of the QDate stored in data_incio. Changing the copy has no effect at all on on the original QDate stored in data_incio.ui->data_inicio->date()
Of course the setDate() function call will return true, because even if the QDate is a temporary, setting it to a new date will work just fine. It just has no effect, because at the end of that line of code, the copy is destroyed and whatever changes you made go with it.
Last edited by d_stranz; 8th May 2012 at 17:43.
Or maybe, since Daniel won't tell us what "data_inico" is, we can just keep guessing at answers until one of us guesses correctly.Maybe you should call setDate() on the ui->data_inicio object?
try reading the thread
try reading the docs http://qt-project.org/doc/qt-4.8/qda...blic-functions
Last edited by amleto; 17th May 2012 at 23:37.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
I managed to solve the problem.
Now I can not and the pm or am a QTimeEdit. I've had to do the builders and they do not allow for it ... How do I solve this?
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
I have the following code.
Qt Code:
To copy to clipboard, switch view to plain text mode
Where do I put the AM or PM?
is there a brick wall I can borrow? ...
spoon feeding ...
qt-project.org/doc/qt-4.8/qdatetime.html#fromString
Last edited by amleto; 18th May 2012 at 00:32.
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
You don't. You read the documentation... it is obvious. I'll even highlight the bit that answers your question
What is 3 PM on a 24-hour clock?QTime::QTime ( int h, int m, int s = 0, int ms = 0 )
Constructs a time with hour h, minute m, seconds s and milliseconds ms.
h must be in the range 0 to 23, m and s must be in the range 0 to 59, and ms must be in the range 0 to 999.
"We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.
sousadaniel7 (18th May 2012)
no, that's not what you did, and no, it shouldn't work.
Look carefully!
http://qt-project.org/doc/qt-4.8/qdatetime.html#setDate
http://qt-project.org/doc/qt-4.8/qdate.html#setDate
and try again...
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
Bookmarks