返回介绍

QWSServer Class

发布于 2019-10-04 15:04:14 字数 10970 浏览 958 评论 0 收藏 0

The QWSServer class provides server-specific functionality in Qt/Embedded. More...

#include <qwindowsystem_qws.h>

List of all member functions.

Public Members

  • QWSServer ( intflags = 0, QObject*parent = 0, constchar*name = 0 )
  • ~QWSServer ()
  • enum ServerFlags { DisableKeyboard = 0x01, DisableMouse = 0x02 }
  • enum GUIMode { NoGui = FALSE, NormalGUI = TRUE, Server }
  • class KeyMap { }
  • class KeyboardFilter { }
  • QWSWindow * windowAt ( constQPoint&pos )
  • const QPtrList<QWSWindow> & clientWindows ()
  • void openMouse ()
  • void closeMouse ()
  • void openKeyboard ()
  • void closeKeyboard ()
  • void refresh ()
  • void refresh ( QRegion&r )
  • void enablePainting ( boole )
  • QWSPropertyManager * manager ()
  • enum WindowEvent { Create = 0x01, Destroy = 0x02, Hide = 0x04, Show = 0x08, Raise = 0x10, Lower = 0x20, Geometry = 0x40 }

Signals

  • void windowEvent ( QWSWindow*w, QWSServer::WindowEvente )
  • void newChannel ( const QString & )

Static Public Members

  • void sendKeyEvent ( intunicode, intkeycode, intmodifiers, boolisPress, boolautoRepeat )
  • const KeyMap * keyMap ()
  • void setKeyboardFilter ( KeyboardFilter*f )
  • void setDefaultMouse ( constchar*m )
  • void setDefaultKeyboard ( constchar*k )
  • void setMaxWindowRect ( constQRect&r )
  • void setDesktopBackground ( constQImage&img )
  • void setDesktopBackground ( constQColor&c )
  • QWSMouseHandler * mouseHandler ()
  • QWSKeyboardHandler * keyboardHandler ()
  • void setKeyboardHandler ( QWSKeyboardHandler*kh )
  • void setScreenSaver ( QWSScreenSaver*ss )
  • void setScreenSaverIntervals ( int*ms )
  • void setScreenSaverInterval ( intms )
  • bool screenSaverActive ()
  • void screenSaverActivate ( boolactivate )

Detailed Description

The QWSServer class provides server-specific functionality in Qt/Embedded.

When you run a Qt/Embedded application, it either runs as a server or connects to an existing server. If it runs as a server, some additional operations are provided via the QWSServer class.

This class is instantiated by QApplication for Qt/Embedded server processes. You should never construct this class yourself.

A pointer to the QWSServer instance can be obtained via the global qwsServer variable.

The mouse and keyboard devices can be opened with openMouse() and openKeyboard(). (Close them with closeMouse() and closeKeyboard().)

The display is refreshed with refresh(), and painting can be enabled or disabled with enablePainting().

Obtain the list of client windows with clientWindows() and find out which window is at a particular point with windowAt().

Many static functions are provided, for example, setKeyboardFilter(), setKeyboardHandler(), setDefaultKeyboard() and setDefaultMouse().

The size of the window rectangle can be set with setMaxWindowRect(), and the desktop's background can be set with setDesktopBackground().

The screen saver is controlled with setScreenSaverInterval() and screenSaverActivate().

See also Qt/Embedded.


Member Type Documentation

QWSServer::GUIMode

