Results 1 to 14 of 14

Thread: [QtEmbedded] Translucent QGraphicsView with animated child widgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    Join Date
    Mar 2009
    Posts
    72
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    7

    Default Re: Translucent QGraphicsView with animated child widgets

    Yeah! This is the final working code (Qt 4.6):

    Qt Code:
    1. #include <QtGui/QDesktopWidget>
    2. #include <QtGui/QApplication>
    3.  
    4. MainWindow::MainWindow(QWidget* parent)
    5. : QmlView(parent) // or QGraphicsView...
    6. {
    7. this->setWindowFlags(Qt::FramelessWindowHint);
    8. this->setCacheMode(QGraphicsView::CacheBackground);
    9. }
    10.  
    11. void MainWindow::showEvent(QShowEvent* event)
    12. {
    13. WId wid = QApplication::desktop()->winId();
    14.  
    15. int x = this->x();
    16. int y = this->y();
    17. int w = this->width();
    18. int h = this->height();
    19.  
    20. this->setBackgroundBrush(QPixmap::grabWindow(wid, x, y, w, h));
    21.  
    22. QmlView::showEvent(event);
    23. }
    To copy to clipboard, switch view to plain text mode 

    No "WA_TranslucentBackground" or "autoFillBackground(false)" are needed!
    Last edited by zuck; 8th January 2010 at 12:32.

Similar Threads

  1. How to get the child widgets from a Widget?
    By prykHetQuo in forum Qt Programming
    Replies: 2
    Last Post: 29th January 2009, 13:26
  2. Child Widgets In MainWindow
    By RY in forum Newbie
    Replies: 3
    Last Post: 4th October 2008, 08:39
  3. QGraphicsView Handling Child Event
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 9th August 2007, 00:32
  4. setClipPath on child widgets.
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 27th May 2007, 19:12
  5. initialize child widgets within parent?
    By ucomesdag in forum Newbie
    Replies: 6
    Last Post: 6th June 2006, 08:11

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.