fralx / LimeReport

Report generator for Qt Framework
http://limereport.ru/
Other
403 stars 154 forks source link

Limereport & QCameraViewfinder crashes #299

Closed nopbit closed 4 years ago

nopbit commented 4 years ago

Hello,

Thanks for the report tool :) I am a newbie in QT. I am trying to build an personal card printing tool. If i add limereport to my QT project, i am having Segment Fault every time i try to run QCameraViewfinder and Limereport.

It is easy to test with QT camera example. If i add lime report to it, it also crashes. Do you have any idea for it? I am attaching my code also.

void MainWindow::on_pushButton_3_clicked()
{
    QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
    foreach (const QCameraInfo &cameraInfo, cameras)
    {
        qDebug() << cameraInfo.description() << ui->deviceSelection->currentText();

        if (cameraInfo.description() == ui->deviceSelection->currentText())
        {
            camera = new QCamera(cameraInfo);
            viewfinder = new QCameraViewfinder(this);
            camera->setViewfinder(viewfinder);
            ui->webcamLayout->addWidget(viewfinder);

            connect(camera, SIGNAL(error(QCamera::Error)), this, SLOT(cameraError(QCamera::Error)));

            connected = true;
            ui->pushButton_3->setText("Disconnect");

            camera->start();

            return;
        }
    }
}

void MainWindow::on_pushButton_2_clicked()
{
    m_report = new LimeReport::ReportEngine(this);
    m_report->loadFromFile("card-design2.lrxml");
    m_report->dataManager()->setReportVariable("name","JOHN");
    m_report->dataManager()->setReportVariable("surname","DOE");
    m_report->dataManager()->setReportVariable("tckn","12345678901");
    m_report->dataManager()->setReportVariable("job","TIR SÖFÖRÜ");
    m_report->dataManager()->setReportVariable("date","12.10.2010");
    //m_report->printReport();
    m_report->designReport();
}

void MainWindow::cameraError(QCamera::Error error)
{
    qDebug() << error;
    camera->stop();
}
fralx commented 4 years ago

Hi! I will check it when I have free time.

Subst27 commented 4 years ago

In wich case it crashed? when u press pushButton_3 or pushButton_2 ? or any time else?

nopbit commented 4 years ago

on_pushButton_3_clicked clicked first. This problem not occured in another computer i tested. Maybe a driver problem. If i am the only one who is having this problem maybe we can close this issue.

Subst27 commented 4 years ago

soved?