[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_content.php on line 1014: Undefined array key 3
qtforum.de • [gelöst]Trolltech - Tutorial "Calculator"
Seite 1 von 1

[gelöst]Trolltech - Tutorial "Calculator"

Verfasst: 23. Oktober 2007 14:09
von Allroad
Hallo,

bin grad dabei die QT-tutoials durchzugehen und hab ein problem mit dem beispiel "Calculator" zu "Using a Component in Your Application".
es compiliert fehlerfrei, die summe ist aber immer 0.
ich alles wie im tutorial beschrieben erstellt , bis auf die namen der zwei SpinBox-es und des Labels :
statt "inputSpinBox1" -> hab ich einfach "spinBox1" ,
"inputSpinBox2" -> "spinBox2"
"outputWidget" -> "widget".

entsprechent habe ich auch calculatorform.cpp aktualisiert:

statt:

Code: Alles auswählen

ui.outputWidget->setText(QString::number(value + ui.inputSpinBox2->value()));

bei mir:

Code: Alles auswählen

ui.widget->setText(QString::number(value + ui.spinBox2->value()));
hat jemand eine idee woran das liegt?

Danke!

Verfasst: 23. Oktober 2007 14:42
von Christian81
Da dies autoconnect-Signals sind, muss natürlich auch der Signal-Name angepasst werden. sonst wird die Funktion nie aufgerufen.

Verfasst: 23. Oktober 2007 14:49
von Allroad
ok, danke hat geklappt! :lol: