PDA

View Full Version : I have a rather convoluted question



emp1953
29th April 2019, 22:25
I am using RHEL 6 and Qt4.8
Also using QtCreator.

I have a project where I have a QListWidget implemented on a ui form. All my functionality works as I expect it.
I have another project where I have a regular ui implemented. I added another UI to that project via Add New Class.

1) First I want to show the new ui via a button press on the existing GUI. I cannot get the added ui to be recognized by the existing UI.

2) Then I want to put my QListWidget from the other project onto this added UI.

If I get #1 solved, I think I can get #2 done myself.

Thanks for any help

anda_skoa
30th April 2019, 09:08
What does "another UI" mean?

A window of some kind (dialog, mainwindow)?
Or a widget that needs to be embedded into a container somewhere?

What do you mean with "cannot get it recognized"?
Are there any errors?

Cheers,
_

emp1953
30th April 2019, 16:01
What does "another UI" mean?

A window of some kind (dialog, mainwindow)?
Or a widget that needs to be embedded into a container somewhere?

What do you mean with "cannot get it recognized"?
Are there any errors?

Cheers,
_

The original project is a QMainWindow type of project. everything is part of the .pro file and compiles.
The compiler error is
invalid use of lp1->ui->listPanel1->show();

I try to get the MainWindow code to recognize the listPanel1 panel with this line of code in the .h file for the MainWindow cpp file.
listPanel1* lp1;

listPanel1 is the name of the second ui panel class and its .h file is included in the .h file for the MainWindow class.

Thanks

d_stranz
30th April 2019, 19:24
The compiler error is
invalid use of lp1->ui->listPanel1->show();


"listpanel1" is the name of a class. The compiler is telling you you can't use the name of a class in the context of the statement you have written.

emp1953
30th April 2019, 21:39
"listpanel1" is the name of a class. The compiler is telling you you can't use the name of a class in the context of the statement you have written.

This brings me back to my original question. How do I get my code to recognize this additional ui so that I can display it? Is my declaration in the header file wrong as I have it written above?

Added after 1 27 minutes:


This brings me back to my original question. How do I get my code to recognize this additional ui so that I can display it? Is my declaration in the header file wrong as I have it written above?

It looks like I solve the issue. It was with my header file declaration.
Thanks to all