Is it possible to connect slots of a model object to the GUI in QT4 -Designer?

Posted by Robert0 on Stack Overflow See other posts from Stack Overflow or by Robert0
Published on 2010-06-14T11:53:06Z Indexed on 2010/06/17 2:22 UTC
Read the original article Hit count: 373

Filed under:
|
|
|

So I try to build a Model-View window using QTDesigner and C++.

For that reason I created a QOBject derived class as my model. It provides slots and signals to access it like: setFileName(QString) or fileNameChanged(QString).

I got a little into using signal drag and drop in QTDesigner and found it quite VA-Smalltalk-Like nice. After a while I was wondering if I could also connect my model to this. So is it possible to somehow introduce my model object into the Window/GUI and let QTDesigner connect signals and slots from the model object to the GUI.

In essence: Write for me:

connect( model, SIGNAL(fileNameChanged(QString)), ui->labelFn, SLOT(setText(QString)))
connect( ui-textEdit2, SIGNAL(textChanged(QString)), model, SLOT(setFileName(QString)))

Thanks for explaining

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt