Please nominate your Qt Champions for 2021!

How to connect one ui withe the other.

  • 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.":!803&authkey=!ACrO9NDLy0F4zWY

  • 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;;

    And a connection between the action and the slot.


  • 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);

Log in to reply