Show window in Qt without stealing focus

Show window in Qt without stealing focus

Asked on December 27, 2018 in Qt.
Add Comment


  • 2 Answer(s)

    Window in Qt without stealing focus:

    setAttribute(Qt::WA_ShowWithoutActivating);
    

    They activate the force window with the Qt::WindowStaysOnTopHint flag.

    Answered on December 27, 2018.
    Add Comment

    The initialize code is:

    thumbnail = new QLabel;
    thumbnail->setAttribute(Qt::WA_ShowWithoutActivating);
    thumbnail->setParent(0);
    thumbnail->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    

    Qt::Tool is used to work.

    Answered on December 27, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.