View unanswered posts | View active topics It is currently Wed Oct 20, 2021 7:35 pm



Reply to topic  [ 3 posts ] 
 Want more mouse-event example for using GLC lib in QtCreator 
Author Message

Joined: Mon Aug 15, 2011 9:28 am
Posts: 5
Post Want more mouse-event example for using GLC lib in QtCreator
GLC lib looks really great. I'm trying to spend time to learn it and to follow the examples included in the GLC lib source code.

I just created a form ui and wanted to add the glc widget to the ui widget. But I could not get the mouse event. Maybe I need to create a event filter and install the eventfilter to the glc widget. Can anyone give me an example how to implement it? Also how to get the mouse event if I add the glc widget to a Qt TabWidget?

Thank you very much in advance!

/Fulin

Here is my code

Code:
#include <QtGui>
#include "testglc.h"
#include "ui_testglc.h"
#include "glwidget.h"

testglc::testglc(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::testglc)
{
    ui->setupUi(this);
    p_GLWidget= new GLWidget(this);

    p_GLWidget->installEventFilter(this);
    setCentralWidget(p_GLWidget);
}

testglc::~testglc()
{
    delete ui;
}


Mon Aug 15, 2011 10:41 am
Profile

Joined: Mon Aug 15, 2011 9:28 am
Posts: 5
Post Re: Want more mouse-event example for using GLC lib in QtCre
Hi,

I got the glcwidget work on a Qt tab without mouse event filter.

Code:
p_GLWidget= new GLWidget(ui->tab_GLC);
    p_GLWidget->setGeometry(QRect(0,0,600,400));


Wed Aug 17, 2011 10:46 am
Profile
Site Admin

Joined: Sun Jan 03, 2010 4:27 pm
Posts: 390
Post Re: Want more mouse-event example for using GLC lib in QtCre
Hi,
fulin wrote:
I just created a form ui and wanted to add the glc widget to the ui widget. But I could not get the mouse event. Maybe I need to create a event filter and install the eventfilter to the glc widget.

You doesn't need to add a event filter. Look at GLC_Player source code to see a sample :
Code:
glc_player::glc_player(QWidget *parent)
: QMainWindow(parent)
, m_OpenglView(this)
..
{
   setupUi(this);
   actionShowHideSection->setVisible(false);
   //setUnifiedTitleAndToolBarOnMac(true);
   setCentralWidget(&m_OpenglView);
   m_OpenglView.setFocusPolicy(Qt::StrongFocus);


@+


Wed Aug 17, 2011 2:51 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 5 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.