tags:

views:

46

answers:

1

I have MyCustomWidget in a namespace MyNameSpace

namespace MyNameSpace{
    class MyCustomWidget : public QWidget{
    };
}

How do I promote a QWidget to MyCustomWidget in my UI form? It doesn't seem to accept a custom namespace.

+1  A: 

Type the name of the class with the namespace included: My::PushButton. It works. Note that:

  • Qt Designer will try and guess the header name: my_pushbutton.h. Change it if it is wrong.
  • You should check the include paths in your project to determine if a global include for the promoted widget will work
andref
Which version of Qt are you using? I think I must be using an old version since doing what you said doesn't work.
Dat Chu
Right now, Qt 4.6 and Qt Creator 2.0, but I remember this working with older versions too.
andref