[Qt-interest] signal / slot problem

Felipe Romero Gonzalez fjromerog at gmail.com
Tue Mar 24 17:28:36 CET 2009


If your Mainwindow is the highest  level of your application, you don't need
to make a reference to a parent. The constructor has in it's declaration a
pointer to NULL. Thats the reason why you can declare you  instance as :
VFST *vfst = new VFST;


and you will not have any problem.  Also check if this your constructor
declaration
on header:
VFST(QWidget *parent = 0);

on cpp:
VFST::VFST(QWidget *parent)
    : QMainWindow(parent
{
}

Finally  if you need a parent for your plug in you only need to do reference
to your own VFST class with the "this" pointer.

   adi *instance = new adi(this);

2009/3/24 miroslav <miroslav at keytos.no>

>  Dear friends,
> please can you help me with this?
>
> I have one QMainWindow application and one custom plugin widget that I want
> to use in my MainWindow application.
>
> The problem is that I need to send signals from MainWindows to my plugin
> application. And I am not lucky with the definition of the MainWindow
> reference - I'm getting "undefinde symbol" error after adding plugin library
> to my QtCreator folder. If I don't define the MainWindow reference
> everything works fine - so the library location, plugin definition should be
> corect.
>
> Here are the details:
>
>    QMainWindow - constructor defined as VFST(QWidget *parent = 0);
>
>
> In the cusotm widget plugin:
>
>    VFST *vfst;
>    vfst = new VFST(????);   - here I'm not sure that what should I put
> there (pointer to the parent?). I'm putting this code in the plugin
> constructor.
>
> constructor of the plugin is defined:
>    adi::adi(QWidget *parent) : QWidget(parent) { //........ }
>
> thanks,
> miro
>
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090324/c48affe8/attachment.html 


More information about the Qt-interest-old mailing list