Qt: Embedding Multiple Widgets in a Menu Item - 2004 style
1 min read

Qt: Embedding Multiple Widgets in a Menu Item - 2004 style

Qt: Embedding Multiple Widgets in a Menu Item - 2004 style

TL;DR: This post is about an experience I had in 2004 and it's part of my consolidating technical posts I wrote in time. It may or may not be relevant to today's technologies.

One night in October 2004 (WOW! it's almost 10 years!!) I decided that it should be possible to group a bunch of widgets (back-to-back) in a menu entry. ..Ahh, the stress :).. First, I tried "java style" (aka look on the net, maybe some other manic already did it). Either I was too tired, or it just didn't work.

So, after a while, I've decided that a progress bar is as good starting point as any. Big mistake, because the Progress landed in the menu filling up everything, and, after changing the focus in/focus out routines to change the background, observed that the BG of the inner rectangle wasn't painted using the background color (from the color group). Ouch!

But it ain't that bad, because one can embed the bar in a widget, make the parent bigger and change the parent's background on select (just it's not worth firing up the Qt Designer and making a .ui...).

Woo-hoo! The doors are open now!

Original link here