Typica is a free program for professional coffee roasters. https://typica.us
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

abouttypica.cpp 973B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*228:*/
  2. #line 36 "./abouttypica.w"
  3. #include "abouttypica.h"
  4. /*229:*/
  5. #line 45 "./abouttypica.w"
  6. AboutTypica::AboutTypica():QMainWindow(NULL)
  7. {
  8. QFile aboutFile(":/resources/html/about.html");
  9. aboutFile.open(QIODevice::ReadOnly);
  10. QByteArray content= aboutFile.readAll();
  11. QWebView*banner= new QWebView;
  12. banner->setHtml(content,QUrl("qrc:/resources/html/about.html"));
  13. aboutFile.close();
  14. setCentralWidget(banner);
  15. QWebPage*page= banner->page();
  16. page->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks);
  17. connect(page,SIGNAL(linkClicked(QUrl)),this,SLOT(linkClicked(QUrl)));
  18. }
  19. /*:229*//*230:*/
  20. #line 63 "./abouttypica.w"
  21. void AboutTypica::linkClicked(const QUrl&url)
  22. {
  23. if(url.scheme()=="typica")
  24. {
  25. QString address(url.toEncoded());
  26. if(address=="typica://aboutqt")
  27. {
  28. QMessageBox::aboutQt(this);
  29. }
  30. else
  31. {
  32. qDebug()<<"Unexpected link. Got: "<<address;
  33. }
  34. }
  35. else
  36. {
  37. QDesktopServices::openUrl(url);
  38. }
  39. }
  40. #line 5697 "./typica.w"
  41. /*:230*/
  42. #line 39 "./abouttypica.w"
  43. /*:228*/