Results 1 to 6 of 6

Thread: Load menu from database

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Load menu from database

    Hi everybody !

    I have a database which contains all Menu Items ,and I set up a connection to load all these items to Menu The code is :

    Qt Code:
    1. .....
    2. for(int x = 0; x < myResults->record().count(); x++)
    3. {
    4. QString fieldName=myResults->value(x).toString();
    5. mAction= new QAction(QIcon(myIconPath+"/mCollectPatrol.png"), tr(fieldName), this);
    6. ...
    7. if(x==3)
    8. [B]connect(mAction, SIGNAL(triggered()), this, SLOT(fieldName));[/B]
    9. ....
    To copy to clipboard, switch view to plain text mode 
    It's successfully loaded item into my menu ,but the Slot doesnot work ! I also looked for QMETAOBJECT but i don't understand it .I'm using QT 4.3.1 .Can anyone help me to find the solution of this problem ?

    Thank for help!

    Le Son
    ------------
    Software Developer -Hanoi University of Science
    Last edited by jpn; 12th May 2008 at 13:49. Reason: missing [code] tags

Similar Threads

  1. Threads and database connection
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 7th August 2013, 08:30
  2. Docked Widget Menu
    By Chuk in forum Qt Programming
    Replies: 6
    Last Post: 3rd July 2013, 14:12
  3. Multiple database connections
    By cyberboy in forum Qt Programming
    Replies: 3
    Last Post: 30th March 2008, 16:56
  4. Database Master-Detail Entry Form
    By Phan Sin Tian in forum Newbie
    Replies: 4
    Last Post: 3rd February 2008, 14:31
  5. Program not compiling on Fresh install of Leopard
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 10:22

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.