Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Moving the opencv window on top Qt(c++) dialogs/widgets
Forum Updated to NodeBB v4.3 + New Features

Moving the opencv window on top Qt(c++) dialogs/widgets

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
13 Posts 2 Posters 4.5k 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.
  • D Offline
    D Offline
    demonferrari
    wrote on 29 Dec 2017, 12:51 last edited by
    #1

    Hello Everyone,

    I am new to Qt. I am developing a Qt(c++) and opencv application on Ubuntu 14.

    My application has three Qt diaglog windows.The 2nd dialog opens by pressing the pushbutton on the first dialog. The 3rd dialog opens by pressing the pushbutton on the 2nd dialog.

    In the 3rd dialog on the press of a push button i do some image processing operations using opencv and display the results using opencv function namedWindow. This is shown in image10_1514551827413_image1.png .

    The problem is that i am not able to move opencv windows("source" and "centers") on top of the 3 qt dialogs. This is shown in image2. I,e i want to bring the opencv windows to foreground. 0_1514551860528_image2.png

    How do i move the opencv windows on top of all the qt dialogs(bring it to foreground) and have complete access to the opencv window to perform operations like clicking on pixels, rectangular selection , thresholding using scroll bar(basically mouse call back) on the opencv window.

    Please help me out with this problem

    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 29 Dec 2017, 12:54 last edited by mrjj
      #2

      Hi
      How are you showing the dialogs?
      Dialogs are pr default modal, meaning they block other windows from interaction while open.
      if you use exec() it will block.
      if you use show(), they will not. ( make sure to new the dialog or it runs out of scope)
      Maybe you rather have at Qt:tool window if design is to have the dialog open while
      using the mainwindow?

      You might also considering docks
      http://doc.qt.io/qt-5/qtwidgets-mainwindows-dockwidgets-example.html
      which can both float as windows and be in the sides.

      D 1 Reply Last reply 29 Dec 2017, 13:47
      0
      • M mrjj
        29 Dec 2017, 12:54

        Hi
        How are you showing the dialogs?
        Dialogs are pr default modal, meaning they block other windows from interaction while open.
        if you use exec() it will block.
        if you use show(), they will not. ( make sure to new the dialog or it runs out of scope)
        Maybe you rather have at Qt:tool window if design is to have the dialog open while
        using the mainwindow?

        You might also considering docks
        http://doc.qt.io/qt-5/qtwidgets-mainwindows-dockwidgets-example.html
        which can both float as windows and be in the sides.

        D Offline
        D Offline
        demonferrari
        wrote on 29 Dec 2017, 13:47 last edited by
        #3

        @mrjj

        Thanks for the reply.

        I am using the show() option (by newing the dialog). But still i am not able to get the two image windows to the foreground. The two image windows("source" and "center") are from opencv (cv::namedWindow) .

        Will i face any problem if i use qt for developing GUI and opencv for image processing operations? (I read on the internet that qt and opencv run on different threads. Is this true?)

        M 1 Reply Last reply 29 Dec 2017, 13:56
        0
        • D demonferrari
          29 Dec 2017, 13:47

          @mrjj

          Thanks for the reply.

          I am using the show() option (by newing the dialog). But still i am not able to get the two image windows to the foreground. The two image windows("source" and "center") are from opencv (cv::namedWindow) .

          Will i face any problem if i use qt for developing GUI and opencv for image processing operations? (I read on the internet that qt and opencv run on different threads. Is this true?)

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 29 Dec 2017, 13:56 last edited by
          #4

          @demonferrari
          Hi
          Can you try with
          http://doc.qt.io/qt-5/qwidget.html#raise
          since you are using show() it sounds ok.

          Hmm are you saying those are openCV windows?

          D 1 Reply Last reply 29 Dec 2017, 13:58
          0
          • M mrjj
            29 Dec 2017, 13:56

            @demonferrari
            Hi
            Can you try with
            http://doc.qt.io/qt-5/qwidget.html#raise
            since you are using show() it sounds ok.

            Hmm are you saying those are openCV windows?

            D Offline
            D Offline
            demonferrari
            wrote on 29 Dec 2017, 13:58 last edited by
            #5

            @mrjj

            Yes they are opencv windows.

            M 1 Reply Last reply 29 Dec 2017, 14:06
            0
            • D demonferrari
              29 Dec 2017, 13:58

              @mrjj

              Yes they are opencv windows.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 29 Dec 2017, 14:06 last edited by mrjj
              #6

              @demonferrari
              ok, are those made with Qt or native windows ?
              It seems to be native windows and as such, they know nothing
              about Qt widgetstack/order.

              They do talk about Qt at their site.

              Normally people use the output in Qt windows/widgets
              https://stackoverflow.com/questions/14729417/open-webcamera-with-opencv-and-show-it-with-qlabel-white-window/14729778#14729778

              You might be able to wrap the CV window in
              http://doc.qt.io/qt-5/qwindow.html#details
              so they become part of the Qt system.

              Update:
              Are CV windows actually Qt powered ?

              D 1 Reply Last reply 29 Dec 2017, 14:11
              0
              • M mrjj
                29 Dec 2017, 14:06

                @demonferrari
                ok, are those made with Qt or native windows ?
                It seems to be native windows and as such, they know nothing
                about Qt widgetstack/order.

                They do talk about Qt at their site.

                Normally people use the output in Qt windows/widgets
                https://stackoverflow.com/questions/14729417/open-webcamera-with-opencv-and-show-it-with-qlabel-white-window/14729778#14729778

                You might be able to wrap the CV window in
                http://doc.qt.io/qt-5/qwindow.html#details
                so they become part of the Qt system.

                Update:
                Are CV windows actually Qt powered ?

                D Offline
                D Offline
                demonferrari
                wrote on 29 Dec 2017, 14:11 last edited by
                #7

                @mrjj

                Yes opencv windows are developed using qt.

                M 1 Reply Last reply 29 Dec 2017, 14:12
                0
                • D demonferrari
                  29 Dec 2017, 14:11

                  @mrjj

                  Yes opencv windows are developed using qt.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 29 Dec 2017, 14:12 last edited by
                  #8

                  @demonferrari
                  Ok, should just work then.
                  Are you giving them a parent ?
                  Did raise have any effect ?

                  D 2 Replies Last reply 29 Dec 2017, 14:26
                  0
                  • M mrjj
                    29 Dec 2017, 14:12

                    @demonferrari
                    Ok, should just work then.
                    Are you giving them a parent ?
                    Did raise have any effect ?

                    D Offline
                    D Offline
                    demonferrari
                    wrote on 29 Dec 2017, 14:26 last edited by
                    #9

                    @mrjj

                    No. I used lower() to lower the qt widget window but still the same result.

                    M 1 Reply Last reply 29 Dec 2017, 14:32
                    0
                    • D demonferrari
                      29 Dec 2017, 14:26

                      @mrjj

                      No. I used lower() to lower the qt widget window but still the same result.

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 29 Dec 2017, 14:32 last edited by
                      #10

                      @demonferrari
                      ok, hard to tell whats up with those.
                      maybe look in the CV source to see what flags are used to create them.
                      Also if you are giving the QDialog parents (like dialog where u open second),
                      they might stay over those etc.

                      Sorry, i cant provide more direct tips.- I dont know CV windows.

                      1 Reply Last reply
                      0
                      • M mrjj
                        29 Dec 2017, 14:12

                        @demonferrari
                        Ok, should just work then.
                        Are you giving them a parent ?
                        Did raise have any effect ?

                        D Offline
                        D Offline
                        demonferrari
                        wrote on 29 Dec 2017, 14:32 last edited by
                        #11

                        @mrjj

                        I think we should make changes in the qt code used to implement the opencv window

                        M 1 Reply Last reply 29 Dec 2017, 14:33
                        0
                        • D demonferrari
                          29 Dec 2017, 14:32

                          @mrjj

                          I think we should make changes in the qt code used to implement the opencv window

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 29 Dec 2017, 14:33 last edited by
                          #12

                          @demonferrari
                          well at least check out what flags are used to create them.

                          D 1 Reply Last reply 29 Dec 2017, 14:57
                          0
                          • M mrjj
                            29 Dec 2017, 14:33

                            @demonferrari
                            well at least check out what flags are used to create them.

                            D Offline
                            D Offline
                            demonferrari
                            wrote on 29 Dec 2017, 14:57 last edited by
                            #13

                            @mrjj

                            i checked the header and cpp files for the opencv window GUI. I was not able to figure out .

                            how do i check for the flags?

                            1 Reply Last reply
                            0

                            5/13

                            29 Dec 2017, 13:58

                            topic:navigator.unread, 8
                            • Login

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