[Qt-interest] auto-connect not working?

Constantin Makshin cmakshin at gmail.com
Thu Jan 14 14:21:48 CET 2010


Did you call QMetaObject::connectSlotsByName() function? I don't know if  
the code generated by uic calls that function, but I think nothing bad  
will happen if you try to call it explicitly. :)

On Thu, 14 Jan 2010 05:11:52 +0300, Francisco Ares <frares at gmail.com>
wrote:
> Hi guys
>
> Before I forget: I'm using v4.6.0, MinGW , Eclipse and the Eclipse
> Integration plugin, all lattest.  Great packages, really good pieces of
> work.
>
> I have a test program based on QWidget, where the main class is derived  
> from the Ui:: interface class, instead of creating an object of that
> class, something like this:
>
> Panel::Panel(QWidget *parent) :QWidget(parent) , Ui::PanelClass()
> {
>     setupUi(this);
>     ...
>
> After creating some more widgets using the "creator" embedded inside
> eclipse, I've declared, for example:
>
> private
>     slot:
>     void on_spinButtonTest_valuieChanged(int i);
>
> and implemented like this:
>
> void Panel::on_spinButtonTest_valueChanged(int i)
> {
>     mSpinButtonTestValue = i;
> }
>
> It builds even without warnings, but it doesn't execute, it spans an  
> error dialog.
>
> If I declare a diferent slot and connect it by hand, it works just as
> expected.
>
> Am I missing something?
>
> Thanks
> Francisco

-- 
Constantin Makshin



More information about the Qt-interest-old mailing list