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. Pop-up window with widgets using QT Creator
Forum Updated to NodeBB v4.3 + New Features

Pop-up window with widgets using QT Creator

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 14.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.
  • J Offline
    J Offline
    Jayson.Prichard
    wrote on 2 Dec 2013, 03:57 last edited by
    #1

    I am trying to create a window. I don't know if it's proper name is a pop-up window or a secondary (not main) window. I want a window to display when the user selects "setup" from the pull-down menu. On this window, I want widgets to set things like the default directory for data, user name, etc. This will require user input.

    The best example I can find to describe it is in Qt Creator (2.6.2) itself. Go to Tools -> Options.

    I have the following, which displays a pop-up window; but I don't know how to add the widgets. All my window/screen development has been through the "Design" function in Creator.

    @
    QWidget *popup = new QWidget();
    popup->show();
    @

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 2 Dec 2013, 08:52 last edited by
      #2

      Hi,

      Replace QWidget with your designer made widget or if you have a more complex setup like Qt Creator's option. Create one custom widget that contains and handle the others.

      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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BlastDV
        wrote on 2 Dec 2013, 21:23 last edited by
        #3

        Hello there! I know of two ways for this:

        1 Read the Demos' documentation and code in order to figure out how to build windows by coding; you will get familiar with the processes of creating layouts, buttons, labels and more. Though this provides huge liberty to build your interface, you may find that a lot of time will be consumed by using this method.

        2 Add a new class to your project, which inherits from QWidget and includes a ui designer form. Then use the Designer as you are used to, and finally, include your class's header in your main window header, and create a pointer to it like MyPopUpWindow* popUp; Finally, create and instantiate it with

        @MyPopUpWindow* popUp= new MyPopUpWindow();
        popUp->show();@

        And that would be all... By the way, I'm assuming you're using C++.

        (8) Just live your life blind like me (8)

        1 Reply Last reply
        0

        1/3

        2 Dec 2013, 03:57

        • Login

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