Results 1 to 2 of 2

Thread: Strange behaviour with QWidget

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Strange behaviour with QWidget

    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:

    Qt Code:
    1. m_panel = new PanelInfo(this);
    2. m_panel->move(400,0);
    3. m_panel->resize(100,100);
    4. m_panel->setVisible(false); // Initially I don't want show it
    To copy to clipboard, switch view to plain text mode 

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

    Qt Code:
    1. connect( m_showPanelBtn, SIGNAL( released() ), this, SLOT( onShowInfoPanel() ) );
    To copy to clipboard, switch view to plain text mode 

    and finally the code to show it:

    Qt Code:
    1. void WaveWidget::onShowInfoPanel()
    2. {
    3. if( !m_panel->isVisible() )
    4. m_panel->setVisible(true);
    5. }
    To copy to clipboard, switch view to plain text mode 

    The problem is that the panel is shown completely transparent and I see the other widget that are placed beside it ( see the image ).panelInfo.jpg
    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
    Franco Amato

  2. #2
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: Strange behaviour with QWidget

    I would try not to give a parent to the PanelInfo, or give some Qt::Tool (or Qt::Window) WindowFlag in its constructor

Similar Threads

  1. strange behaviour with Qt::key_space
    By franco.amato in forum Newbie
    Replies: 8
    Last Post: 13th April 2010, 06:39
  2. strange behaviour with Qt key_space
    By franco.amato in forum Qt Programming
    Replies: 0
    Last Post: 9th April 2010, 23:21
  3. Need help: Strange behaviour
    By navi1084 in forum Qt Programming
    Replies: 3
    Last Post: 14th November 2008, 04:03
  4. Very strange (perhaps) QHttp behaviour.
    By Kumosan in forum Qt Programming
    Replies: 5
    Last Post: 11th June 2008, 07:03
  5. very strange behaviour
    By regix in forum Qt Programming
    Replies: 23
    Last Post: 20th July 2006, 17:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.