OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

creating widget for Qt


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
ami guru
Guest





PostPosted: Wed Mar 04, 2009 12:54 pm    Post subject:
creating widget for Qt
Reply with quote

Hello forum,

I would like to create a viewer widget for osg using the Qt designer.

To promote it i need the corresponding header file to that.

As  i see in the source you have the class declaration and definition in a sigle .cpp file.

Do  i have  to separate them or the header file is located somewhere else that i did not find.


Any hint?


Regards
Sajjad

------------------
Post generated by Mail2Forum
Back to top
Okdano (Iván Cuevas)
Newbie


Joined: 24 Feb 2009
Posts: 7

PostPosted: Wed Mar 04, 2009 10:27 pm    Post subject:
Reply with quote

Hi Sajjad,

Personally I create the whole interface in Qt designer and leave the OSG widget/s integration in the initialization code.

About the header file, I 've separated the code from the original OSG file in my own files (.h and .cpp) As you can see in the Qt sample you have different options to render OSG in a Qt widget.

This works for me except for some warnings because of rendering out of QPainter events, but I will deal with this later Smile

I hope this help you in some way,
Iván.
Back to top
View user's profile Send private message MSN Messenger
ami guru
Guest





PostPosted: Mon Mar 16, 2009 7:36 am    Post subject:
creating widget for Qt
Reply with quote

Hello Ivan,

In the pro file do i have to include OpenGL module

or just the library linker for Openscenegraph will suffice


Regards
Sajjad

---------- Forwarded message ----------
From: Iván <>
Date: Wed, Mar 4, 2009 at 11:27 PM
Subject: Re: creating widget for Qt
To: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)


Hi Sajjad,

Personally I create the whole interface in Qt designer and leave the OSG widget/s integration in the initialization code.

About the header file, I 've separated the code from the original OSG file in my own files (.h and .cpp) As you can see in the Qt sample you have different options to render OSG in a Qt widget.

This works for me except for some warnings because of rendering out of QPainter events, but I will deal with this later Smile

I hope this help you in some way,
Iván.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=7966#7966





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

------------------
Post generated by Mail2Forum
Back to top
Okdano (Iván Cuevas)
Newbie


Joined: 24 Feb 2009
Posts: 7

PostPosted: Mon Mar 16, 2009 10:42 pm    Post subject:
Reply with quote

I don't use .pro files, but I have to include the OpenGL module because I extend from QGLWidget.

Regards,
Iván.
Back to top
View user's profile Send private message MSN Messenger
ami guru
Guest





PostPosted: Tue Mar 17, 2009 12:06 pm    Post subject:
creating widget for Qt
Reply with quote

Hello Ivan


i shall try to elaborate the way i implemented that and your feedback is most welcome on that.


1. Separated the following files from the osgviewerQT example.
   
    AdapterWidget.h

   AdapterWidget.cpp
   ViewerQT.h
And promoted the widget to the ViewerQT.h

Loading the widget in the mainwindow and can load different model.

And i did not recieve any warning so far.

Yo said that you are having that while paint event(),


Where are you exactly having that paint event() ?


Did you mean that in the AdapterWidget that is the subclass of GLWidget?


Regards
Sajjad

---------- Forwarded message ----------
From: ami guru < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Date: Tue, Mar 17, 2009 at 1:04 PM
Subject: Fwd: creating widget for Qt
To: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)


Hello Ivan


i shall try to elaborate the way i implemented that and your feedback is most welcome on that.


1. Separated the following files from the osgviewerQT example.
   
    AdapterWidget.h

   AdapterWidget.cpp
   ViewerQT.h
And promoted the widget to the ViewerQT.h

Loading the widget in the mainwindow and can load different model.

And i did not recieve any warning so far.

Yo said that you are having that while paint event(),


Where are you exactly having that paint event() ?


Did you mean that in the AdapterWidget that is the subclass of GLWidget?


Regards
Sajjad



---------- Forwarded message ----------
From: ami guru < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Date: Tue, Mar 17, 2009 at 12:59 PM
Subject: Fwd: creating widget for Qt
To: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)


