Results 1 to 5 of 5

Thread: Processing multiple checkboxes

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Location
    Netherlands
    Posts
    13
    Thanks
    7
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Processing multiple checkboxes

    Hello!

    I'm a student and currently am working at a small company as an intern. I have to control some LEDs through usage of Qt, and made an interface to be able to do so. The interface issue concerned contains four checkboxes, and a button. It's supposed to send bytes to the MOXA board after having pressed the Send Data button.

    My function checks whether the checkbox is enabled, and if so, send the bytes. However, it only seems to work when using one checkbox at a time. I want to be able to select all of them, so all four functions are processed, and thus, all four LEDs go on (or off).

    I've done this, but this doesn't seem to work (enabling multiple checkboxes at once, that is):

    Qt Code:
    1. void ETClient::on_pushSendData_clicked()
    2. {
    3. bool dio0 = this->ui->chkDIO0->isChecked();
    4. bool dio1 = this->ui->chkDIO1->isChecked();
    5. bool dio2 = this->ui->chkDIO2->isChecked();
    6. bool dio3 = this->ui->chkDIO3->isChecked();
    7.  
    8. if(dio0 == true) this->dio0_enabled();
    9. if(dio1 == true) this->dio1_enabled();
    10. if(dio2 == true) this->dio2_enabled();
    11. if(dio3 == true) this->dio3_enabled();
    12. else ;
    13. }
    To copy to clipboard, switch view to plain text mode 

    Any help would be greatly appreciated!
    Last edited by -Kyr0s-; 14th October 2011 at 15:01.

Similar Threads

  1. Event Processing
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 10
    Last Post: 15th April 2009, 23:48
  2. Image Processing using Qt
    By danielperaza in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2008, 18:15
  3. XML processing instruction
    By mattia in forum Newbie
    Replies: 1
    Last Post: 26th February 2008, 11:37
  4. checkboxes
    By abrou in forum Newbie
    Replies: 2
    Last Post: 1st February 2008, 18:52
  5. QTreeView with checkboxes
    By shad in forum Qt Programming
    Replies: 1
    Last Post: 4th May 2006, 13:29

Tags for this Thread

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.