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. Open a new form from MainWindow
QtWS25 Last Chance

Open a new form from MainWindow

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.3k 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.
  • I Offline
    I Offline
    iyustlop
    wrote on last edited by
    #1

    Hi all,

    I am creating a new app and I have created a two form MainWindow and addData. I need to open this second form on the event of click a button.

    Could someone tell me how to open this second form?

    I have tried some tutorial and some youtube videos but I haven´t found out one that can fit with my problem.

    Thank very much in advanced.

    jsulmJ 1 Reply Last reply
    0
    • Pradeep KumarP Offline
      Pradeep KumarP Offline
      Pradeep Kumar
      wrote on last edited by
      #2

      Hi @iyustlop

      As u mentioned u need to open the second form in click event on clicking of button, use signal and slots,
      button as clicked signal, write ur own slot, call the second form show() in slot.

      use connect statement.

      Thanks,

      Pradeep Kumar
      Qt,QML Developer

      1 Reply Last reply
      3
      • I iyustlop

        Hi all,

        I am creating a new app and I have created a two form MainWindow and addData. I need to open this second form on the event of click a button.

        Could someone tell me how to open this second form?

        I have tried some tutorial and some youtube videos but I haven´t found out one that can fit with my problem.

        Thank very much in advanced.

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @iyustlop What is the exact problem? You can show a QWidget based class calling http://doc.qt.io/qt-5/qwidget.html#show. If your addData window is derived from QDialog and id you want to show it as a modal window you can use http://doc.qt.io/qt-5/qdialog.html#exec

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2

        • Login

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