Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Add a QGLView object to Qt GUI application

Add a QGLView object to Qt GUI application

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 625 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunil.nair
    wrote on last edited by
    #1

    This question has been asked before and I want to expand on it. How to render in Qt3D in standard GUI application? but I cannot find an answer.

    Now that we have the QT 5.3 and above versions available, is it possible to have a subwindow of QGLView window into an existion mainwindow application?

    The MdiArea is fine and I am able to see the subwindow1 as a part of my central widget.
    I am also able to view the QGL object window when I write view. show.
    Problem:

    When I wrap the QGLView window object into a widget wrapper using QWidget::createWindowContainer(view); and then use this widget inside subwindow 2, i get multiple windows popping up and error: Invalid parameter passed to C runtime function.

    How do i view this QGLView window inside a subwindow.

    @MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    view=0;

    mainlayout= new QVBoxLayout;
    displaywidget= new QHBoxLayout;
    
    
    QLabel *label = new QLabel("<h1><font color = RED> Tangible textures </font> </h1>");// create the application title
    
    //create the icons for all the UI push button and resize the buttons
    ui->pushButton->setIcon(QIcon(":/pattern4.jpg"));
    ui->pushButton->resize(buttonsize);
    
    mainDisplay= new QMdiArea;//mainDisplay is the Mdi Area
    subwindow1= new QMdiSubWindow;
    subwindow1->setWidget(ui->pushButoon);
    mainDisplay->addSubWindow(subwindow1);
    subwindow2= new QMdiSubWindow;
    setCentralWidget(mainDisplay);
    

    }

    void MainWindow::on_pushButton_clicked()
    {
    //if this is the first button to be clicked on the UI
    if(view==NULL)
    {
    view=new CubeView();
    view->begin(4);
    view->resize(800, 600);
    container = QWidget::createWindowContainer(view);
    subwindow2->setWidget(container);
    mainDisplay->addSubWindow(subwindow2);
    }

    }

    MainWindow::~MainWindow()
    {
    delete ui;
    if(view!=NULL){
    std::cout<<"view object deleted"<<std::endl;
    delete view;}
    delete mainlayout;
    delete catalogue;
    delete subwindow;
    delete scrollregion;
    }@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved