ASSERT failure in QVector<T>::at: "index out of range", file ..\..\include/QtCore/../../src/corelib/tools/qvector.h, line 338
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Ich habe folgende Testfunktion:
Code: Alles auswählen
void MindCounter::displayMyLabel(){
QLabel *label = new QLabel(this);
label->setText("first line\nsecond line");
}MindCounter::MindCounter(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MindCounter)
{
ui->setupUi(this);
init();
displayMyLabel();
}
wenn ich sie aus der init()-Funkion aufrufe geht sie!
wenn ich sie per KeyBoard-Shortcut aufrufe geht sie wieder nicht.
wenn ich displayMyLabel(), aus meiner Funktion starteCounter() aufrufe, was mein Ziel ist, geht es natürlich auch nicht.
Was zum ... ???
Wer kann helfen. Wie muss die funktion abgeändert werden dass von überall ein Label im Hauptfenster oben links über alles drübergelegt wird.