Hi
My Qml page is very simple: ToolButton and WebView. Now it loads background and shows nothing but white rectangle (WebView object) even toolbutton is transparent, but accessible. I can load page by hand (clicking on toolbutton). But I want open page at application start! My code is as follow:
Qt Code:
  1. import QtQuick 2.2
  2. import QtQuick.Controls 1.4
  3. import QtWebView 1.1
  4. import QtQuick.Layouts 1.1
  5.  
  6. Rectangle {
  7. id: rec1
  8. color: "black"
  9. gradient: Gradient {
  10. GradientStop {
  11. position: 0.00;
  12. color: "#000000";
  13. }
  14. GradientStop {
  15. position: 1.00;
  16. color: "#ffffff";
  17. }
  18. }
  19.  
  20. ToolButton {
  21. id: reloadButton
  22. tooltip: qsTr("Reload")
  23. onClicked: web1.url = "http://google.pl"
  24. }
  25.  
  26.  
  27. // anchors.fill: parent
  28. WebView {
  29. id: web1
  30. objectName: "web1"
  31. visible: true
  32. anchors.top: reloadButton.bottom
  33. anchors.bottom: parent.bottom
  34. anchors.left: parent.left
  35. anchors.right: parent.right
  36. //anchors.fill: parent
  37. anchors.margins: 10
  38. url: "http://google.pl"
  39. onLoadingChanged: {
  40. if(loadRequest.errorString)
  41. console.error(loadRequest.errorString);
  42. else
  43. console.info("Load web page successfull");
  44. }
  45. Component.onCompleted: function() { web1.url = "http://google.pl"; web1.reload(); console.info("Load successfull"); }
  46. }
  47. }
To copy to clipboard, switch view to plain text mode 

How to load web page just after application start?!?

thanks and best regards
Szyk Cech