Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Unable to add widgets to the newly navigated window
hai everybody , thanks for your help. Now i am able to navigate from one window to other.
I need to add some widgets in the navigated window. But when i am adding it is not seen in the new window. Can anybody help in this. Advance thanks to all
Sam last edited by
It will be helpuful if you can share your code .
amban last edited by
Maybe you are missing on
void QWidget::setLayout ( QLayout * layout )
sorry for the late reply. I am attaching the code. as the code is having more .cpp and .h files, i am attaching only the page for which the clarification is needed. once again i will tell the aim of the program is listed below:
(1) i want to access the serially transmitted datas from another computer
(2) As soon as the datas are received the same should be displyed in a oscilloscope.
Problem to be solved:
(1) I am able to display one window and able to collect the data through serial port. I have placed a push button in that window. wen the push button is clicked i want to generate a new window in which the qwt oscilloscope window has to be displayed.
(2) I will show the line of code which i have written in this program for the same
connect(ui->openCloseButton, SIGNAL(clicked()), SLOT(osci()));
after the same i have called the osci() function as the one below.
QMainWindow *osci = new QMainWindow(this);
Now wen i am clicking a new window is displaying . My question is how to add the components into that new window. or how to include the oscilloscope program of qwt to it .
I was not able to post the entire code here as it is showing exceeding of 6000 characters
I will really gratefull if anybody can give the solution for the one above.
I am conveying my advance thanks to all.
expecting a postive reply
amban last edited by
Instead of a regular QMainWindow, create your own window subclassed from a QMainWindow.
class osciWindow : public QMainWindow
..... // define your elements
In your slot, display the above window.....
osciWindow *osci = new osciWindow(this);
Follow the Qt examples, they are very good.
thanks alot . i will try the same and get back to you