Solved Basic stuff here...
-
@Uberlinc It should be
ui->buttonBox
-
Do you mean:
#include <QtWidgets>
#include "gotocelldialog.h"
#include "ui_gotocelldialog.h"GoToCellDialog::GoToCellDialog(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
Ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);QRegExp regExp("[A-Za-z][1-9][0-9]{0,2}"); lineEdit->setValidator(new QRegExpValidator(regExp, this)); connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
void GoToCellDialog::on_lineEdit_textChanged()
{
Ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
lineEdit->hasAcceptableInput());
}This yielded "Expected Primary Expression before ->"
(as well as the original two errors.)I tried it with a Ui::buttonBox and it gave "buttonBox is not a member of Ui"
Suggestions?
Thanks.
-
Hi
i think something went wrong copying stuff around
I just download the whole zip and open that project.
and it just ran.so could u try try with clean project ?
-
-
I can find the code listings, but not the zip file.
Am I missing it here?
Can you please provide a link?Thanks.
-
-
@jsulm
It uses the old ? / other way with ui
class GoToCellDialog : public QDialog, public Ui::GoToCellDialog
:) -
Okay, yes the downloaded version works.
The only thing that I can think of is that when creating the form, I selected "Dialog" instead of "Widget."
I must have missed that the first time around.Would this have caused this problem?
Thanks.
-
@Uberlinc
well for
"buttonBox was not declared in this scope."
i would guess on something with the UI and maybe left
over files in your build folder.
Using Dialog and not widget should not have changed the name of buttons / if it was created. -
Okay.
I guess this is something that will come easier to me with more experience.
Thank you to all who assisted.I will push on!
-
@Uberlinc
well push on and it will be super :)
Sometimes one needs to clean build folder. ( as in delete all in it)