Results 1 to 2 of 2

Thread: A problem with using WA_Translucent background and QSizeGrip

  1. #1
    Join Date
    May 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Smile A problem with using WA_Translucent background and QSizeGrip

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication a(argc, argv);
    4. MainWindow mw;
    5.  
    6. mw.centralWidget()->setWindowFlags(Qt::SubWindow);
    7.  
    8. QSizeGrip * sizeGrip = new QSizeGrip(mw.centralWidget());
    9.  
    10. QGridLayout * layout = new QGridLayout(mw.centralWidget());
    11.  
    12.  
    13. mw.setWindowFlags(mw.windowFlags() | Qt::FramelessWindowHint);
    14. mw.setAttribute(Qt::WA_TranslucentBackground);
    15.  
    16. qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground);
    17. sizeGrip->setAttribute(Qt::WA_TranslucentBackground, false);
    18. qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground);
    19. sizeGrip->setWindowFlags(sizeGrip->windowFlags() & ~Qt::FramelessWindowHint);
    20.  
    21. sizeGrip->setWindowOpacity(1.0);
    22. mw.setWindowOpacity(1.0);
    23.  
    24. layout->addWidget(sizeGrip, 0,0,1,1,Qt::AlignBottom | Qt::AlignRight);
    25. mw.centralWidget()->setStyleSheet("QWidget#a{border-image: url(:/f)}");
    26. mw.show();
    27.  
    28. return a.exec();
    29. }
    To copy to clipboard, switch view to plain text mode 

    Hello guys above is my code and the form it created is like this:
    Capture.jpg

    the problem is the size griper is composed by 9 little dot with a lot of hole in it and when my mouse hovered around on the griper it is like flashing between the <double arrow state> and <pointer state> (i guess it is caused by the TranslucentBackground attribute and those <translucent> dots in the gripper.

    [Double-arrow]
    Capture1.JPG

    [Pointer]
    Capture2.JPG

    Could you help me please I would really appreciate that.

  2. #2
    Join Date
    May 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Smile Re: A problem with using WA_Translucent background and QSizeGrip

    New to this forum, so please feel free to tell me if i am posting in a wrong section

Similar Threads

  1. Resize with QSizeGrip
    By mhoover in forum Qt Programming
    Replies: 1
    Last Post: 30th November 2009, 20:41
  2. QGraphicsItem with QSizeGrip
    By elsheikhmh in forum Newbie
    Replies: 7
    Last Post: 19th November 2009, 18:53
  3. Replies: 7
    Last Post: 24th May 2009, 13:58
  4. Remove QSizeGrip/Size Grip from a QWidget or QDialog?
    By Cheetah in forum Qt Programming
    Replies: 1
    Last Post: 5th November 2007, 16:35
  5. Adding a QSizeGrip to a QMainWindow
    By forrestfsu in forum Qt Programming
    Replies: 6
    Last Post: 9th April 2007, 15:45

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.