PDA

View Full Version : openGL



dragon
12th July 2006, 19:52
Hello anybody,

I have wrote a header file and cpp file in openGL to make a cube that is rotating.
file calls glwidget.h and glwidget.cpp
I have also a MainWindow with a menubar in the menubar i have got a item that calls Help with subitem info.
I have made a connection in the MainWindow like this:
connect(actionInfo, SIGNAL(triggered()), this, SLOT(info()));

The slot info look like this:


void MainWindow::info()
{
glWidget = new GLWidget(this);
}

Compiling the whole files is not the problem .
But when click with the mouse on the item info nothing happens.
Is something wrong in my code.

My mainwindow.h look like this:

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "ui_contactwindow.h"
#include <QMainWindow>

class GLWidget;


class MainWindow : public QMainWindow, Ui::MainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);


private slots:
void open();
void save();
void saveAs();
void add();
void edit();
void remove();
void info();
void exit();

private:
void loadFile(const QString &fileName);
void saveFile(const QString &fileName);
QString fileName;
GLWidget *glWidget;

};
#endif

aMan
12th July 2006, 23:02
try:


void MainWindow::info()
{
glWidget = new GLWidget(this);
glWidget->show();
}


regards..
aman..

dragon
13th July 2006, 16:07
Thanks aMan for your answer it works fine.