PDA

View Full Version : Calling multiple UI's?



QtAlexander
10th December 2010, 11:44
Hello fellow programmers!

i have a "tiny" problem, for which i need some help. Me and another guy have individually been writing on an application, and we have split it into two parts. Now i am trying to tie the pieces together into 1 final appliacation, but i can't seem to call the UI? I have compared it to the "template" Qt makes, when i start a new program, and in my eyes, what i have written is exactly the same as the Qt template where it works?

Also i need to call multiple UI's in one Class...
anyway; here is my code, please someone do some magic :)

Here's my Header:

http://i55.tinypic.com/2jebazb.png

And cpp.

http://i55.tinypic.com/53nxhz.png


:)

FelixB
10th December 2010, 11:46
uiViewer is a Poiner. you need to acces it's member via "->"

QtAlexander
10th December 2010, 12:04
uiViewer is a Poiner. you need to acces it's member via "->"

"." is a Qt shortcut for "->". it doesn't work with that either..

high_flyer
10th December 2010, 12:08
"." is a Qt shortcut for "->".
This is a Qt forum not basic C/C++ concepts and syntax help forum.
'.' is NOT a shortcut for anything, specially not for '->'.
Please refer to pointers in C/C++, and C/C++ syntax.

QtAlexander
10th December 2010, 12:16
anyway; that is not the question, i have tried with "->" and it doesn't work :)

squidge
10th December 2010, 12:20
Does it work if you remove the class from the namespace?

FelixB
10th December 2010, 12:53
what exactly is your problem: do you get compiler errors? Or does your IDE (which one?) not show a method-choosing-window? Sometimes IDEs do not notice changes before a compilation run.

bmn
10th December 2010, 14:04
yeah the problem is, like felix said, the missing method-choosing-window.. i have tried to compile it (several times) and i still don't get the methos-choosing window.
If i remove the class from the namespace i get this error:

ISO c++ forbids declaration of 'adressViewer' with no type

ChrisW67
10th December 2010, 22:46
This is a compilation error telling you quite plainly that "adressViewer" is not declared before you try to use it. If the compiler cannot find a definition, is it any wonder that the IDE (Qt Creator I assume) cannot either. With the limited information you have provided, the only obvious things to check are:

That the "ui_adresses.h" file is generated, carries the correct name, and actually declares a class "adressViewer" (not "adresses"). This name is definitely not the default name that Qt Creator would have generated for you (that would have been ui_adressviewer.h).
That you have not "accidentally" spelt the word "address" correctly in your declaration and incorrectly everywhere else.


The dot is not a shortcut in C++ for pointer dereferencing. Qt Creator corrects the common error of trying to use a dot to access a class member through a pointer. It can only do this if it knows what type things are: not the case here.