LINUX.ORG.RU

История изменений

Исправление Zubok, (текущая версия) :

Disclamer: Я не спец по Qt.

Для Виндоуса использую ::FlashWindow((HWND)winId(), false);

То есть в виндах в Qt тоже подсвечивание не работает и ты лезешь в Window API (или как оно там сейчас называется?). В иксах, если делать напрямую, это делается через свойство окна WM_HINTS (см. Urgency, определено в ICCCM).

QApplication::alert(this); не помогает.

А что должно быть? Как надо? Вот описание говорит:

void QApplication::alert(QWidget *widget, int msec = 0)

Causes an alert to be shown for widget if the window is not the active window. The alert is shown for msec miliseconds. If msec is zero (the default), then the alert is shown indefinitely until the window becomes active again.

On X11, this will cause the window to be marked as «demands attention», the window must not be hidden (i.e. not have hide() called on it, but be visible in some sort of way) in order for this to work.

If msec is zero (the default), then the alert is shown indefinitely until the window becomes active again.

То есть если оно активно у тебя, то alert тут же и сбрасывается. А как тебе надо?

Исходная версия Zubok, :

Disclamer: Я не спец по Qt.

Для Виндоуса использую ::FlashWindow((HWND)winId(), false);

То есть в виндах в Qt тоже подсвечивание не работает и ты лезешь в Window API (или как оно там сейчас называется?). В иксах, если делать напрямую, это делается через свойство окна WM_HINTS (определено в ICCCM).

QApplication::alert(this); не помогает.

А что должно быть? Как надо? Вот описание говорит:

void QApplication::alert(QWidget *widget, int msec = 0)

Causes an alert to be shown for widget if the window is not the active window. The alert is shown for msec miliseconds. If msec is zero (the default), then the alert is shown indefinitely until the window becomes active again.

On X11, this will cause the window to be marked as «demands attention», the window must not be hidden (i.e. not have hide() called on it, but be visible in some sort of way) in order for this to work.

If msec is zero (the default), then the alert is shown indefinitely until the window becomes active again.

То есть если оно активно у тебя, то alert тут же и сбрасывается. А как тебе надо?