Results 1 to 3 of 3

Thread: openGL

  1. #1
    Join Date
    Jan 2006
    Posts
    115
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default openGL

    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:
    [HTML]
    void MainWindow::info()
    {
    glWidget = new GLWidget(this);
    }
    [/HTML]
    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:
    [HTML]#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[/HTML]

  2. #2
    Join Date
    Jul 2006
    Posts
    79
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: openGL

    try:
    Qt Code:
    1. void MainWindow::info()
    2. {
    3. glWidget = new GLWidget(this);
    4. glWidget->show();
    5. }
    To copy to clipboard, switch view to plain text mode 

    regards..
    aman..

  3. #3
    Join Date
    Jan 2006
    Posts
    115
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: openGL

    Thanks aMan for your answer it works fine.

Similar Threads

  1. Does OpenGL be supported in opensource of Qt-4.1.2?
    By showhand in forum Qt Programming
    Replies: 1
    Last Post: 15th May 2006, 10:46
  2. OpenGl 2d
    By Lele in forum Qt Programming
    Replies: 10
    Last Post: 9th May 2006, 21:37
  3. help on openGL context
    By mickey in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2006, 19:21
  4. Qt's optimized OpenGL context switching
    By sverhoff in forum Qt Programming
    Replies: 0
    Last Post: 28th March 2006, 16:40
  5. Example OpenGL project?
    By brcain in forum Qt Tools
    Replies: 9
    Last Post: 23rd February 2006, 21:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.