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. Replacing Windows DestroyWindow call

Replacing Windows DestroyWindow call

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 1.4k 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.
  • J Offline
    J Offline
    joeydonovan4
    wrote on last edited by
    #1

    Is replacing DestroyWindow as simple as using 'delete'? Using cpp

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      @joeydonovan4 said:

      Is replacing DestroyWindow as simple as using 'delete'? Using cpp

      What do you mean???
      DestroyWindow is not a Qt function; what do you need?

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • J Offline
        J Offline
        joeydonovan4
        wrote on last edited by
        #3

        DestroyWindow is a Windows function. How do I replace it using Qt or just c++

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          If you want, you can call Windows API.

          IMO this kind of questions is wrong. You have to understand how Qt works and then design your application to use correctly the Qt API. You should use Native API only for features not provided by Qt

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alex_malyu
            wrote on last edited by
            #5

            QWidgets are C++ classes which hides system specific api.
            If you want QWidget* to be deleted and you created instance with operator new you call delete w.
            As for any C++ type this will destroy instance (and window if any was shown)

            If you want just to hyide widget you can call hide().

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

              Hi,

              Depending on where you would do that, deleteLater() would be more adequate

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

              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