Qt 4.8
Classes | Functions
qmouse_qws.cpp File Reference
#include "qmouse_qws.h"
#include "qwindowsystem_qws.h"
#include "qscreen_qws.h"
#include "qapplication.h"
#include "qtextstream.h"
#include "qfile.h"
#include "qdebug.h"

Go to the source code of this file.

Classes

class  QWSMouseHandlerPrivate
 

Functions

static int ilog2 (quint32 n)
 

Function Documentation

◆ ilog2()

static int ilog2 ( quint32  n)
static

Definition at line 491 of file qmouse_qws.cpp.

Referenced by QWSCalibratedMouseHandler::calibrate().

492 {
493  int result = 0;
494 
495  if (n & 0xffff0000) {
496  n >>= 16;
497  result += 16;
498  }
499  if (n & 0xff00) {
500  n >>= 8;
501  result += 8;}
502  if (n & 0xf0) {
503  n >>= 4;
504  result += 4;
505  }
506  if (n & 0xc) {
507  n >>= 2;
508  result += 2;
509  }
510  if (n & 0x2)
511  result += 1;
512 
513  return result;
514 }