Results 1 to 2 of 2

Thread: How to call a function from another window?

  1. #1
    Join Date
    Apr 2009
    Posts
    75
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default How to call a function from another window?

    Hi,

    I've a main window, and I'opening a new window from it:
    Qt Code:
    1. void MainWindow::slotNowyTransport(){
    2. OFormNowyTransport = new FormNowyTransport(this);
    3. OFormNowyTransport->show();
    4. }
    To copy to clipboard, switch view to plain text mode 

    and I've another function:
    Qt Code:
    1. void MainWindow::refresh(){
    2. refresh_list();
    3. }
    To copy to clipboard, switch view to plain text mode 


    When i've opened a OFormNowyTransport a fill the form, and call FormNowyTransport::add().

    There is (in FormNowyTransport::add() function) on the end this->close(); before I'ld like to call a MainWindow::refresh() to refresh the list.


    How can I do that?
    Last edited by TomASS; 7th October 2009 at 20:46. Reason: missing [code] tags

  2. #2
    Join Date
    Apr 2007
    Posts
    76
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to call a function from another window?

    if i understand right you have a list in your main form and you fill this list in FormNowyTransport.

    I would do it with a list which is initialized in main form and passed it by reference to FormNowyTransport

    OFormNowyTransport = new FormNowyTransport(this,&"someList")
    or create a signal slot relaltion in mainform
    connect(OFormNowyTransport,close,this,"listtransfo rm")

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 15:22
  2. Regading Driver to connect Postgresql Database
    By dummystories in forum Installation and Deployment
    Replies: 38
    Last Post: 12th March 2009, 08:19
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57
  4. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 18:33
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 13:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.