Results 1 to 11 of 11

Thread: Connect Window with MainWindow different Files.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2014
    Posts
    8
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Connect Window with MainWindow different Files.

    Hello.


    I wanna make a connection between two functions in different files with differents Dialogs (QDialog and QMainWindow).

    File # 1.

    The function database.Users() establish a conection with a mysql server, and if the user is Ok, then return 0.
    The next step is call the function showPrivileges() on MainWindow.cpp file.

    connectDialog.cpp
    Qt Code:
    1. void connectDialog::login()
    2. {
    3. if (database.Users() == 0){
    4. << here.. >>
    5. this.close();
    6. }
    7. else
    8. ui->labelUserError->setVisible(true);
    9. }
    To copy to clipboard, switch view to plain text mode 


    File # 2
    See the showPrivileges() function in MainWindow, this make two labels visible in MainWindow form.

    MainWindow.cpp
    Qt Code:
    1. void MainWindow::showPrivileges()
    2. {
    3. ui->label0->setVisible(true);
    4. ui->label1->setEnabled(true);
    5.  
    6. }
    To copy to clipboard, switch view to plain text mode 

    I wanna call the function void MainWindow::showPrivileges() in real time, execution time..
    From the if sentence in void connectDialog::login() function before of the line this.close();


    I don't know how do this. Please help me.


    Thanks...
    Last edited by Mauricio; 9th July 2014 at 21:52.

Similar Threads

  1. Replies: 11
    Last Post: 6th October 2013, 19:40
  2. How to connect functions of QML files?
    By Yonetici in forum Qt Quick
    Replies: 2
    Last Post: 20th July 2012, 19:47
  3. connect mainwindow with self-made widgets
    By pinkiP in forum Qt Programming
    Replies: 11
    Last Post: 10th July 2012, 10:16
  4. Replies: 0
    Last Post: 9th May 2010, 20:49
  5. Replies: 1
    Last Post: 11th September 2007, 13:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.