ich habe ein komisches Problem:
Das funktioniert: Wenn ich den QButton buttonExit drücke, wird ein neues Widget vom übergeordneten Widget über das Signal trainingClicked erzeugt (beinhaltet einen QPainter).
Das funktioniert nicht: Wenn ich einen Doppelklick auf das QListWidget listLesson ausführe, hängt sich das Programm auf. Dabei ruft doch die Methode (der Slot) doubleClickLesson nur die Methode (den Slot) clickTraining auf, die eigentlich funktioniert.
Zwei Slots:
Code: Alles auswählen
void StartWidget::clickTraining() {
// User finished setting the properties and wants to start the
// training lesson
int selectedLesson;
if ((selectedLesson = listLesson->currentRow()) == -1) {
return;
}
// -> emit the signal that mainwindow knows user wants to start training
emit trainingClicked(selectedLesson + 1);
}
void StartWidget::doubleClickLesson(QListWidgetItem *item) {
clickTraining();
}
Code: Alles auswählen
connect(buttonTraining, SIGNAL(clicked()), this, SLOT(clickTraining()));
connect(listLesson, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(doubleClickLesson(QListWidgetItem*)));
Code: Alles auswählen
ContinueDebugEvent (cpid=3884, ctid=2948, DBG_CONTINUE);
gdb: kernel event for pid=3884 tid=2948 code=OUTPUT_DEBUG_STRING_EVENT)
warning: QPainter::begin(), paintdevice returned engine == 0, type: 2
ContinueDebugEvent (cpid=3884, ctid=2948, DBG_CONTINUE);
gdb: kernel event for pid=3884 tid=2948 code=OUTPUT_DEBUG_STRING_EVENT)
warning: QPainter::end: Painter is not active, aborted
ContinueDebugEvent (cpid=3884, ctid=2948, DBG_CONTINUE);
gdb: kernel event for pid=3884 tid=2948 code=EXCEPTION_DEBUG_EVENT)
gdb: Target exception EXCEPTION_ACCESS_VIOLATION at 0x0056527d
Program received signal SIGSEGV, Segmentation fault.
0x0056527d in QAbstractItemView::mouseDoubleClickEvent (this=0x3948da0,
---Type <return> to continue, or q <return> to quit---
Danke vielmals!