Results 1 to 2 of 2

Thread: Not displaying transparent dialog

  1. #1
    Join Date
    Mar 2014
    Posts
    15
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Not displaying transparent dialog

    I'm using Qt widget.

    I needed a dialog that shows when I click on a button on my main window that dialog should be transparent meaning if I opened it I still can see the background like there's nothing there.

    I tried this in the constructor of my dialog:

    Qt Code:
    1. this->setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
    2. this->setAttribute(Qt::WA_TranslucentBackground,true);
    3. this->setWindowState(Qt::WindowFullScreen);
    To copy to clipboard, switch view to plain text mode 

    Note: I'm using mouse events where I can get the coordinates of the mouse and I tried it and it's working, the only thing I want now is as I said the transparent part. The program compiles just fine and the icon displays in the bar where the programs that are open are there , but I can't use the events which I can see if the I deleted the code above.
    To make it more clear here's the mouse events:

    Qt Code:
    1. void FramelessWindow::mousePressEvent(QMouseEvent *event){
    2. if(event->button()==Qt::LeftButton){
    3. origin= event->pos();
    4. rubberBand->setGeometry(QRect(origin,QSize()));
    5. rubberBand->show();
    6. }
    7. }
    8.  
    9. void FramelessWindow::mouseMoveEvent(QMouseEvent *event){
    10. rubberBand->setGeometry(QRect(origin,event->pos()).normalized());
    11. }
    12.  
    13.  
    14. void FramelessWindow::mouseReleaseEvent(QMouseEvent *event){
    15. rubberBand->hide();
    16. }
    To copy to clipboard, switch view to plain text mode 

    found this:

    http://www.qtcentre.org/threads/5336...annel-problems

    but it's no help , " same problem "

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Not displaying transparent dialog

    Please provide a minimal compilable example reproducing the problem.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Widgets not displaying on dialog box
    By te777 in forum Qt Programming
    Replies: 4
    Last Post: 2nd November 2013, 02:29
  2. Transparent dialog widget
    By girishgowda in forum Qt Programming
    Replies: 3
    Last Post: 2nd July 2010, 09:11
  3. Transparent Dialog
    By wirasto in forum Qt Programming
    Replies: 4
    Last Post: 12th November 2009, 10:21
  4. Update to 4.4.2 - Now I Have A Transparent Dialog
    By mclark in forum Qt Programming
    Replies: 10
    Last Post: 6th October 2008, 20:11
  5. Displaying external dialog
    By jlyanez in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2007, 20:04

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.