[Frogface-general] Learning QT : Got stuck.
Status: Planning
Brought to you by:
declanmcgrath
|
From: Arvind P. <pur...@ya...> - 2007-05-03 07:59:14
|
Hi All,
I am new to QT so I am learning QT by book. But I got stuck in my first QT Designer example. I made a simple form with one label, one lineedit, two command buttons ok and cancel. Initially I disabled "Ok" button and created a slot to enable it. I connected "textChanged" signal of lineedit with this slot. But it is not working. During debugging I got the warning "warning: Object::connect: No such signal QLineEdit::textChanged(QString&)" which is very strange!
Here is the code.
Any help would be highly appreciated!
Thanks,
Arvind
/*********** GoToCellDialogImpl.h *********/
#include "ui_GoToCellDialog.h"
class GoToCellDialogImpl : public QDialog
{
Q_OBJECT
public:
GoToCellDialogImpl(QWidget *parent = 0);
public slots:
void enableOkButton();
private:
Ui::GoToCellDialog ui;
};
/*********** GoToCellDialogImpl.cpp *********/
#include "GoToCellDialogImpl.h"
GoToCellDialogImpl::GoToCellDialogImpl(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
connect(ui.lineEdit, SIGNAL(textChanged(QString &)), this, SLOT(enableOkButton()));
}
void GoToCellDialogImpl::enableOkButton ()
{
ui.buttonOk->setEnabled(TRUE);
}
/*********** GoToCellDialogImpl.cpp *********/
#include <QApplication>
#include "GoToCellDialogImpl.h"
int main(int argc, char **argv)
{
QApplication app(argc, argv);
GoToCellDialogImpl dialog;
dialog.show();
return app.exec();
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com |