Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to build Qt (qtwebview module) from Sources
Forum Updated to NodeBB v4.3 + New Features

How to build Qt (qtwebview module) from Sources

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 599 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MiTem
    wrote on last edited by
    #1

    Hello All,

    I'm developing an application for iOS 11, and I'm using qtwebview (aka WKWebView) module for UI. My application should play videos sometimes, but with the newest iOS 11 updates, User has to make at least one UI interaction before the video can be played with sound. So I found a solution for that: Change WKWebViewConfiguration and pass it to WKWebView.

    file that I modified: ~/Qt/5.11.0/Src/qtwebview/src/plugins/darwin/qdarwinwebview.mm

    QDarwinWebViewPrivate::QDarwinWebViewPrivate(QObject *p)
        : QAbstractWebView(p)
        , wkWebView(nil)
    #ifdef Q_OS_IOS
        , m_recognizer(0)
    #endif
    {
        CGRect frame = CGRectMake(0.0, 0.0, 400, 400);
    
    //---Allow-Video-Playback-Programmatically---
        WKWebViewConfiguration* wkConfiguration = [[WKWebViewConfiguration alloc] init]; 
        [wkConfiguration setAllowsInlineMediaPlayback: YES]; 
        [wkConfiguration setMediaTypesRequiringUserActionForPlayback:WKAudiovisualMediaTypeNone];
     wkWebView = [[WKWebView alloc] initWithFrame:frame configuration:wkConfiguration];
    //---^^^--End--^^^---
    
    //    wkWebView = [[WKWebView alloc] initWithFrame:frame];
       
    
        wkWebView.navigationDelegate = [[QtWKWebViewDelegate alloc] initWithQAbstractWebView:this];
        [wkWebView addObserver:wkWebView.navigationDelegate forKeyPath:@"estimatedProgress"
                       options:NSKeyValueObservingOptions(NSKeyValueObservingOptionNew)
                       context:nil];
    
    #ifdef Q_OS_IOS
        m_recognizer = [[QIOSNativeViewSelectedRecognizer alloc] initWithQWindowControllerItem:this];
        [wkWebView addGestureRecognizer:m_recognizer];
    #endif
    }
    

    After that I'm running

    ~/Qt/5.11.0/Src/configure -prefix ./5.11.0-modified -debug-and-release -nomake tests -nomake examples -xplatform macx-ios-clang -commercial -confirm-license
    ...
    make -j4
    

    And at some point of compiling process I'm receiving errors.

    I would appreciate if someone tell me what I'm doing wrong? I'm compiling Qt from sources for the first time.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What exact error are you having ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MiTem
        wrote on last edited by
        #3

        Thanks.
        I'm getting an error like this:

        /Users/mitem/WorkSpace/GitHub/qt5/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm:827:20: error: 
              qualified reference to 'QFixed' is a constructor name rather than a type in this context
            return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
                           ^
        1 error generated.
        make[4]: *** [.obj/qfontengine_coretext.o] Error 1
        make[3]: *** [sub-fontdatabases-make_first] Error 2
        make[2]: *** [sub-platformsupport-make_first] Error 2
        make[1]: *** [sub-src-make_first] Error 2
        make: *** [module-qtbase-make_first] Error 2
        

        Also I forgot to mention that I'm working on macOS 10.13 and I have Qt5.11 installed from online installer.

        M 1 Reply Last reply
        0
        • M MiTem

          Thanks.
          I'm getting an error like this:

          /Users/mitem/WorkSpace/GitHub/qt5/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm:827:20: error: 
                qualified reference to 'QFixed' is a constructor name rather than a type in this context
              return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
                             ^
          1 error generated.
          make[4]: *** [.obj/qfontengine_coretext.o] Error 1
          make[3]: *** [sub-fontdatabases-make_first] Error 2
          make[2]: *** [sub-platformsupport-make_first] Error 2
          make[1]: *** [sub-src-make_first] Error 2
          make: *** [module-qtbase-make_first] Error 2
          

          Also I forgot to mention that I'm working on macOS 10.13 and I have Qt5.11 installed from online installer.

          M Offline
          M Offline
          MiTem
          wrote on last edited by
          #4

          I just found a fix for that issue:
          https://wiki.qt.io/Qt_5.9.5_Known_Issues

          I'm not sure why the bug from Qt5.9.5 is still in Qt5.11.
          Anyway, I'm still waiting when the build finishes.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved