Qt:Документация 4.3.2/qscreencursor
Материал из Wiki.crossplatform.ru
Внимание: Актуальная версия перевода документации находится здесь |
__NOTOC__
Главная · Все классы · Основные классы · Классы по группам · Модули · Функции |
[править] QScreenCursor Class Reference
[модуль QtGui ]
The QScreenCursor class is a base class for screen cursors in Qtopia Core. Далее...
#include <QScreenCursor>
[править] Открытые функции
- QScreenCursor ()
- virtual ~QScreenCursor ()
- QRect boundingRect () const
- virtual void hide ()
- QImage image () const
- bool isAccelerated () const
- bool isVisible () const
- virtual void move ( int x, int y )
- virtual void set ( const QImage & image, int hotx, int hoty )
- virtual void show ()
[править] Статические открытые члены
- void initSoftwareCursor ()
- QScreenCursor * instance ()
[править] Подробное описание
The QScreenCursor class is a base class for screen cursors in Qtopia Core.
Note that this class is non-portable, and that it is only available in Qtopia Core.
QScreenCursor implements a software cursor, but can be subclassed to support hardware cursors as well. When deriving from the QScreenCursor class it is important to maintain the cursor's image, position, hot spot (the point within the cursor's image that will be the position of the associated mouse events) and visibility as well as informing whether it is hardware accelerated or not.
Note that there may only be one screen cursor at a time. Use the static instance() function to retrieve a pointer to the current screen cursor. Typically, the cursor is constructed by the QScreen class or one of its descendants when it is initializing the device; the QScreenCursor class should never be instantiated explicitly.
Use the move() function to change the position of the cursor, and the set() function to alter its image or its hot spot. In addition, you can find out whether the cursor is accelerated or not, using the isAccelerated() function, and the boundingRect() function returns the cursor's bounding rectangle.
The cursor's appearance can be controlled using the isVisible(), hide() and show() functions; alternatively the QWSServer class provides some means of controlling the cursor's appearance using the QWSServer::isCursorVisible() and QWSServer::setCursorVisible() functions.
See also QScreen and QWSServer.
[править] Описание функций-членов
[править] QScreenCursor::QScreenCursor ()
Constructs a screen cursor
[править] QScreenCursor::~QScreenCursor () [virtual]
Destroys the screen cursor.
[править] QRect QScreenCursor::boundingRect () const
Returns the cursor's bounding rectangle.
[править] void QScreenCursor::hide () [virtual]
Hides the cursor from the screen.
See also show().
[править] QImage QScreenCursor::image () const
Returns the cursor's image.
[править] void QScreenCursor::initSoftwareCursor () [static]
Initializes the screen cursor.
This function is typically called from the screen driver when initializing the device. Alternatively, the cursor can be set directly using the pointer returned by the static instance() function.
See also QScreen::initDevice().
[править] QScreenCursor * QScreenCursor::instance () [static]
Returns a pointer to the application's unique screen cursor.
Эта функция была введена в Qt 4.2.
[править] bool QScreenCursor::isAccelerated () const
Returns true if the cursor is accelerated; otherwise false.
[править] bool QScreenCursor::isVisible () const
Returns true if the cursor is visible; otherwise false.
[править] void QScreenCursor::move ( int x, int y ) [virtual]
Moves the mouse cursor to the given position, i.e., (x, y).
Note that the given position defines the top-left corner of the cursor's image, i.e., not the cursor's hot spot (the position of the associated mouse events).
See also set().
[править] void QScreenCursor::set ( const QImage & image, int hotx, int hoty ) [virtual]
Sets the cursor's image to be the given image.
The hotx and hoty parameters define the cursor's hot spot, i.e., the point within the cursor's image that will be the position of the associated mouse events.
See also move().
[править] void QScreenCursor::show () [virtual]
Shows the mouse cursor.
See also hide().
Copyright © 2007 Trolltech | Trademarks | Qt 4.3.2
|