Results 1 to 15 of 15

Thread: How I must do this

  1. #1
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How I must do this

    hello, I have a question how must I do this :



    Please tell me how I must do this.. the Tab Widget

    kjiu_pc

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How I must do this

    use QTabWidget .. if u want a different look and feel to it..use QStylesheet

  3. #3
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How I must do this

    ok and the last question is why the program (chat)
    http://wiki.qtcentre.org/index.php?title=Simple_chat

    have problems :
    SimpleChatServer/main.cpp:2:24: error: QHostAddress: No such file or directory
    In file included from SimpleChatServer/main.cpp:3:
    SimpleChatServer/simplechatserver.h:4:22: error: QTcpServer: No such file or directory
    In file included from SimpleChatServer/main.cpp:3:
    SimpleChatServer/simplechatserver.h:12: error: expected class-name before ‘{’ token
    SimpleChatServer/main.cpp: In function ‘int main(int, char**)’:
    SimpleChatServer/main.cpp:21: error: ‘class SimpleChatServer’ has no member named ‘listen’
    SimpleChatServer/main.cpp:21: error: ‘QHostAddress’ has not been declared
    make: *** [main.o] Błąd 1

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How I must do this

    What does 'qmake -v' output?
    J-P Nurmi

  5. #5
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How I must do this

    what ??..

    I have Linux Ubuntu

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How I must do this

    ...if you type a command 'qmake -v' in terminal, what does it output? Probably you're trying to use a wrong qmake from Qt 3 installation. Try using 'qmake-qt4' instead, or use Ubuntu tools (update-alternative) to switch 'qmake' to point to the correct version.
    J-P Nurmi

  7. #7
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How I must do this

    ok I have SimpleChat.pro like this :

    Qt Code:
    1. ######################################################################
    2. # Automatically generated by qmake (2.01a) ?r. lut 11 18:36:37 2009
    3. ######################################################################
    4.  
    5. QT += network
    6. TEMPLATE = app
    7. TARGET =
    8. DEPENDPATH += . SimpleChatClient SimpleChatServer
    9. INCLUDEPATH += . SimpleChatClient SimpleChatServer
    10.  
    11. # Input
    12. HEADERS += SimpleChatClient/simplechatclient.h \
    13. SimpleChatServer/simplechatserver.h
    14. SOURCES += SimpleChatClient/main.cpp \
    15. SimpleChatClient/simplechatclient.cpp \
    16. SimpleChatServer/main.cpp \
    17. SimpleChatServer/simplechatserver.cpp
    To copy to clipboard, switch view to plain text mode 

    and there I one problem :
    Qt Code:
    1. main.o: In function `main':
    2. main.cpp:(.text+0x0): multiple definition of `main'
    3. main.o:main.cpp:(.text+0x0): first defined here
    4. collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How I must do this

    you have two main functions..which is a crime in c and c++ both

    SOURCES += SimpleChatClient/main.cpp \
    SimpleChatServer/main.cpp \

  9. #9
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How I must do this

    but in the pack there is 2 main.cpp

  10. #10
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How I must do this

    which means u should build them seperately..sort out which file belongs to which project and build seperately

  11. #11
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How I must do this

    actually, this is trouble with qmake, you have two files with the same names, but in different directories, qmake don't recognize these files properlly. I suggest to create to different projects for client and server or use different build system CMake for example.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  12. #12
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How I must do this

    Re-download the package and DO NOT run "qmake -project". The top-level .pro file had a subdirs template but you overrode it with an automatically generated project file by running "qmake -project".
    J-P Nurmi

  13. #13
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How I must do this

    thanks it work !

  14. #14
    Join Date
    Feb 2009
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How I must do this

    and were is server I must put me ip ?

  15. #15
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How I must do this

    Quote Originally Posted by kjiu View Post
    and were is server I must put me ip ?
    What do you mean? You are supposed to enter the IP address of the server. It's up to you where you run the server. However, in this example it must be running somewhere.
    J-P Nurmi

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.