Results 1 to 1 of 1

Thread: QMenu and addAction problem

  1. #1
    Join Date
    Jul 2010
    Posts
    30
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QMenu and addAction problem

    Hello there !
    What is wrong with this code, i am confused
    Qt Code:
    1. void QNotePad::createMenus()
    2. {
    3. QMenu *fileMenu = menuBar()->addMenu("File");
    4. m_newFileAction = fileMenu->addAction("New");
    5. }
    To copy to clipboard, switch view to plain text mode 
    this function belongs to my MainWindow but when i run this code Qt says :

    The program has unexpectedly finished.
    /home/saeed/Documents/Qt Project/QNotePad-build-desktop/QNotePad exited with code 0

    m_newFileAction is a QAction * data member.
    Thanks


    Added after 28 minutes:


    i found it !
    i had forgotten to insert QT+= gui core in my .pro file when i create new empty project
    Last edited by .:saeed:.; 20th January 2011 at 10:04.
    Impossible = I'mpossible

Similar Threads

  1. Probem Tiling an image with QPixmap
    By LuckyBlade in forum Qt Programming
    Replies: 20
    Last Post: 13th January 2011, 16:03
  2. Replies: 4
    Last Post: 16th September 2010, 17:24
  3. QImage Non-Standard Format Probem
    By photo_tom in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2010, 09:06
  4. Replies: 12
    Last Post: 21st November 2008, 05:42
  5. QMenu
    By khcbabu in forum Qt Programming
    Replies: 2
    Last Post: 22nd October 2008, 15:08

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.