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. How to connect one ui withe the other.

How to connect one ui withe the other.

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

    Here is my Textpad project link. I have two ui files. Now I want to connect signal emitted by action of one ui to the slot that displays the other ui. I want "Help>>About Textpad" in my project to display the dialog.ui. How can I achieve this. I am pretty new to QT.

    "Download my project from here.":https://skydrive.live.com/redir?resid=BBF9030540A807A5!803&authkey=!ACrO9NDLy0F4zWY

    1 Reply Last reply
    0
    • P Offline
      P Offline
      panosk
      wrote on last edited by
      #2

      Haven't looked at your code, but you can do sth like this:
      Make a slot for opening the dialog.
      @
      private slots:
      void showDialog() {
      Dialog *dialog = new Dialog;
      dialog.show();
      }
      @

      And a connection between the action and the slot.

      @
      connect(yourAction,SIGNAL(triggered()),this,SLOT(showDialog()));
      @

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        Hi Vikramjeet!
        First of all add
        @#include "dialog.h"@
        to mainwindow.cpp
        then as wrote panosk, in about() slot body put following code:
        @void MainWindow::about()
        {
        Dialog *dlg = new Dialog(this);
        dlg->exec();
        }@

        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