Results 1 to 2 of 2

Thread: trouble with the QSerialPortInfo::availablePorts()

  1. #1
    Join Date
    May 2010
    Location
    China
    Posts
    66
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default trouble with the QSerialPortInfo::availablePorts()

    i user the QT5.3 and visual studio 2010

    Qt Code:
    1. foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
    2. description = info.description();
    3. manufacturer = info.manufacturer();
    4. list << info.portName()
    5. << (!description.isEmpty() ? description : blankString)
    6. << (!manufacturer.isEmpty() ? manufacturer : blankString)
    7. << info.systemLocation()
    8. << (info.vendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : blankString)
    9. << (info.productIdentifier() ? QString::number(info.productIdentifier(), 16) : blankString);
    10.  
    11. ui.serialPortInfoListBox->addItem(list.first(), list);
    12. }
    To copy to clipboard, switch view to plain text mode 


    i use QSerialPortInfo::availablePorts() to read avaiablePorts of my PC,but there is always something wrong with it ,the error information is :
    Qt Code:
    1. SerialPortSettingDialog.obj : error LNK2019: æ— æ³•è§£æžçš„å¤–éƒ¨ç¬¦å· "__declspec(dllimport) public: static class QList<class QSerialPortInfo> __cdecl QSerialPortInfo::availablePorts(void)" (__imp_?availablePorts@QSerialPortInfo@@SA?AV?$QList@VQSerialPortInfo@@@@XZ),该符号在函数 "private: void __thiscall SerialPortSettingDialog::fillPortsInfo(void)" (?fillPortsInfo@SerialPortSettingDialog@@AAEXXZ) ä¸*被引用
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    May 2010
    Location
    China
    Posts
    66
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: trouble with the QSerialPortInfo::availablePorts()

    i have solved this problem , thanks

Similar Threads

  1. Having trouble getting Qt installed
    By N3wb in forum Installation and Deployment
    Replies: 3
    Last Post: 5th November 2014, 08:59
  2. Replies: 3
    Last Post: 7th October 2013, 14:58
  3. QSerialPortInfo Broken
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 21st June 2013, 15:23
  4. SQL trouble
    By xmeister in forum Newbie
    Replies: 2
    Last Post: 25th March 2009, 11:53
  5. QFtp Trouble !
    By Fastman in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 12: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.