Discussion Board

Results 1 to 5 of 5

Thread: Just curious

  1. #1
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    I used contentsRect() to receive a QRect object, then used .height() to extract the height. Viewed in the debugger, the QRect is (8,8,352,220), but when I retrieve the height it's retrieved as 213.

    Not causing a problem -- just curious as to what's going on here.

  2. #2
    Nokia Developer Moderator croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    Did you do anything special? I tried to do the same thing on a widget and a pushButton and it returned correct results.

    For example, the following returned 30. The rect() was (QRect) 100x30+0+0 in debug. Makes sense.
    Code:
    pushButton->setText(QString::number(pushButton->contentsRect().height()));
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Was it something like that?

    Code:
    QRect rect = object->contentsRect();
    qDebug() << rect;
    int height = rect.height();
    qDebug() << height;

  4. #4
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Two assignments pretty much like that, and isolated from any other similar logic that might have confused things. I was viewing the values with the Carbide debugger, though.

    Here's the actual code:
    Code:
        QRect scrollWindowRect = ui ->mScrollWindow ->contentsRect();
        int scrollWindowHeight = scrollWindowRect.height();

  5. #5
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by danhicksbyron View Post
    Two assignments pretty much like that, and isolated from any other similar logic that might have confused things. I was viewing the values with the Carbide debugger, though.

    Here's the actual code:
    Code:
        QRect scrollWindowRect = ui ->mScrollWindow ->contentsRect();
        int scrollWindowHeight = scrollWindowRect.height();
    It might be a problem of the Carbide debugger. You can verify it with qDebug.

Similar Threads

  1. Curious Function Declaration
    By leejx in forum Symbian C++
    Replies: 5
    Last Post: 2009-08-26, 03:37
  2. Curious about how open c/c++ is tested
    By fmcgeough in forum Open C/C++
    Replies: 3
    Last Post: 2009-06-11, 10:08
  3. Replies: 4
    Last Post: 2008-12-29, 07:40
  4. curious
    By deanjameswilding in forum General Messaging
    Replies: 1
    Last Post: 2008-07-16, 18:18
  5. Curious Benchmark
    By mushakk in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2004-03-03, 16:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved