PDA

View Full Version : How to implement the scribblearea widget in my new GUI program using the QtCreator?



mag
8th April 2011, 11:11
I am trying to make a program like MS Paint, with scribble area and buttons or options to select from. I saw the scribble example and I want to use it on my application. But I dont know how to place the scribble area custom widget on my newly created ui form/window.

Does anyone have an idea on how to do this?
Thanks in advance.

mcosta
8th April 2011, 16:32
In order to use your custom widget in Designer/Creator you have to create a designer plugin.

Read here (http://doc.qt.nokia.com/4.7/designer-creating-custom-widgets.html) for more information

anoraxis
8th April 2011, 16:43
Another way could be promote the widget.

mag
11th April 2011, 04:11
Is it possible to use a container and just add the scribble area into it?

mag
11th April 2011, 09:56
In order to use your custom widget in Designer/Creator you have to create a designer plugin.

Read here (http://doc.qt.nokia.com/4.7/designer-creating-custom-widgets.html) for more information

thank you for your reply mcosta. I tried creating a custom widget and I was able to produced a .dll. It was also added to the plugins on designer,
but when I tried to run it, some errors occured.


debug\moc_scribblearea.cpp(44) : warning C4273: 'staticMetaObject' : inconsistent dll linkage
d:\project\oep\phase2\tools\qt\workspace\oep-build-desktop\debug\../../oep/scribblearea.h(53) : see previous definition of 'public: static QMetaObject const ScribbleArea::staticMetaObject'
debug\moc_scribblearea.cpp(44) : error C2491: 'ScribbleArea::staticMetaObject' : definition of dllimport static data member not allowed
debug\moc_scribblearea.cpp(54) : warning C4273: 'ScribbleArea::metaObject' : inconsistent dll linkage
d:\project\oep\phase2\tools\qt\workspace\oep-build-desktop\debug\../../oep/scribblearea.h(53) : see previous definition of 'metaObject'
debug\moc_scribblearea.cpp(59) : warning C4273: 'ScribbleArea::qt_metacast' : inconsistent dll linkage
d:\project\oep\phase2\tools\qt\workspace\oep-build-desktop\debug\../../oep/scribblearea.h(53) : see previous definition of 'qt_metacast'
debug\moc_scribblearea.cpp(67) : warning C4273: 'ScribbleArea::qt_metacall' : inconsistent dll linkage
d:\project\oep\phase2\tools\qt\workspace\oep-build-desktop\debug\../../oep/scribblearea.h(53) : see previous definition of 'qt_metacall'


How can I get rid of it?