Search PDF In Qt C++ in QPDFView

375 views Asked by At

I want to Search Words in PDF File in my Qt C++ Application. I am using Qt 6.4.1 widget, QPDFView class, and QPdfSearchModel, and I don't know what the syntax is. As input I am taking in LineEdit Signal from PushButton.

void MainWindow::SearchString(const QUrl &docLocation)
{
    //*m_document="/home/droid/12.pdf".toLocalFile();
    auto nav = ui->pdfView->pageNavigator();
   //QString res;
  //  res= QString searchString(text);
    //auto navs=ui->pdfView->searchString(text);
//QString find=ui->pdfView->find(text);
//void res;
QString text;

text=ui->lineEdit->text();
QString file=docLocation.toLocalFile();

    QPdfSearchModel *search=new QPdfSearchModel(this);
   search->setDocument(m_document->);//Problem???

This is my appLication Widget: My application Widget

I have used Pdf Search Model but don't know the syntax to use with my application. Path of my pdf is Stored in const &Qurl docLocation.

0

There are 0 answers