我有一個問題,當我試圖讓下面的簡單連接爲什麼append Slot不起作用?
QSpinBox *spinBox = new QSpinBox;
QSlider *slider = new QSlider(Qt::Horizontal);
QTextEdit *text = new QTextEdit("Hello QT!");
QObject::connect(spinBox, SIGNAL(valueChanged(int)),slider, SLOT(setValue(int)));
QObject::connect(slider, SIGNAL(valueChanged(int)),spinBox, SLOT(setValue(int)));
QObject::connect(slider,SIGNAL(valueChanged(int)),text, SLOT(append("slider changed!")));
QObject::connect(spinBox,SIGNAL(valueChanged(int)),text, SLOT(append("spinbox changed!")));
QObject::connect(text,SIGNAL(textChanged()),spinBox,SLOT(clear()));
可以成功編譯並excuted.But兩個append
插槽似乎並不work.I've檢查幫助手冊約QTextEdit
和有一個公共插槽append
there.have我錯過了什麼?幫助將不勝感激!
感謝您的信息。 – Young 2010-07-05 08:20:57