Skip to content

Integrating PyQt5 in Flet UI #1964

@Amir4python

Description

@Amir4python

`

def main(page: ft.Page):
# DEFINE UTILITY buttons

page.title = "Something1 and something2"
SOME INTERMEDIATE CODE IS THERE

secondViewTitle = ft.AppBar(title=ft.Text("do_something2"), bgcolor=ft.colors.YELLOW_400, color=ft.colors.BLACK, toolbar_height=35)

  secondView = ft.View(route="/do_something2", controls=[secondViewTitle, MainButton])

  if page.route == "/do_something2":
 
      page.views.append(secondView)

      pyqt_demo.main() # this is PyQt5 main function`

pyqt_demo.main() is entry point function that open pyQt GUI app.
When i run the program , pyqt window application opens up, The flet UI's main page becomes completely blank. The main UI has two buttons that routes to the view pages (dosomething1 for first View and dosomething for second View). Do dosomething1 is completely a flet python code , but that is not an isssue, the main issue is with the do_something2 that calls the main function of Pyqt5 app package code.
i would get ---> warning: qapplication was not created in the main() thread. when running flet main page code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions