c++ - Qt Bluetooth scanning not working -


i implementing qt bluetooth application android. requirements follows :

  1. i want turn bluetooth on

  2. i need scan device bluetooth on need check.

  3. i need show devices on in list.

currently, first requirement make code run. :)

i struggling scan devices. firstly doesn't find devices. secondly, code shows blank list. appreciate if let me know doing wrong?

here code

listview::listview(qwidget *parent):qdialog(parent) {     listmodel = new qstringlistmodel(*stringlist, null);     stringlist = new qstringlist();      bluetoothmain *btmain = bluetoothmain::getinstance();      connect(btmain,signal(discovered(qstring,qstring,bool)),this,      slot(addtolist(qstring,qstring,bool)));     btmain->startscan();      qdebug()<<"bluetooth scanning list";      // list_add->setmodel(listmodel);     // list_add->show(); }  /*  for(int i=0;i<100;i++) {   stringlist->append(qstring::number(i)+"hi everyone"); }  list_add->setmodel(listmodel); list_add->show();  */     void listview::addtolist(qstring address,qstring name,bool paired)  {     list_add->setmodel(listmodel);      stringlist->append(address);     stringlist->append(name);     stringlist->append("hi");      list_add->show();  }   listview::~listview()  {   } 

i searched related questions didn't find proper solution.

thanks in advance.

qtbluetooth works on android starting qt 5.3, if you're using qt 5.2, won't work.

also, did try compile basic qt example?

http://qt-project.org/doc/qt-5/qtbluetooth-btscanner-example.html

if works opening, compiling , deploying .pro file qtcreator, program should work too!


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -