hi to all.
This is my first post so i hope that this is the right section.
I'm going to post a little portion of my code and a fter i'll go to expose my problem


pdfviewer.h:

Qt Code:
  1. #ifndef PDFVIEWER_H
  2. #define PDFVIEWER_H
  3.  
  4. #include <QMainWindow>
  5. #include <QImage>
  6. #include <QVector>
  7. #include <iostream>
  8. #include <poppler/qt4/poppler-qt4.h>
  9. #include <QFileDialog>
  10.  
  11.  
  12. namespace Ui {
  13. class PdfViewer;
  14. }
  15.  
  16. class PdfViewer : public QMainWindow
  17. {
  18. Q_OBJECT
  19.  
  20. public:
  21. explicit PdfViewer(QString, QWidget *parent = 0);
  22. ~PdfViewer();
  23. bool setDocument(const QString &filePath);
  24. void showPage(int page);
  25. int getCurrentPage();
  26. void setScale(double scaleFactor = 1.0);
  27.  
  28. private slots:
  29. void on_indietroBtn_clicked();
  30. void on_avantiBtn_clicked();
  31. void on_comboBox_currentIndexChanged(int index);
  32.  
  33. void on_lineEdit_returnPressed();
  34.  
  35. private:
  36. Ui::PdfViewer *ui;
  37. int currentPage;
  38. Poppler::Document *doc;
  39. double scaleFactor;
  40. QVector<qreal> scaleFactors;
  41.  
  42. };
  43.  
  44. #endif // PDFVIEWER_H
To copy to clipboard, switch view to plain text mode 


mainwindow.cpp:

Qt Code:
  1. ....................
  2.  
  3. QString filePath = model->record(index.row()).value("path").toString();
  4. PdfViewer *pdfViewer = new PdfViewer(filePath, 0);
  5. pdfViewer->show();
  6.  
  7. ....................
To copy to clipboard, switch view to plain text mode 

whit this code i can open a pdf from a path to a local file.now i have this url

http://www.ing.unisi.it/didattica/matdid/2163.pdf

which is a pdf itself.Can i open directly this file by passing it's URL to PdfViewer?
i've tried this

Qt Code:
  1. QUrl url("http://www.ing.unisi.it/didattica/matdid/2162.pdf");
  2. QString filePath = url.path();
  3. PdfViewer *pdfViewer = new PdfViewer(filePath, 0);
  4. pdfViewer->show();
To copy to clipboard, switch view to plain text mode 

but it doesn't work

error:
Qt Code:
  1. Error: Cannot open the specified file
  2. Couldn't open file '/didattica/matdid/2162.pdf': File or directory not exist.
To copy to clipboard, switch view to plain text mode 

thank to all for the replies and i want to say sorry for my bad english.