
Originally Posted by
ChrisW67
The warning is perfectly correct but this has nothing to do with the code you have posted. Somewhere in your program you are trying to connect() a QTimeEdit object with an invalid signal name. If you never called connect() directly then you probably have a function on_someTimeEdit_cursorPositionChanged() somewhere in a Qt Designer form class.
As for the problem "doesn't calculate with the typed time" you will have to explain the problem.
Where do you see the problem?
What input do you enter?
What output do you get?
Why is the wrong?
I juste changed the time by keyboard in an QTimeEdit elemet and it automatically calculated the new times for the other QTimeEdit elements and displayed them.
I realized hat created a slot for every QTimeEdit. for example the for the QTImeElement which displays the Time for the UK:
void WeltZeit
::on_ENtimeEdit_timeChanged(const QTime &time
) {
QTime deTime
= ui
->ENtimeEdit
->time
().
addSecs(3600);
//adds an hour ui->DEtimeEdit->setTime(deTime);
QTime nyTime
= ui
->ENtimeEdit
->time
().
addSecs(-18000);
ui->NytimeEdit->setTime(nyTime);
if (DST == 1)
{
QTime jpTime
= ui
->ENtimeEdit
->time
().
addSecs(28800);
ui->NytimeEdit->setTime(jpTime);
}
else
{
QTime jpTime
= ui
->ENtimeEdit
->time
().
addSecs(32400);
ui->NytimeEdit->setTime(jpTime);
}
}
void WeltZeit::on_ENtimeEdit_timeChanged(const QTime &time)
{
QTime deTime = ui->ENtimeEdit->time().addSecs(3600); //adds an hour
ui->DEtimeEdit->setTime(deTime);
QTime nyTime = ui->ENtimeEdit->time().addSecs(-18000);
ui->NytimeEdit->setTime(nyTime);
if (DST == 1)
{
QTime jpTime = ui->ENtimeEdit->time().addSecs(28800);
ui->NytimeEdit->setTime(jpTime);
}
else
{
QTime jpTime = ui->ENtimeEdit->time().addSecs(32400);
ui->NytimeEdit->setTime(jpTime);
}
}
To copy to clipboard, switch view to plain text mode
But that doesn't work anymore.
But strangely it works if I change the time via the QTimeEdit for new york(NytimeEdit) and the QTimeEdit for germany(DEtimeEdit).
Now I only get in QT the output that QTimeEdit::cursorPositionChanged() and nothing happens if I typed the new time.
I think maybe there is an problem with slots. Maybe(I can't remember) there is still the slot QTimeEdit::cursorPositionChanged() because I used it to try something. For me it changed to that problem just suddenly and since that it never changed and worked again.
I also set the current time into a QTimeElement of the current Time Zone via the Radio Button.
for example if I choose the radio Button New York the current time will be displayed in the QTimeElement CTtimeEdit and NyTimeEdit. I do that with the following code:
void WeltZeit::on_NewYorkButton_clicked()
{
ui->CTtimeEdit->setTime(ct);
ui->DEtimeEdit->setTime(ct);
....
}
void WeltZeit::on_NewYorkButton_clicked()
{
ui->CTtimeEdit->setTime(ct);
ui->DEtimeEdit->setTime(ct);
....
}
To copy to clipboard, switch view to plain text mode
The definiation of ct isn't defined in a void so I can acess it in every void(function).
The definiation of ct is:
QTime ct = QTime::currentTime();
To copy to clipboard, switch view to plain text mode
But if I choose the radio button for Japan it's one hour behind and by choosing the button for London even 2 hours behind but I set the current time into the QTimeEdit elemts via the same piece of code(like in the NewYorkButton).
Bookmarks