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. Basic Help
QtWS25 Last Chance

Basic Help

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 917 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.
  • G Offline
    G Offline
    Gundi
    wrote on last edited by
    #1

    I am pretty new at this but have read all the basic manuals and getting the hang of it. In QT Creator I created a MainWindow application. After the fact I wanted to create a QDialog that I link to a push button. So it created another .ui file and I get the autogenerated ui.h. I understand all the signals and slots but for the life of me I can figure out how to launch the Qdialog box from inside the Mainwindow UI. It recognizes the new class inside the MainWindow, but all I see is all the widgets (buttons, setupUI, etc) in the form, and not show() or exec(). Any help is appreciated.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      Welcome to net.

      Hope it is as simple as follows.

      QDialog *dialog = new QDialog
      dialog.show() or exec().

      bq. It recognizes the new class inside the MainWindow, but all I see is all the widgets (buttons, setupUI, etc) in the form, and not show() or exec().

      What do you mean by the above statement.

      Some code snippet would help.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thiberi0
        wrote on last edited by
        #3

        In your .ui form file, If you click with the right button at the class will show some action you can do and one of then is "go to slot". If you click at this action it will some signal's that you can connect for your slot.

        Still at "Design" there is a "Signals & Slots" editor just at left bottom, you can use it to create the connections to.

        You could also create a connection in you .h,.cpp file. Just create a normal function in you .h file:
        "void createConnection()"
        And at .cpp file you create you connection normally:
        "connect(object1,signal1,object2,slot2)"

        Now If you are trying to run show() or other's slot's function inside "Design" and I think that's not possible. You can only make the connections, to execute than you have to run your application.

        thiberi0

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gundi
          wrote on last edited by
          #4

          Thank you that worked. It seems like I can just build it manually like you stated to make it easier.

          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