Unsolved Connect a checkbox widget to a line edit to appear when toggled box
-
Using QT Creator
I created a checkBox named advSearch and when it is toggled, I want a lineEdit box named rmaEdit to appear.
However, when I try to do ui-> advSearch, it says that
error: no member named 'advSearch' in 'Ui::MainWindow'
However, the rmaEdit appears.
-
Can you clean and rebuild solution ?
When you type ui-> does be any suggestion for advsearch Checkbox?
can you check if advsearch is missspelled?
also can you show contents of mainwindow.ui? -
@AXNT and when you're back from solving "error: no member named ..." you may want to take a look at your method on_advSearch_toggled()
- ui->advSearch->setCheckable(true) for sure had happened before (hopefully in the auto-generated UI code because you checked "checkable" property for the QCheckBox widget when you placed it in the UI. No need to do that there.
- No need to connect(...) any signal from QCheckBox object to QLineEdit object.
Just do (pseudo-code):
ui->rmaEdit->setVisible(checked);
this way when the on_advSearch_toggled() method is called because the user checked or unchecked the box, the QLineEdit widget will be visible (checked is true) or not visible (checked is false)
PS: next time, please don't paste an image of your code, just surround it with the code tag (icon </>) to get something like this, that you'll fill out with your code snippet...
``` //your code here ```