PDA

View Full Version : How I must do this



kjiu
11th February 2009, 18:33
hello, I have a question how must I do this :

http://img17.imageshack.us/img17/5528/zrzutekranuoprogramiemo9.png

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

kjiu_pc

talk2amulya
11th February 2009, 18:40
use QTabWidget .. if u want a different look and feel to it..use QStylesheet

kjiu
11th February 2009, 18:44
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

jpn
11th February 2009, 18:54
What does 'qmake -v' output?

kjiu
11th February 2009, 19:39
what ??..

I have Linux Ubuntu

jpn
11th February 2009, 19:45
...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.

kjiu
12th February 2009, 12:27
ok I have SimpleChat.pro like this :


################################################## ####################
# Automatically generated by qmake (2.01a) ?r. lut 11 18:36:37 2009
################################################## ####################

QT += network
TEMPLATE = app
TARGET =
DEPENDPATH += . SimpleChatClient SimpleChatServer
INCLUDEPATH += . SimpleChatClient SimpleChatServer

# Input
HEADERS += SimpleChatClient/simplechatclient.h \
SimpleChatServer/simplechatserver.h
SOURCES += SimpleChatClient/main.cpp \
SimpleChatClient/simplechatclient.cpp \
SimpleChatServer/main.cpp \
SimpleChatServer/simplechatserver.cpp

and there I one problem :

main.o: In function `main':
main.cpp:(.text+0x0): multiple definition of `main'
main.o:main.cpp:(.text+0x0): first defined here
collect2: ld returned 1 exit status

talk2amulya
12th February 2009, 12:35
you have two main functions..which is a crime in c and c++ both :)


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

kjiu
12th February 2009, 12:40
but in the pack there is 2 main.cpp

talk2amulya
12th February 2009, 12:46
which means u should build them seperately..sort out which file belongs to which project and build seperately

spirit
12th February 2009, 12:47
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.

jpn
12th February 2009, 13:58
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".

kjiu
12th February 2009, 14:05
thanks it work !

kjiu
12th February 2009, 14:08
and were is server I must put me ip ?

jpn
12th February 2009, 19:22
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.