QT - Błąd w QCustomPlot? Wysyp aplikacji.

0

Witam!

Coś mi się aplikacja wywala, stworzyłem nowy projekt aby namierzyć co się dzieje:

Test 1 - OK

    // ui->customplot <- QCustomPlot

    QCPAxisRect *ar = new QCPAxisRect(ui->customplot);

    ui->customplot->plotLayout()->clear();
    ui->customplot->plotLayout()->addElement(0, 0, ar);
    ui->customplot->plotLayout()->takeAt(0); // ściągnięcie QCPAxisRect z listy QCustomPlot'a

    ar->setParent(0);
    delete ui->customplot; // symulowanie zakończenia aplikacji -> zwolnienie QCustomPlot'a

Test 2 - apka się wysypuje

    // ui->customplot <- QCustomPlot

    QCPAxisRect *ar = new QCPAxisRect(ui->customplot);

    ui->customplot->plotLayout()->clear();
    ui->customplot->plotLayout()->addElement(0, 0, ar);
    ui->customplot->plotLayout()->takeAt(0); // ściągnięcie QCPAxisRect z listy QCustomPlot'a

    delete ui->customplot; // symulowanie zakończenia aplikacji -> zwolnienie QCustomPlot'a

Test 3 - OK

    // ui->customplot <- QCustomPlot

    QCPAxisRect *ar = new QCPAxisRect(ui->customplot);

    ui->customplot->plotLayout()->clear();
    ui->customplot->plotLayout()->addElement(0, 0, ar);
    ui->customplot->plotLayout()->takeAt(0); // ściągnięcie QCPAxisRect z listy QCustomPlot'a

    delete ar;
    delete ui->customplot; // symulowanie zakończenia aplikacji -> zwolnienie QCustomPlot'a

Wygląda to trochę jakby destruktory się troszkę pomieszały. Staram się prześledzić co dokładnie jest nie tak.
Może ktoś z tym miał też problem? Może coś przeoczyłem?

Po dodaniu elementu i ściągnięciu, nie powinno być takich cyrków.

0

Problem rozwiązany.
Jakby ktoś też miał z tym problem:

http://www.qcustomplot.com/index.php/support/forum/919

1 użytkowników online, w tym zalogowanych: 0, gości: 1