Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. (UPDATED) A problem with using WA_Translucent background and QSizeGrip
Qt 6.11 is out! See what's new in the release blog

(UPDATED) A problem with using WA_Translucent background and QSizeGrip

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 714 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dzz007
    wrote on last edited by dzz007
    #1
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        MainWindow mw;
    
        mw.centralWidget()->setWindowFlags(Qt::SubWindow);
    
        QSizeGrip * sizeGrip = new QSizeGrip(mw.centralWidget());
    
        QGridLayout * layout = new QGridLayout(mw.centralWidget());
    
    
        mw.setWindowFlags(mw.windowFlags() | Qt::FramelessWindowHint);
        mw.setAttribute(Qt::WA_TranslucentBackground);
    
        qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground);
        sizeGrip->setAttribute(Qt::WA_TranslucentBackground, false);
        qDebug() << sizeGrip->testAttribute(Qt::WA_TranslucentBackground);
        sizeGrip->setWindowFlags(sizeGrip->windowFlags() & ~Qt::FramelessWindowHint);
    
        sizeGrip->setWindowOpacity(1.0);
        mw.setWindowOpacity(1.0);
    
        layout->addWidget(sizeGrip, 0,0,1,1,Qt::AlignBottom | Qt::AlignRight);
        mw.centralWidget()->setStyleSheet("QWidget#a{border-image: url(:/f)}");
        mw.show();
    
        return a.exec();
    }
    

    Hello guys above is my code and the form it created is like this:
    alt text

    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]
    alt text

    [Pointer]
    alt text

    Could you help me please I would really appreciate that.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved