You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Saturday, September 17th 2011, 10:25am

My own widget - how to create

Hi Everyone, I'm quite fresh here so hello:)

Is it possible to create own widget and then using it in gui designer just like others (i.e. QTableWidget, QLabel etc.)?

I wondering if that's possible.

exapmle1: I need to create app with many windows. Many of those windows has common part (simplify) grupbox with three buttons 'OK', 'EDIT', 'DELETE' . Those buttons always has same slots implemented (only args differs). So I thinking about creating this once as i.e. MyQWidget, and then just putting this on layouts by drag and drop (like other widgets in Designer mode).

example2. I need to create many QTable widgets which always has same context menu. Can I create my own class (something like MyTableWidget : public QTableWidget) which has already implemented that context menu? And than use it in GUI Designer?

My point is to do some things once (like implementing popular in my app context menu: adding icons, labels,slots to that menu etc.) .

Best regards


Saturday, September 17th 2011, 7:33pm

My programs never have bugs, they just develop random features.
C/C++ ... I don't see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste - fat_boy(code project)

Similar threads

Used tags

Qt designer, widget