Marga
21st September 2011, 13:02
Hello all,
I have a QGridLayout set up, where I insert my widgets. I have 3 widgets: QSplitter (dirBrowser), a QTextEdit (textView) and a QGLWidget (windowOpenGL). My code is the following:
void setupUi(QMainWindow *mainWindow)
{
if (mainWindow->objectName().isEmpty())
mainWindow->setObjectName(QString::fromUtf8("mainWindow"));
mainWindow->resize(800, 600);
//grid layout
gridLayout = new QGridLayout();
layoutWidget = new QWidget(mainWindow);
layoutWidget->setLayout(gridLayout);
mainWindow->setCentralWidget(layoutWidget);
//openGL window
windowOpenGL = new GLWidget(mainWindow);
//Splitter
dirBrowser = new QSplitter(mainWindow); //define the where the browsers will be contained
//... here I add QListViews and QTreeViews to the splitter
//Text view
textView = new QTextEdit(mainWindow);
textView->setReadOnly(true);
gridLayout->addWidget(dirBrowser, 0, 0, 1, 1);
gridLayout->addWidget(textView, 1, 0, 1, 1);
gridLayout->addWidget(windowOpenGL, 2, 0, 1, 1);
// .. here there are some connects(...)
}
Using this code as it is, the window does not display the OpenGL window. However, if I don't add the QTextEdit to the grid layout, it displays normally. The strange thing is that if instead of adding QTextEdit to the grid I add, for a example, a simple button, the OpenGL widget is displayed correctly as well.
What am I missing??? I would appreciate SO MUCH your help!!
Thanks in advance!
I have a QGridLayout set up, where I insert my widgets. I have 3 widgets: QSplitter (dirBrowser), a QTextEdit (textView) and a QGLWidget (windowOpenGL). My code is the following:
void setupUi(QMainWindow *mainWindow)
{
if (mainWindow->objectName().isEmpty())
mainWindow->setObjectName(QString::fromUtf8("mainWindow"));
mainWindow->resize(800, 600);
//grid layout
gridLayout = new QGridLayout();
layoutWidget = new QWidget(mainWindow);
layoutWidget->setLayout(gridLayout);
mainWindow->setCentralWidget(layoutWidget);
//openGL window
windowOpenGL = new GLWidget(mainWindow);
//Splitter
dirBrowser = new QSplitter(mainWindow); //define the where the browsers will be contained
//... here I add QListViews and QTreeViews to the splitter
//Text view
textView = new QTextEdit(mainWindow);
textView->setReadOnly(true);
gridLayout->addWidget(dirBrowser, 0, 0, 1, 1);
gridLayout->addWidget(textView, 1, 0, 1, 1);
gridLayout->addWidget(windowOpenGL, 2, 0, 1, 1);
// .. here there are some connects(...)
}
Using this code as it is, the window does not display the OpenGL window. However, if I don't add the QTextEdit to the grid layout, it displays normally. The strange thing is that if instead of adding QTextEdit to the grid I add, for a example, a simple button, the OpenGL widget is displayed correctly as well.
What am I missing??? I would appreciate SO MUCH your help!!
Thanks in advance!