Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6960291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:23:01+00:00 2026-05-27T15:23:01+00:00

In QtCreator, I used a form to draw a grid layout. In my main

  • 0

In QtCreator, I used a form to draw a grid layout. In my main window class, I added a QGraphicsScene wrapper object to this grid layout and am using the wrapper class to draw points onto the scene with mouse clicks.

What’s happening is I’m clicking in locations that are negative relative to the QGraphicsScene wrapper, which is not the effect I’m going for, so I want to make sure I know the coordinates filled up by my QGraphicsScene and grid layout.

How can I get the size filled by the grid layout? I’m currently doing something to this effect…

view = new QGraphicsViewWrapper();
ui->gridLayout->addWidget(view);

QGraphicsViewWrapper::QGraphicsViewWrapper(QWidget *parent) : QGraphicsView(parent)
{
    scene = new QGraphicsScene(50, 50, 350, 350);
    this->setSceneRect(50, 50, 350, 350);
    this->setScene(scene);
    this->setGeometry(QRect(20, 50, 400, 400));
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:23:02+00:00Added an answer on May 27, 2026 at 3:23 pm

    Not sure I completely understand your aim but could you not do:

    QRect size = ui->gridLayout->geometry();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how to Design a QTWidget Form using QTCreator at Design Time ? I want
QtCreator has this nice feature to bring up the API-doc for a class/method when
I'm using QTCreator on the Mac, and I'm trying to get used to it.
When I'm writing code with QtCreator (2.4.1), I'm very often in this situation: something
I'm writing a custom makefile project using QtCreator and I want to delete a
I am trying to WriteProcessMemory using Qt with QtCreator. When i press the button
I'm using Qt4.8 on OSX Leopard and instead of qmake + QtCreator I want
I made an application for Linux using QtCreator. The application uses two external libraries,
i write this program to split string in QtCreator #include <QtCore/QCoreApplication> #include <iostream> #include
I'm developping a very simple app on my Ubuntu using QtCreator. It's a console

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.