PDA

View Full Version : Strange behaviour with QWidget



franco.amato
12th October 2010, 23:39
Hi to all,
I trying to write my PanelInfo inherited from QWidget on top of my WaveWidget.
Basically I show it only when needed ( pressing a button ).
The strange thing is that when set as visible it's shown as transparent instead of opaque.
Here I write some code. In the WaveWidget ctor I create it and I place where I want:


m_panel = new PanelInfo(this);
m_panel->move(400,0);
m_panel->resize(100,100);
m_panel->setVisible(false); // Initially I don't want show it

than I have a button that should show the little panelinfo in the released signal:


connect( m_showPanelBtn, SIGNAL( released() ), this, SLOT( onShowInfoPanel() ) );

and finally the code to show it:


void WaveWidget::onShowInfoPanel()
{
if( !m_panel->isVisible() )
m_panel->setVisible(true);
}

The problem is that the panel is shown completely transparent and I see the other widget that are placed beside it ( see the image ).5321
I also tried to set the opacity to 1.0 but nothing change. How can I do to show it opaque and not transparent?

Best Regards

totem
13th October 2010, 09:32
I would try not to give a parent to the PanelInfo, or give some Qt::Tool (or Qt::Window) WindowFlag in its constructor