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. [Solved]How can we say that a widget is native or alien(non-native) ??

[Solved]How can we say that a widget is native or alien(non-native) ??

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 3.0k 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.
  • A Offline
    A Offline
    ankursaxena
    wrote on last edited by
    #1

    How can we know that a widget is native or alien(non-native) and what is the means of the follwong line.

    "If a widget is non-native (alien) and winId() is invoked on it, that widget will be provided a native handle."

    This is from docs.

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

      Hi,

      IIRC, widgets are by default alien since Qt 4.4. You should be able to check that using QWidget::testAttribute with Qt::WA_NativeWindow as parameter.

      It means that if you call winId(), the alien widget will become a native widget.

      Hope it helps

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

      don-progD 1 Reply Last reply
      0
      • A Offline
        A Offline
        ankursaxena
        wrote on last edited by
        #3

        thanx Gaist ..!!!

        1 Reply Last reply
        0
        • IamSumitI Offline
          IamSumitI Offline
          IamSumit
          wrote on last edited by
          #4

          hello frnds,

          This is really a good and interesting discussion.
          Your Qt Widgets are alien widget means they have less priority over the native widget/forms of OS.But passing the handle of Qt widgets you can make them as native widget/forms(in behavior).
          Then OS treats your Qt app widgets as OS's widgets after passing the handle.
          Hope it will help you.

          Be Cute

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            IIRC, widgets are by default alien since Qt 4.4. You should be able to check that using QWidget::testAttribute with Qt::WA_NativeWindow as parameter.

            It means that if you call winId(), the alien widget will become a native widget.

            Hope it helps

            don-progD Offline
            don-progD Offline
            don-prog
            wrote on last edited by
            #5

            @SGaist hi! Can you check my question about native widgets(https://forum.qt.io/topic/66624/display-gstreamer-video-on-android)?
            Regards.

            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