This determines what sort of QWS server to create:
  • QWSServer::NoGui - This is used for non-graphical Qt applications.
  • QWSServer::NormalGUI - A normal Qt/Embedded application (not the server).
  • QWSServer::Server - A Qt/Embedded server (e.g. if -qws has been specified on the command line.

QWSServer::ServerFlags

This enum is used to pass various options to the window system server. Currently defined are:
  • QWSServer::DisableKeyboard - Ignore all keyboard input.
  • QWSServer::DisableMouse - Ignore all mouse input.

QWSServer::WindowEvent

This specifies what sort of event has occurred to a top level window:
  • QWSServer::Create - A new window has been created (QWidget constructor).
  • QWSServer::Destroy - The window has been closed and deleted (QWidget destructor).
  • QWSServer::Hide - The window has been hidden with QWidget::hide().
  • QWSServer::Show - The window has been shown with QWidget::show() or similar.
  • QWSServer::Raise - The window has been raised to the top of the desktop.
  • QWSServer::Lower - The window has been lowered.
  • QWSServer::Geometry - The window has changed size or position.

Member Function Documentation

QWSServer::QWSServer ( intflags = 0, QObject*parent = 0, constchar*name = 0 )

Construct a QWSServer class with parent parent, called name and flags flags.

Warning: This class is instantiated by QApplication for Qt/Embedded server processes. You should never construct this class yourself.

QWSServer::~QWSServer ()

Destruct QWSServer

constQPtrList<QWSWindow>& QWSServer::clientWindows ()

Returns the list of top-level windows. This list will change as applications add and remove wigdets so it should not be stored for future use. The windows are sorted in stacking order from top-most to bottom-most.

void QWSServer::closeKeyboard ()

Closes keyboard device(s).

void QWSServer::closeMouse ()

Closes the pointer device(s).

void QWSServer::enablePainting ( boole )

If e is TRUE, painting on the display is enabled; if e is FALSE, painting is disabled.

constKeyMap* QWSServer::keyMap () [static]

Returns the keyboard mapping table used to convert keyboard scancodes to Qt keycodes and unicode values. It's used by the keyboard driver in qkeyboard_qws.cpp.

QWSKeyboardHandler* QWSServer::keyboardHandler () [static]

Returns the primary keyboard handler.

QWSPropertyManager * QWSServer::manager ()

Returns the QWSPropertyManager, which is used for implementing X11-style window properties.

QWSMouseHandler* QWSServer::mouseHandler () [static]

Returns the primary mouse handler.

void QWSServer::openKeyboard ()

Opens the keyboard device(s).

void QWSServer::openMouse ()

Opens the mouse device(s).

void QWSServer::refresh ()

Refreshes the entire display.

void QWSServer::refresh ( QRegion&r )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Refreshes the region r.

void QWSServer::screenSaverActivate ( boolactivate ) [static]

If activate is TRUE the screensaver is activated immediately; if activate is FALSE the screensaver is deactivated.

bool QWSServer::screenSaverActive () [static]

Returns TRUE if the screensaver is active (i.e. the screen is blanked); otherwise returns FALSE.

void QWSServer::sendKeyEvent ( intunicode, intkeycode, intmodifiers, boolisPress, boolautoRepeat ) [static]

Send a key event. You can use this to send key events generated by "virtual keyboards". unicode is the unicode value of the key to send, keycode the Qt keycode (e.g. Key_Left), modifiers indicates whether, Shift/Alt/Ctrl keys are pressed, isPress is TRUE if this is a key down event and FALSE if it's a key up event, and autoRepeat is TRUE if this is an autorepeat event (i.e. the user has held the key down and this is the second or subsequent key event being sent).

void QWSServer::setDefaultKeyboard ( constchar*k ) [static]

Set the keyboard driver to k, e.g. if $QWS_KEYBOARD is not defined. The default is platform-dependant.

void QWSServer::setDefaultMouse ( constchar*m ) [static]

Set the mouse driver m to use if $QWS_MOUSE_PROTO is not defined. The default is platform-dependent.

void QWSServer::setDesktopBackground ( constQImage&img ) [static]

Sets the image img to be used as the background in the absence of obscuring windows.

void QWSServer::setDesktopBackground ( constQColor&c ) [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Sets the color c to be used as the background in the absence of obscuring windows.

void QWSServer::setKeyboardFilter ( KeyboardFilter*f ) [static]

Sets a filter f to be invoked for all key events from physical keyboard drivers (events sent via processKeyEvent()). The filter is not invoked for keys generated by virtual keyboard drivers (events sent via sendKeyEvent()).

void QWSServer::setKeyboardHandler ( QWSKeyboardHandler*kh ) [static]

Sets the primary keyboard handler to kh.

void QWSServer::setMaxWindowRect ( constQRect&r ) [static]

Sets the area of the screen which Qt/Embedded applications will consider to be the maximum area to use for windows to r.

See also QWidget::showMaximized().

void QWSServer::setScreenSaver ( QWSScreenSaver*ss ) [static]

Replaces the existing screensave with the screensaver specified in ss.

void QWSServer::setScreenSaverInterval ( intms ) [static]

Sets the timeout for the screensaver to ms milliseconds. A setting of zero turns off the screensaver.

void QWSServer::setScreenSaverIntervals ( int*ms ) [static]

Sets an array of timeouts for the screensaver to a list of ms milliseconds. A setting of zero turns off the screensaver. The array must be 0-terminated.

QWSWindow* QWSServer::windowAt ( constQPoint&pos )

Returns the window containing the point pos or 0 if there is no window under the point.

void QWSServer::windowEvent ( QWSWindow*w, QWSServer::WindowEvente ) [signal]

This signal is emitted whenever something happens to a top level window (e.g. it's created or destroyed). w is the window to which the event of type e has occurred.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文