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. Notification Widget best practice
Forum Updated to NodeBB v4.3 + New Features

Notification Widget best practice

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.0k 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.
  • S Offline
    S Offline
    sw0ce
    wrote on last edited by
    #1

    Hello community,

    I´m trying to implement a notification widget that shows some system information to the user. The notification is shown as a simple line at the top of the application (app is fullscreen and allwaysOnTop). After 10 seconds the notification line will by hidden.

    My problem is that notification line is activated when it´s shown. The focus of my actual item (most times a QLineEdit) is lost. After the notification is hidden the focus is set back to this item.

    I tried to set the FocusPolicy of my notification widget and all it´s children to Qt::NoFocus and set the WindowFlags Qt::X11BypassWindowManagerHint with no effect. Also I set the attribute Qt::WA_X11DoNotAcceptFocus

    Operating system is Windows 7
    Could someone give me a hint how to realize such a task the right way?

    Thanks and regards.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sw0ce
      wrote on last edited by
      #2

      Found a way to do what I described:

      setAttribute(Qt::WA_ShowWithoutActivating);
      setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::WindowSystemMenuHint);

      These two did the job.

      Thanks

      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