Results 1 to 2 of 2

Thread: checkbox

  1. #1
    Join Date
    Jul 2006
    Posts
    8
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default checkbox

    Hi all,
    i have some difficulties with checkbox in my module. My problem is getting the value when the user checks the box. Using designer, i created my checkbox. Then connected them to a slot using a clicked signal in my .cpp file. My problem is in the function call that should test if the user checked the checkbox and if so it should do something.
    ie


    .cpp file

    bool stuff:peratingM(int action)
    {
    mMaterial->subDj(output);
    .
    .
    .
    if(isCheckbox)
    display->draw(outputGrap)
    .
    .
    .
    }
    void stuff::isCheckbox(bool)
    {
    return true; // this is what i did but its wrong eventhough i set
    checkbox on designer as false

    }
    //enables connections necessary
    void stuff::enableQtConnections()
    {
    connect(checkBox, SIGNAL(clicked()), this, SLOT(isChecked(bool)));
    :
    :
    }

    void stuff::disableQtConnections()
    {
    disconnect(checkBox, SIGNAL(clicked()), this, SLOT(isChecked(bool)));
    :
    :
    }

    any help? thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: checkbox

    Use toggled(bool) or stateChanged(int) instead of clicked().

Similar Threads

  1. Replies: 3
    Last Post: 1st April 2011, 04:58
  2. exclusive checkBox
    By mickey in forum Qt Programming
    Replies: 6
    Last Post: 4th October 2007, 18:26
  3. CheckBox and selection in QTableView
    By Mike Krus in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2006, 20:31
  4. Change Font Color of Label and CheckBox
    By mahe2310 in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 15th June 2006, 10:24
  5. checkBox
    By mickey in forum Qt Programming
    Replies: 8
    Last Post: 1st April 2006, 23:05

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.