bool QRect::contains ( const QPoint & point, bool proper = false ) const

函数声明:void QPainter::drawImage ( const QRectF & target, const QImage & image, const QRectF & source, Qt::ImageConversionFlags flags = Qt::AutoColor )
举例:
  QRectF target(10.0, 20.0, 80.0, 60.0); //建立目标矩形
  QRectF source(0.0, 0.0, 70.0, 40.0); //建立源矩形,用来框定源图像文件中要显示的部分
  QImage image(":/images/myImage.png"); //建立QImage类对象image

  QPainter painter(this);
  painter.drawImage(target, image, source); //将源图像文件中(0.0, 0.0, 70.0, 40.0)位置的图像画到painter device中的

                                                                       //(10.0, 20.0, 80.0, 60.0)位置上,大小自适应

 

 

 

bool QRect::contains ( const QPoint & point, bool proper = false ) const
如果被给的点在矩形内部或者边缘上,返回true。否则返回错。如果参数proper是true,这个函数返回true,只用当被给的点是在矩形的内部(不在边上)。
bool QRect::contains ( int x, int y, bool proper ) const
这是一个重载函数。
返回true,如果点(x,y)是在矩形的内部或者边缘上。否则返回false。同上
bool QRect::contains ( int x, int y ) const
这也是一个重载函数
如果点(x,y)在矩形内部,返回true,否则返回false
bool QRect::contains ( const QRect & rectangle, bool proper = false ) const
这是一个重载函数。同上
void QRect::getCoords ( int * x1, int * y1, int * x2, int * y2 ) const
获取矩形的左上角位置到x1和y1,并且右下角的位置到x2、y2
void QRect::getRect ( int * x, int * y, int * width, int * height ) const
获取矩形的左上角位置到x、y,并且它的尺寸到width和heigth
int QRect::height () const
返回高
QRect QRect::intersected ( const QRect & rectangle ) const
返回两个矩形的交集。
bool QRect::intersects ( const QRect & rectangle ) const
如果矩形相交返回true。
这个交集能被获得通过intersected()函数。


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ypoflyer/archive/2010/05/10/5573768.aspx

填充下面这个程序中所有出现// TODO: fill the code这个任务的地方#include <iostream> #include <cstring> #include "ourstring.h" #include "strlib.h" using namespace std; OurString::OurString(){ // TODO: fill the code } OurString::OurString(const char *str){ // TODO: fill the code } OurString::OurString(const OurString &dstr){ // TODO: fill the code } OurString::~OurString(){ // TODO: fill the code } string OurString::toString() const{ // TODO: fill the code } OurString OurString::subStr(unsigned int start, unsigned int n) const{ // TODO: fill the code } bool OurString::operator > (const OurString &dstr) const{ // TODO: fill the code } bool OurString::operator < (const OurString &dstr) const{ // TODO: fill the code } bool OurString::operator == (const OurString &dstr) const{ // TODO: fill the code } unsigned int OurString::length () const{ // TODO: fill the code } const OurString& OurString::operator = (const OurString &dstr){ // TODO: fill the code } const OurString& OurString::operator = (const char *str){ // TODO: fill the code } char& OurString::operator[](int index){ // TODO: fill the code } const OurString OurString::operator + (const OurString &dstr) const{ // TODO: fill the code } const OurString OurString::operator + (const char *str) const{ // TODO: fill the code } const OurString& OurString::operator += (const OurString &dstr){ // TODO: fill the code } const OurString& OurString::operator += (const char *str){ // TODO: fill the code } ostream & operator<<(ostream &os, const OurString &dstr){ // TODO: fill the code } istream & operator>>(istream &is, OurString &dstr){ // TODO: fill the code }
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值