Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: QLibrary: how to download and check?

  1. #21
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QLibrary: how to download and check?

    You do not think I'm not complaining about the application, but only a share.
    I understand. Remember, I cannot test the code, because I do not have an Atmel board. So maybe there are a few things that do not work correctly; if the DYNCALL(closeDevice)() call causes a segfault, then it should be removed or moved to a different place. I am not sure why the segfault occurs - possibly the library is already destroyed before this call takes place.

    You could try to call mpController->shutdown() from inside CUSBHidDlg. Add a new method, a protected slot:

    Qt Code:
    1. // CUSBHidDlg.h
    2.  
    3. protected slots: // This section already exists, just add a new method declaration
    4. void accept();
    5.  
    6. // CUSBHidDlg.cpp:
    7.  
    8. void CUSBHidDlg::accept()
    9. {
    10. mpController->shutdown();
    11. CDialog::accept();
    12. }
    To copy to clipboard, switch view to plain text mode 

    Tell me, please, and whether such a program to move to the Tablet PC on the android with slight modifications?
    No, I do not think you can use this program on the Tablet PC, because the DLL is for Windows only and I do not think it can work on the Android OS. If Atmel has a similar library for Android, then maybe it can be modified to work there. Otherwise, you will have to find some code that talks to USB HID devices on Android OS and try to use that.
    Last edited by d_stranz; 14th April 2012 at 18:24.

  2. #22
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QLibrary: how to download and check?

    Tell me, please. Such a question. Is it possible to add a button that will ignite at the same time, all four LEDs?

  3. #23
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QLibrary: how to download and check?

    Quote Originally Posted by lucky_sever View Post
    Tell me, please. Such a question. Is it possible to add a button that will ignite at the same time, all four LEDs?
    Yes, of course. Open the ui file in Qt Designer, add the new button, then add the slot in the .h file, implement the code for the slot in the .cpp file. In the slot, write the commands to turn on all of the LEDs. You should be able understand enough of the code that I wrote to be able to do this without help.

  4. #24
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QLibrary: how to download and check?

    Thank you! I almost figured out the code. Now modify the program. I am interested in this question
    Qt Code:
    1. int result = DYNCALL (hidRegisterDeviceNotification) (winId ());
    To copy to clipboard, switch view to plain text mode 
    hidRegisterDeviceNotification where you use the program? I did not find anywhere else.


    Added after 52 minutes:


    Qt Code:
    1. bool CUSBHidController::shutdown()
    2. {
    3. if ( isConnected() )
    4. disconnectDevice();
    5.  
    6. DYNCALL(hidUnregisterDeviceNotification( winId() ));
    7.  
    8. if ( mUSBHidLib.isLoaded() )
    9. mUSBHidLib.unload();
    To copy to clipboard, switch view to plain text mode 

    When you close the program in debug mode - a segfault on the call DYNCALL (hidUnregisterDeviceNotification (winId ()));. It turns out that DYNCALL (hidRegisterDeviceNotification) (winId ()) not yet due, but just checking!
    Last edited by lucky_sever; 17th April 2012 at 10:44.

  5. #25
    Join Date
    Apr 2012
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QLibrary: how to download and check?

    That's it! The question is exhausted! I fully understand the code. Thank you very much! That's only one did not understand where it is used "result?
    Qt Code:
    1. int result = DYNCALL (hidRegisterDeviceNotification) (winId ());
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to check the file to download from ftp site exists ?
    By nikhilqt in forum Qt Programming
    Replies: 29
    Last Post: 8th November 2014, 09:47
  2. QLibrary
    By Amita in forum Qt Programming
    Replies: 10
    Last Post: 27th July 2011, 15:35
  3. How to use QLibrary?
    By digog in forum Newbie
    Replies: 22
    Last Post: 5th November 2010, 18:01
  4. The problem with QLibrary, help me!
    By dungsivn in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2008, 14:03
  5. Qlibrary
    By rianquinn in forum Qt Programming
    Replies: 5
    Last Post: 4th February 2006, 12:23

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.