I'm trying to programm an qt application, and my design is the following. I need a menubar, toolbar, statusbar and the central widget. In the central widget i need to change among some custom widgets. Till now i have not problem. But when i programm my custom widget and try to put in the centralwidget, my customwidget not resize. Now i'm testing with a simple custom widget that contains 3 textboxes:
splitter
= new QSplitter (Qt
::Horizontal,
this);
splitter->addWidget(editor1);
splitter->addWidget(editor2);
splitter->addWidget(editor3);
editor1 = new QTextEdit;
editor2 = new QTextEdit;
editor3 = new QTextEdit;
splitter = new QSplitter (Qt::Horizontal,this);
splitter->addWidget(editor1);
splitter->addWidget(editor2);
splitter->addWidget(editor3);
To copy to clipboard, switch view to plain text mode
and in the mainwindows i programm something like this:
CreateToolBars();
CreateStatusBar();
setCentralWidget(w);
TextEditor = new WindowsTextEditor(); //--->this is my custom widget
vbox->addWidget(TextEditor);
w->setLayout(vbox);
CreateToolBars();
CreateStatusBar();
QWidget *w = new QWidget;
setCentralWidget(w);
TextEditor = new WindowsTextEditor(); //--->this is my custom widget
TextEditor->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
QVBoxLayout *vbox = new QVBoxLayout;
vbox->addWidget(TextEditor);
w->setLayout(vbox);
To copy to clipboard, switch view to plain text mode
This paint the toolbar, menubar, statusbar and in the central widget puts a little box....
I have tryed to give size to my widget, like this:
TextEditor = new WindowsTextEditor(800,800);
TextEditor = new WindowsTextEditor(800,800);
To copy to clipboard, switch view to plain text mode
and in my custom:
this->setGeometry(0,0,width,height);
...
this->setGeometry(0,0,width,height);
editor1 = new QTextEdit;
...
To copy to clipboard, switch view to plain text mode
But do the same, a little textbox....

Someone knows what's happening?
Thanks
Bookmarks