Results 1 to 6 of 6

Thread: Dynamically creating buttons from Xml file

  1. #1
    Join Date
    Nov 2010
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Dynamically creating buttons from Xml file

    Hello,

    I want some leads to create an application, I want to dynamically create buttons from xml files

    it will be great if somebody could help me on this.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Dynamically creating buttons from Xml file

    What have you tried so far? What problems do you exactly face? And do you really think this question belongs to the Qt Programming forum? (-> Moved to newbie)

  3. #3
    Join Date
    Nov 2010
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dynamically creating buttons from Xml file

    i am just a new person in QT. so dont have much of info on this.. just learning QT basics,.

    I really dint know that this query has to be put in the newbie forum. I havent done much right now. i created some application which creates buttons dynamically but not from files.. so just wanted to know how it can be done.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Dynamically creating buttons from Xml file

    So what informations do you have in those files? And if you are able to create buttons dynamically then have a look at QFile on how to read a file or if it is XML see QDomDocument. Then loop over the lines/tags and create the buttons.

  5. #5
    Join Date
    Nov 2010
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dynamically creating buttons from Xml file

    Ya i tried creating buttons through files and dint have any problem. i wanted to know which class to use to call xml files to create controls dynamically. thanks for giving me some leads. i will have a look at the class and do some research.

  6. #6
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Dynamically creating buttons from Xml file

    there is no class which does "read an xml file and create buttons". you have to code that by yourself - nobody knows the structure of your xml file! So, you have to parse the file using suggested QDomDocument. Then, create a button if you reached a button description in the file.

Similar Threads

  1. problem about load resource file dynamically
    By Raul in forum Qt Programming
    Replies: 1
    Last Post: 27th August 2010, 05:56
  2. creating Xml file using QT
    By rk0747 in forum Qt Programming
    Replies: 3
    Last Post: 30th January 2010, 11:16
  3. Creating dock widget as tab dynamically
    By vidyadhar in forum Qt Programming
    Replies: 1
    Last Post: 18th July 2009, 12:03
  4. QWizard creating objects dynamically
    By afflictedd2 in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2009, 15:43
  5. Replies: 1
    Last Post: 18th March 2006, 10:11

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.