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 show window on modal window?
Forum Updated to NodeBB v4.3 + New Features

How to show window on modal window?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 447 Views
  • 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
    masa4
    wrote on last edited by masa4
    #1

    I have a window with some buttons. When i click buttons it opens a window as modal window (setWindowModality(Qt::ApplicationModal) setted). And it block the interaction with mainwindow as i expect.
    Now I want to open new window(my custom keyboard) from modal and interaction with modal and newwindow should be possible when newwindow always stays top of modal.

    i tried adding

    setWindowFlags(Qt::WindowStaysOnTopHint|Qt::X11BypassWindowManagerHint);
    

    on top window but it didnt do the job. All windows inherited from QWidget. how can i do that?

    jsulmJ 1 Reply Last reply
    0
    • M masa4

      I have a window with some buttons. When i click buttons it opens a window as modal window (setWindowModality(Qt::ApplicationModal) setted). And it block the interaction with mainwindow as i expect.
      Now I want to open new window(my custom keyboard) from modal and interaction with modal and newwindow should be possible when newwindow always stays top of modal.

      i tried adding

      setWindowFlags(Qt::WindowStaysOnTopHint|Qt::X11BypassWindowManagerHint);
      

      on top window but it didnt do the job. All windows inherited from QWidget. how can i do that?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @masa4 said in How to show window on modal window?:

      I want to open new window from modal and interaction with modal and newwindow should be possible

      How exactly do you open this new window (code)?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        @masa4 said in How to show window on modal window?:

        I want to open new window from modal and interaction with modal and newwindow should be possible

        How exactly do you open this new window (code)?

        M Offline
        M Offline
        masa4
        wrote on last edited by masa4
        #3

        @jsulm When focus in/out event occured for lineedit widgets on modal, i am emitting signals. Connecting it to a slot in mainwidget.cpp. the slot:
        mainwidget.cpp:

        void MainWidget::KeyboardOpen()
        {
            keyboard->show();
        }
        void MainWidget::KeyboardClose()
        {
            keyboard->close();
        }
        

        mainwidget.h

        Keyboard *keyboard = new Keyboard;
        

        It opens the keyboard widget. I want the keyboard widget allways on top with allowing interaction with modal window.

        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