Results 1 to 3 of 3

Thread: Qt_database_retrieve

  1. #1
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt_database_retrieve

    hi ,
    i have created Qt c++ database ...i maintain some peoples data's...i also displayed this data to qml screen..in qml screen i have search option(textinput and button) .....whenever i click this search button with textinput name,it will retrieve and displayed how many same name persons in the table...now my questions this same name persons place i want to click and get that particular names data's ....how can i do i don't know please provide some solutions ....

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: prentice capital zimmerman

    Assuming you are using a model to hold the search result, make sure you have a role that contains the id used by the database to identify person records. then you can use that to make a lookup in the database.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2011
    Location
    coimbatore
    Posts
    80
    Thanks
    1
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt_database_retrieve

    i have created one database..i have stored peoples in table.... whenever i retrieved people names it should display in my qml through listview...suppose if there are similate name in the listview ...if i clicked first name in the listview, it should retrieve persons details in another listview...now i have listed the persons name in first listview..now my questions is in that listview, how to access each and every persons name and that accesing means(the particular clicked persons details should be displayed in second list eview) .......



    in this column[index] i have retrieved data from database ....

    below i have provided my code ..please help me

    i dont know how to change each and every item in list view as clickable(mousearea{onclicked:})


    property variant columnum:[]
    ListView{
    x:650;y:180
    spacing: 30
    width: 600;height: 500
    clip:true
    boundsBehavior:Flickable.StopAtBounds


    model:["Title","Name","Patient-ID","Age","Contact No.","Address","Gender","DOB","Reg Date","Marital Status","Primary Doctor","Refering Doctor","History","Diagnosis","Comments"]
    delegate:Row{
    spacing: 30


    RectangleFunction{

    width: 200
    color: "#00000C"
    TextNames{
    anchors.right: parent.right
    text: ""+modelData

    }
    }
    RectangleFunction{

    TextinTable{
    id:getdata123

    text:columnum[index]

    }

    }

    }
    }





    function get_data(){
    myObject.retrieve_user_data(); ---------->in this place i am retriving data from c++
    var num_user=hellobeacon.get_num_user_entries();
    console.log("**********the total Num user entry is********",num_user)
    var temp=new Array;
    var savefun=parentRt.columnum
    for (var i = 0; i < num_user; i++)
    {
    temp[i]=hellobeacon.get_curr_user_name();
    savefun[savefun.length]=temp[i];
    parentRt.columnum=savefun; ------->in this plase i am sending data to column


    hellobeacon.set_next_user_entry();


    }
    hellobeacon.clear_user_entries();

    }

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.