44 #include <arpa/inet.h> 46 #include <QApplication> 98 const quint16 tmp[6] = { htons(0),
103 socket->
write((
char*)tmp,
sizeof(tmp));
105 const quint32 encoding = htonl(-239);
106 socket->
write((
char*)(&encoding),
sizeof(encoding));
125 const quint16 tmp[6] = { htons(0),
128 htons(image->
width()),
130 socket->
write((
char*)tmp,
sizeof(tmp));
132 const quint32 encoding = htonl(-239);
133 socket->
write((
char*)(&encoding),
sizeof(encoding));
140 char *buffer =
new char[n];
141 for (
int i = 0; i < img.
height(); ++i) {
143 socket->
write(buffer, n);
151 const int width = (bitmap.
width() + 7) / 8;
152 for (
int i = 0; i < bitmap.
height(); ++i)
The QPainter class performs low-level painting on widgets and other paint devices.
void changeCursor(QCursor *widgetCursor, QWidget *widget)
This method is called by Qt whenever the cursor graphic should be changed.
void convertPixels(char *dst, const char *src, int count) const
The QCursor class provides a mouse cursor with an arbitrary shape.
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
bool isNull() const
Returns true if it is a null image, otherwise returns false.
QRect drawCursor(QPainter &)
QImage image() const
Returns the cursor's image.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QVNCScreen class implements a screen driver for VNC servers.
QVNCCursor(QVNCScreen *s)
The QImage class provides a hardware-independent image representation that allows direct access to th...
QImage createAlphaMask(Qt::ImageConversionFlags flags=Qt::AutoColor) const
Builds and returns a 1-bpp mask from the alpha buffer in this image.
The QTcpSocket class provides a TCP socket.
int depth() const
Returns the depth of the image.
QSize size() const
Returns the size of the image, i.
static QAuServer & server()
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
QTcpSocket * clientSocket() const
The QRect class defines a rectangle in the plane using integer precision.
int height() const
Returns the height of the image.
int y() const
Returns the y coordinate of this point.
void setCursorMode(bool vnc)
int x() const
Returns the x coordinate of this point.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
int clientBytesPerPixel() const