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. Create windows with code
Qt 6.11 is out! See what's new in the release blog

Create windows with code

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.1k 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.
  • mandruk1331M Offline
    mandruk1331M Offline
    mandruk1331
    wrote on last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      Hi @mandruk1331,

      Perhaps not the simplest example, but pretty close to it:

      • https://github.com/pcolby/generic-qt-app/blob/master/src/main.cpp
      • https://github.com/pcolby/generic-qt-app/blob/master/src/widgets/mainwindow.cpp
      • https://github.com/pcolby/generic-qt-app/blob/master/src/widgets/mainwindow.h

      Creates a single main-window application, with a version-string in the Window title, and automatic save/restore of the window position (both of which you can remove).

      Cheers.

      1 Reply Last reply
      2
      • mandruk1331M Offline
        mandruk1331M Offline
        mandruk1331
        wrote on last edited by
        #3

        I have created it with QInputDialog, but now I get an error: Widgets must be created in the GUI thread. What can be the problem?

        1 Reply Last reply
        0
        • Paul ColbyP Offline
          Paul ColbyP Offline
          Paul Colby
          wrote on last edited by
          #4

          What does the code for you QInputDialog look like? How do you instantiate it?

          mandruk1331M 1 Reply Last reply
          0
          • Paul ColbyP Paul Colby

            What does the code for you QInputDialog look like? How do you instantiate it?

            mandruk1331M Offline
            mandruk1331M Offline
            mandruk1331
            wrote on last edited by
            #5

            @Paul-Colby I fixed the problem. The problem was cause because I have been creating a Dialog box not in the main thread

            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