Hello Ivan


i shall try to elaborate the way i implemented that and your feedback is most welcome on that.


1. Separated the following files from the osgviewerQT example.
   
    AdapterWidget.h


---------- Forwarded message ----------
From: Iván Cuevas <>
Date: 2009/3/16
Subject: Re: creating widget for Qt


To: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)


I don't use .pro files, but I have to include the OpenGL module because I extend from QGLWidget.

Regards,
Iván.

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=8567#8567






_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

------------------
Post generated by Mail2Forum
Back to top
Okdano (Iván Cuevas)
Newbie


Joined: 24 Feb 2009
Posts: 7

PostPosted: Thu Mar 19, 2009 10:01 am    Post subject:
Reply with quote

Hi Sajjad,
The warnigs are because I'm rendering in a QWidget out of the paint event. These warnings doesn't appear if you render in a QGLWidget, but the CompositeViewer framework with multiple OSG views in different widgets and multi-threaded does no render properly (at least for me :cry: )

Recently I moved to Qt 4.5.0 and I had a new problem with undesired repaint event when the OSG widget lost the focus. For example when a modal dialog is shown, my QWidget embbeding the osg::View is repainted with the background color and the content are removed until the osg widget recovers the focus and is repainted again.
I solved this problem using QWidget::setUpdatesEnabled(false) but still I have the problem of the warnings.

I think is not the same situation than yours because you are extending from AdapterWidget, but tell if you discover something Wink

Regards,
Iván
Back to top
View user's profile Send private message MSN Messenger
ami guru
Guest





PostPosted: Thu Mar 19, 2009 10:57 am    Post subject:
creating widget for Qt
Reply with quote

Hello Ivan,


What is the difference betwen  the AdapterWidget and QOSGWidget.

I found one to be the subclass of GLWidget and the other is QWidget.

Which one is better ?

Any explanation?


Regards
Sajjad


---------- Forwarded message ----------
From: Iván Cuevas < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>
Date: 2009/3/19
Subject: Re: creating widget for Qt
To: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)


Hi Sajjad,
The warnigs are because I'm rendering in a QWidget out of the paint event. These warnings doesn't appear if you render in a QGLWidget, but the CompositeViewer framework with multiple OSG views in different widgets and multi-threaded does no render properly (at least for me [Crying or Very sad] )

Recently I moved to Qt 4.5.0 and I had a new problem with undesired repaint event when the OSG widget lost the focus. For example when a modal dialog is shown, my QWidget embbeding the osg::View is repainted with the background color and the content are removed until the osg widget recovers the focus and is repainted again.
I solved this problem using QWidget::setUpdatesEnabled(false) but still I have the problem of the warnings.

I think is not the same situation than yours because you are extending from AdapterWidget, but tell if you discover something Wink

Regards,
Iván

------------------
Read this topic online here:

http://forum.openscenegraph.org/viewtopic.php?p=8755#8755






_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

------------------
Post generated by Mail2Forum
Back to top
mgb_osg (Martin Beckett)
Appreciator


Joined: 18 Feb 2009
Posts: 239

PostPosted: Thu Mar 19, 2009 5:53 pm    Post subject:
Reply with quote

I asked the same question last year - here is the answer http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16305.html

With QT4.5 I am having to use Adapterwidget because I get a recursive redraw with QOSGWidget which I haven't been able to fix yet.
QOSGWidget does work if you switch to the (experimental) Opengl rendering backend with QT but then the rest of the app draws very slowly.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts How can I embed OSG into imgui as a w... blackball General 4 Sun Sep 29, 2019 10:33 am View latest post
No new posts Creating depth texture in pre render ... wernerM General 0 Fri Mar 16, 2018 2:31 pm View latest post
No new posts Creating an array of same type a give... wernerM General 1 Fri Jan 26, 2018 3:47 pm View latest post
No new posts Specifying indices of triangle vertic... antiro42 General 1 Thu Dec 21, 2017 12:44 pm View latest post
No new posts Creating Texture2DArray Bruno Oliveira General 13 Thu Oct 20, 2016 9:00 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP