Qt3 - Multiple transparent widgets
In Qt3, I guess the only way to create transparent widgets is to perform masking on the widget itself. However what is the best way to handle in the following scenario?
Take for a example that I have a map as my parent widget.
I would like to display text or small pixmap as widgets on top of the map. These widgets must be transparent(ie. I must still be able to see parts of the map beneath the widgets) and these widgets may be created or destroyed at random. The quantity of these widgets is also not known beforehand.
What is the best approach to handle the above scenario? Is masking still the way to go, esp when the small of these widgets are not known?
Re: Qt3 - Multiple transparent widgets
you can use QLineEdit for display text with transparent background.
Re: Qt3 - Multiple transparent widgets
Quote:
Originally Posted by
rajesh
you can use QLineEdit for display text with transparent background.
thanks for the reply
which member functions of QLineEdit can be used to change into a transparent background?
as far as i know, it is not really possible to have transparent widgets in qt3
Re: Qt3 - Multiple transparent widgets
the following code is working for me in Qt4. if it doesn't work in Qt3 then look for QPalette or backgroundRole in Qt3 assistant.
[html]
m_timeLabel1 = new QLineEdit;
QPalette palette;
palette.setColor(m_timeLabel1->backgroundRole(), Qt::transparent);
m_timeLabel1->setPalette(palette);
[/html]
Re: Qt3 - Multiple transparent widgets
Quote:
Originally Posted by
rajesh
the following code is working for me in Qt4. if it doesn't work in Qt3 then look for QPalette or backgroundRole in Qt3 assistant.
[html]
m_timeLabel1 = new QLineEdit;
QPalette palette;
palette.setColor(m_timeLabel1->backgroundRole(), Qt::transparent);
m_timeLabel1->setPalette(palette);
[/html]
10x alot!!:D