Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Qt: signals of DateTimeEdit?

Reply
Thread Tools

Qt: signals of DateTimeEdit?

 
 
Hadmut Danisch
Guest
Posts: n/a
 
      08-16-2005
Hi,

I'm just writing an application with ruby Qt and tried to connect a
signal from a DateTimeEdit widget.

The Qt doc says it has a signal

void QDateTimeEdit::valueChanged ( const QDateTime & datetime ) [signal]


Unfortunately, ruby Qt just comes with some examples, no Docs.

How would that signal be named? Whatever I tried so far, I always get
the error message

QObject::connect: No such signal Qt:ateTimeEdit::valueChanged()


How would I list the available slots and signals?


Hadmut
 
Reply With Quote
 
 
 
 
Richard Dale
Guest
Posts: n/a
 
      08-17-2005
Hadmut Danisch wrote:

> Hi,
>
> I'm just writing an application with ruby Qt and tried to connect a
> signal from a DateTimeEdit widget.
>
> The Qt doc says it has a signal
>
> void QDateTimeEdit::valueChanged ( const QDateTime & datetime ) [signal]
>
>
> Unfortunately, ruby Qt just comes with some examples, no Docs.
>
> How would that signal be named? Whatever I tried so far, I always get
> the error message
>
> QObject::connect: No such signal Qt:ateTimeEdit::valueChanged()

You need a type signature of 'const QDateTime&' in the string passed to
SIGNAL() like this:

require 'Qt'

class DateShow < Qt::Object
slots 'dateChanged(const QDateTime&)'

def dateChanged(date)
puts "date: %s" % date.toString
end
end

app = Qt::Application.new(ARGV)
date_edit = Qt:ateTimeEdit.new()
show_date = DateShow.new
Qt::Object.connect( date_edit,
SIGNAL('valueChanged(const QDateTime&)'),
show_date,
SLOT('dateChanged(const QDateTime&)') )
app.setMainWidget(date_edit)
date_edit.show
app.exec

>
> How would I list the available slots and signals?

Use Qt::MetaObject.slotNames() and signalNames() methods:

irb(main):002:0> d = Qt:ateTimeEdit.new
=> #<Qt:ateTimeEdit:0x3044a9a0 name="unnamed", x=256, y=230, width=512,
height=307>
irb(main):003:0> d.metaObject.signalNames(true)
=> ["destroyed()", "destroyed(QObject*)", "valueChanged(const QDateTime&)"]
irb(main):004:0> d.metaObject.slotNames(true)
=> ["deleteLater()", "cleanupEventFilter(QObject*)", "setEnabled(bool)",
"setDisabled(bool)", "setCaption(const QString&)", "setIcon(const
QPixmap&)", "setIconText(const QString&)", "setMouseTracking(bool)",
"setFocus()", "clearFocus()", "setUpdatesEnabled(bool)", "update()",
"update(int,int,int,int)", "update(const QRect&)", "repaint()",
"repaint(bool)", "repaint(int,int,int,int)",
"repaint(int,int,int,int,bool)", "repaint(const QRect&)", "repaint(const
QRect&,bool)", "repaint(const QRegion&)", "repaint(const QRegion&,bool)",
"show()", "hide()", "setShown(bool)", "setHidden(bool)", "iconify()",
"showMinimized()", "showMaximized()", "showFullScreen()", "showNormal()",
"polish()", "constPolish()", "close()", "raise()", "lower()",
"stackUnder(QWidget*)", "move(int,int)", "move(const QPoint&)",
"resize(int,int)", "resize(const QSize&)", "setGeometry(int,int,int,int)",
"setGeometry(const QRect&)", "adjustSize()", "focusProxyDestroyed()",
"setDateTime(const QDateTime&)", "newValue(const QDate&)", "newValue(const
QTime&)"]

-- Richard

 
Reply With Quote
 
 
 
 
Hadmut Danisch
Guest
Posts: n/a
 
      08-17-2005
Richard Dale wrote:
> ...



Works. Thanks.

Hadmut
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dumping real signals in VCD Sajan VHDL 8 07-21-2007 07:39 AM
Are all the signals read in the process should appear in the sensitivity list of the process? walala VHDL 3 09-09-2003 07:47 AM
generate testbench for array signals Simone Winkler VHDL 1 09-02-2003 04:00 PM
Delay of control signals Ingmar Seifert VHDL 0 08-18-2003 03:21 PM
unused bits in signals Thomas VHDL 2 07-06-2003 10:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57