Re: [Frogface-general] Learning QT : Got stuck.
Status: Planning
Brought to you by:
declanmcgrath
|
From: Declan M. <dec...@fr...> - 2007-05-05 12:09:15
|
Hi there Arvind,
Just wondering, could you be missing
a 'const' keyword on your method signature - SIGNAL(textChanged(const QString
&))
In other words, should your GoToCellDialogImpl.cpp be like(see the code
between the *** tags)
#include "GoToCellDialogImpl.h"
GoToCellDialogImpl::GoToCellDialogImpl(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
*** connect(ui.lineEdit, SIGNAL(textChanged(const QString &)), this,
SLOT(enableOkButton())); } ***
void GoToCellDialogImpl::enableOkButton ()
{
ui.buttonOk->setEnabled(TRUE);
}
I got the idea that this may be the problem by looking at the samples code
that comes with QT4. I'm not sure if you have this (for me, on OpenSuse 10.2,
it's under the /usr/share/doc/packages/libqt4 directory - but if you're on
Windows I'm not sure what it would be). Just in case you don't have them I'll
zip them up and send them to you directly in a separte email.
If this doesn't do the trick zip up the code and send it on to me if you
like. I'd be happy to take a look - I'm far from a QT4 guru however :-)
All the best and happy hacking,
Dec
On Thursday 03 May 2007 19:58, Arvind Purohit wrote:
> 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
-------------------------------------------------------
-------------------------------------------------------
|