[SOLVED] QDockWidget missing title text
I've been stuck for a while with a problem which doesn't make sense (at least to me)
I tried extending QDockWidget class, to add extra functionality, and promote it in the QDesigner, my extra functions work perfectly, but when the dock widget is docked, it is missing a title, if it's floating everything appears to be fine.
Here is have it looks with my extended class:
And here have it should look, and it does if I don't extend it:
My header file:
class XToolWidget : public QDockWidget
explicit XToolWidget ( QWidget * parent = 0, Qt::WindowFlags flags = 0 );
void changeEvent(QEvent *event);
#endif // XTOOLWIDGET_H@
and the source file:
XToolWidget::XToolWidget(QWidget *parent, Qt::WindowFlags flags)
: QDockWidget(parent, flags)
void XToolWidget::changeEvent(QEvent *event)
qDebug() << "Something happened to the ToolWidget";
It should have been such a simple thing to do, but I wasn't able to find why the title text is missing.
tobias.hunger last edited by
You consume all events before they ever reach your base class. So it will never get a paint event!
Pass events on to QDockWidget and this should work.
Funny, this is second time I made this mistake, I had the same problem with graphics scene.
Hopefully, this is the last time I make this mistake.