Forums

OverviewFelgo 2 Support (Qt 5) › Navigation menu and WebView component

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18508

    Wojciech

    I have a navigation menu (“hamburger” menu on Android) between four pages, on one of the page I have a webview component rendering web content.

    Menu on that page with webview works strangly: only first menu item is visible as other are “under” the webview component. How to fix it?

    #18511

    Alex
    Felgo Team

    Hi,

    the standard Qt WebView is drawn on top of the QML scene graph, this is why it is currently hiding anything underneath it. We are already working on a custom WebView component that improves this behavior, stay tuned for one of the next updates!

    Currently you could avoid this issue by just hiding the WebView when the drawer is open, I prepared a code example for you:

    import Felgo 3.0
    import QtWebView 1.1
    
    App {
      id: app
    
      Navigation {
        id: navigation
        navigationMode: navigationModeDrawer
        
        NavigationItem {
          title: "Web View"
          icon: IconType.globe
          
          NavigationStack {
        
            Page {
              id: page
              title: "Web View"
        
              WebView {
                anchors.fill: parent
                url: "https://www.google.com"
                // visible is only true if the drawer is NOT open
                visible: !navigation.drawer.isOpen
              }
            }
          }
        }
      }
    }

    You could also additionally show a placeholder item instead of the WebView when the drawer is open, this depends on your ui.

    Is this solution sufficient for you at the moment?

    Cheers,
    Alex

    #18516

    Wojciech

    Thank you, it seems to work now.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support