Results 1 to 3 of 3

Thread: [Qt4.5] event(QEvent * event) freeze application

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default [Qt4.5] event(QEvent * event) freeze application

    when I try to use event it freeze everything
    *.h
    Qt Code:
    1. #include <QtGui/QWidget>
    2.  
    3.  
    4. namespace Ui
    5. {
    6. class Widget;
    7.  
    8. }
    9. class Widget : public QWidget
    10. {
    11. Q_OBJECT
    12. protected:
    13. virtual bool event(QEvent * event);
    14. public:
    15. Widget(QWidget *parent = 0);
    16. ~Widget();
    17.  
    18. public slots:
    19.  
    20. private:
    21. Ui::Widget *ui;
    22.  
    23. };
    To copy to clipboard, switch view to plain text mode 
    *.cpp
    Qt Code:
    1. bool Widget::event(QEvent * event)
    2. {event->accept();
    3. if(event->type()==QEvent::Enter)
    4. {
    5. ui->label_2->setText("QEvent::Enter");
    6. }
    7. return true;
    8. }
    To copy to clipboard, switch view to plain text mode 

    it looks like it is working but only some miliseconds and stops. label_2 had write only half of text "QEvent::E"
    Last edited by jpn; 25th May 2009 at 20:23. Reason: changed [qtclass] to [code]

Similar Threads

  1. Replies: 4
    Last Post: 19th February 2009, 11:10
  2. Qt4.2.2: Application freeze
    By arunvv in forum Newbie
    Replies: 1
    Last Post: 9th September 2008, 21:16
  3. Qt plug-in for GLib event loop based application
    By profoX in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2008, 14:27
  4. Close Event for DialogBased Application.
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2007, 12:33
  5. How to post a key event to another application
    By mitskits in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2006, 13:09

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.