Results 1 to 3 of 3

Thread: Qserial Port for windows

  1. #1

    Smile Qserial Port for windows

    hiii,

    I am Developing win32 serial port in QT5.0.2 for my hardware.
    for this i manually write the openport, closeport, read, write function
    but confusing about "CreateFile" fuction.
    how to use the first Parameter which is port number.

    // open selected device
    hSerial = CreateFile( (WCHAR *) deviceName->constData() , GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);


    more info. is:
    QString *deviceName;
    deviceName = new QString(device_Name->toLatin1());

    how to use deviceName so that i get selected port name .

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Qserial Port for windows

    Thread title is missleading

    Qt Code:
    1. WCHAR WideChar[256];
    2. deviceName->toWCharArray(WideChar);
    To copy to clipboard, switch view to plain text mode 
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qserial Port for windows

    vishme7,

    Please use http://qt-project.org/wiki/QtSerialPort

    Also you can update your Qt to v5.1.1 where QtSerialPort is present by default, then you not need to build it manually as for Qt 5.0.x and Qt 4.8.x.
    Last edited by kuzulis; 29th August 2013 at 13:05.

Similar Threads

  1. QSerial problem:receives random data
    By omegaKnot in forum Qt Programming
    Replies: 5
    Last Post: 27th May 2011, 09:32
  2. How to port windows app to linux
    By sudheer168 in forum Qt Programming
    Replies: 4
    Last Post: 15th October 2009, 08:39
  3. QT Webkit port for Windows CE
    By darryncampbell in forum Qt Programming
    Replies: 1
    Last Post: 25th February 2009, 13:10
  4. how to port Qt windows application to mobile
    By pallavi Boyapat in forum Qt Programming
    Replies: 8
    Last Post: 26th January 2009, 13:57
  5. Mac Port of Windows code
    By Nemo in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2006, 07:37

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
  •  
Qt is a trademark of The Qt Company.