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

  • Home
  • SEARCH
  • 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 7970087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:20:35+00:00 2026-06-04T07:20:35+00:00

So I’ve run into a problem while integrating QT and OSG. I’ve had a

  • 0

So I’ve run into a problem while integrating QT and OSG. I’ve had a QT/OSG program that been working just fine. The layout is simlar to what you see below.

|--------------------------|
|  1   |         2         |
|      |                   |
|      |                   |
|      |                   |
|      |                   |
|      |                   |
|      |-------------------|
|      |         3         |
|      |                   |
|--------------------------|

The central widget consists of a QFrame which has three sub widgets and is using grid layout. Widget 1 is a QFrame also with a grid layout. Widget 2 is the OSG viewer as described below. Widget 3 is a QFrame also with a grid layout.

Two is populated with a widget modeled after the example in osgviewerQT.cpp. Basically it uses an embedded window and I have a QTimer that fires every 10 milliseconds and calls the osg frame function.

I have 4 other widgets. Two QLabels and two QTables which I populate dynamically. I’ve been adding all four of these widgets to 1’s grid layout. When I do that everything works nicely and I get my nice scene graph in 2. If I make one change, moving these four widgets from 1 to 2’s grid layout suddenly my scene graph disappears. Any ideas what is going wrong? I’ve checked in valgrind so I am pretty sure its not a memory issue and rather its how I am using the lib. I’ve confirmed the frame function is being called.

  • 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-06-04T07:20:36+00:00Added an answer on June 4, 2026 at 7:20 am

    I’ve found a solution: you must add a size hint for the viewer control. Something like this will be ok:

    In AbstractQTGLWidget.hpp:

    ...
    class AbstractQTGLWidget ... {
      ...
    protected:
      QSize sizeHint() const { return QSize(400,300); }
      ...
    };
    

    I think (but not 100% sure) that the problem is within the constructor, when the width() and height() properties are used.

    Different layouts, different priorities in establishing the width and height of each widget, and so the constructor is blind to the final width and height.

    Giving an initial width and height, I assume the underlying osg viewer can calculate the camera and object references, and begin the process accordingly. Later changes in width and height are applied correctly, as the object was initiated with correct sizes, though not final.

    Maybe the control thinks it has a size of 0 by 0 pixels, and the renderer gets crazy initializing…

    With 0:
    with 0

    With 1:
    With 1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.