Dunno for the flags but the pointer you can check very easy
Qt Code:
  1. if (horizontalScrollBar()) // The ponter is valid
  2. // some code...
  3. else // The pointer is not valid
  4. // some other code...
To copy to clipboard, switch view to plain text mode