Results 1 to 8 of 8

Thread: Slot doesn't get called

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Location
    USA
    Posts
    300
    Thanks
    82
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Slot doesn't get called

    This should be simple, but I don't see it.
    Trying to emit a signal in the EditLog class to call a slot in the MainWindow.
    No error, but the slot doesn't get called.

    the EditLog.h entries:
    Qt Code:
    1. signals:
    2. void logChanged();
    3.  
    4. private slots:
    5. void on_pbSave_clicked();
    6. void on_pbCancel_clicked();
    To copy to clipboard, switch view to plain text mode 

    the EditLog cpp
    Qt Code:
    1. void EditLog::on_pbSave_clicked()
    2. {
    3. // some code
    4. emit logChanged();
    To copy to clipboard, switch view to plain text mode 

    the MainWindow.h
    Qt Code:
    1. public slots:
    2. void updateLogView();
    To copy to clipboard, switch view to plain text mode 

    the MainWindow.cpp // updateLogView never gets executed
    Qt Code:
    1. // in the constructor:
    2. EditLog el;
    3. connect(&el, SIGNAL(logChanged()), this, SLOT(updateLogView()));
    4. //
    5. void MainWindow::updateLogView() {
    6. view->selectionModel()->clearSelection();
    7. model->select();
    8. view->resizeColumnsToContents();
    9. qDebug() << "edit model error is " << model->lastError();
    10. }
    To copy to clipboard, switch view to plain text mode 

    Any idea what I am missing?
    Last edited by waynew; 17th April 2010 at 23:01. Reason: Forgot some code

Similar Threads

  1. How come this slot doesn't get called every second?
    By ShaChris23 in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2009, 23:41
  2. Replies: 0
    Last Post: 17th September 2009, 10:40
  3. Slot gets called twice
    By greatgatsby in forum Newbie
    Replies: 7
    Last Post: 20th August 2009, 15:11
  4. commitData doesn't seem to be called...
    By tone in forum Qt Programming
    Replies: 7
    Last Post: 10th September 2008, 14:42
  5. SLOT not being called
    By steg90 in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2007, 11:30

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.