Results 1 to 9 of 9

Thread: Calling multiple UI's?

  1. #1
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Calling multiple UI's?

    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:

    [IMG][/IMG]

    And cpp.





  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Calling multiple UI's?

    uiViewer is a Poiner. you need to acces it's member via "->"

  3. #3
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Calling multiple UI's?

    Quote Originally Posted by FelixB View Post
    uiViewer is a Poiner. you need to acces it's member via "->"
    "." is a Qt shortcut for "->". it doesn't work with that either..

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Calling multiple UI's?

    "." 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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Nov 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Calling multiple UI's?

    anyway; that is not the question, i have tried with "->" and it doesn't work

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Calling multiple UI's?

    Does it work if you remove the class from the namespace?

  7. #7
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Calling multiple UI's?

    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.

  8. #8
    Join Date
    May 2007
    Posts
    131
    Thanks
    17
    Thanked 4 Times in 2 Posts

    Default Re: Calling multiple UI's?

    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

  9. #9
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Calling multiple UI's?

    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.
    Last edited by ChrisW67; 10th December 2010 at 22:53.

Similar Threads

  1. Replies: 2
    Last Post: 9th December 2010, 16:49
  2. Calling paintEvent when I want to
    By di_zou in forum Newbie
    Replies: 3
    Last Post: 14th October 2009, 10:29
  3. Calling a webservice
    By steg90 in forum Qt Programming
    Replies: 8
    Last Post: 17th December 2007, 18:29
  4. Calling QApplication from a Non-QT app?
    By hickscorp in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2007, 22:00
  5. Replies: 0
    Last Post: 21st December 2006, 11:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.