Results 1 to 11 of 11

Thread: QCheckBox::isChecked() property is not working...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Location
    Bangalore, India
    Posts
    38
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: QCheckBox::isChecked() property is not working...

    My dear,

    Please download the file and look into the files. There you could find all necessary files.
    I did not attach as a separate files because forum supports only 5 files max to attach.
    WINNERS DON`T D DIFFERENT THINGS THEY D THINGS differently.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: QCheckBox::isChecked() property is not working...

    look at code and find the bug
    Qt Code:
    1. OptionDlg::OptionDlg(QWidget *parent, Qt::WFlags flags) : QDialog(parent, flags)
    2. {
    3. QVBoxLayout *mainLayout = new QVBoxLayout;
    4. QHBoxLayout *hBtLayout = new QHBoxLayout;
    5. QHBoxLayout *layout = new QHBoxLayout;
    6.  
    7. frmScroll = new FrameScroll(this);
    8. frmScroll->setFrameStyle( QFrame::Box | QFrame::Raised );
    9. frmScroll->setMinimumSize( 20, 20 );
    10. layout->addWidget(frmScroll);
    11.  
    12. mainLayout->addLayout(layout);
    13.  
    14. submitBt = new QPushButton(tr("&Ok"));
    15. cancelBt = new QPushButton(tr("&Cancel"));
    16.  
    17. connect(submitBt, SIGNAL(clicked()), this, SLOT(processUserInput()));
    18. connect(cancelBt, SIGNAL(clicked()), this, SLOT(close()));
    19. hBtLayout->addSpacing(200);
    20. hBtLayout->addWidget(submitBt);
    21. hBtLayout->addWidget(cancelBt);
    22. mainLayout->addLayout(hBtLayout);
    23. setLayout(mainLayout);
    24. setWindowTitle(tr("Basic Layouts"));
    25. };
    26.  
    27. OptionDlg::~OptionDlg()
    28. { };
    29.  
    30. void OptionDlg::processUserInput() {
    31. //FrameScroll *frmScroll = new FrameScroll(this);//<---- you create a new widget and get data from it
    32. //QString sr = frmScroll->cbx->text();
    33. //bool cbool = true;
    34. qDebug() << (frmScroll->cbx->isChecked());
    35. //this->close();
    36. }
    To copy to clipboard, switch view to plain text mode 
    PS. for feature,please post code in archive.

  3. The following user says thank you to spirit for this useful post:

    Cutey (18th August 2008)

  4. #3
    Join Date
    Dec 2006
    Location
    Bangalore, India
    Posts
    38
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: QCheckBox::isChecked() property is not working...

    Thanks for your timely help buddy and Thanks for pointing out my blunder..
    WINNERS DON`T D DIFFERENT THINGS THEY D THINGS differently.

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.