[prev in list] [next in list] [prev in thread] [next in thread]
List: ruby-talk
Subject: Re: QLineEdit
From: Manfred Hansen <manfred () toppoint ! de>
Date: 2002-02-24 12:42:26
[Download RAW message or body]
Hello,
the connect is wrong, here is the right one.
QRObject::connect_rslot(@textIn,QSIGNAL("textChanged(const QString
&)"),@verarbeiter,'neuerTextSlot(const QString &)')
another little mistake is def neuerTextSlot()
the correct one is ef neuerTextSlot(ps)
Manfred
Manfred Hansen wrote:
> Hi,
>
> i try to print out the text from QLineEdit
>
> #!/usr/local/bin/ruby
>
> require "qt2"
> include Qt2
>
> class Fenster < QVBox
>
> def initialize
> @verarbeiter = Verarbeiter.new(self,"SLOT")
> @textIn = QLineEdit.new(self,"TextIn","SIGNAL")
> quit = QPushButton.new("Quit",self,"quit")
>
connect(quit,QSIGNAL("clicked()"),QApplication::qApp,QSLOT("quit()"))
> connect (@textIn,QSIGNAL("textChanged(const QString
> &)"),@verarbeiter,QSLOT("@neuerTextSlot(const QString&)"))
> end
>
> end
>
> class Verarbeiter < QWidget
>
> def neuerTextSlot()
> #def neuerTextSlot(const QString ps)
> print ps
> end
> end
>
>
> a = QApplication.new( [$0]+ARGV)
> b = Fenster.new # Das Objekt der Klasse QWidget wird
> erzeugt a.setMainWidget( b )
> b.show()
> a.exec()
>
>
>
> Here is my error message
>
> hansen@hansen-lx:~/ruby$ ./qlineedit1.rb
> QObject::connect: No such slot QWidget::@neuerTextSlot(const QString&)
> QObject::connect: (sender name: 'SIGNAL')
> QObject::connect: (receiver name: 'SLOT')
>
>
> I belive i must define a slot in the class Verarbeiter, but i have no
> idea how to do this.
>
> The following example have i tried to translate from c++ to ruby
>
http://velociraptor.mni.fh-giessen.de/Programmierung/progII-html-dir/node10.html#SECTION000103600000000000000
>
>
> Manfred
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic