First turn your wireless network's security setting to WPA. If you face later problems when connecting, you can temporarily turn it to WEP or off to make sure it's not encryption settings that cause the trouble, but for now don't use unencrypted wireless network.
I'm not sure if KDE 4.0 (yup, the folks at KDE are strict that it's not called "KDE4" but 4.0 as of now, and 4.1 when it's ready) comes with any wireless configuration utilies yet; it's fairly new and lacks a lot of software. KDE 3.x has that a lot better. In fact they don't recommend you to use KDE 4.0 for anything but testing purposes for now, because it shortly put isn't usable yet. Therefore if you have problems connecting to wireless networks trough command line interface, it might be better if you sticked to KDE 3.x until they get the new series actually working.
To form a wireless connection,
- make sure you have driver (a kernel module) for your card/chipset and that it is loaded
- make sure you know what encryption method is being used, what passphrase you need and what is your network's SSID
- use the program of your choice to form the connection to an access point
- once the connection works, make it permanent if you like; set up the system so that it's easier to form the connection later (make a script, for example)
To connect wirelessly to WPA-encrypted (or WEP or non-encrypted or wireless, if you like, but WPA-encrypted in this case) networks using command line you'll typically use wpa_supplicant if you don't have any handy "front-ends" to do it. Usage is simple: make a configuration file, for example /etc/wpa_supplicant.conf, then run wpa_supplicant (as a daemon so it runs in the background) and run dhcp client to get IP address and DNS information. You can use wpa_passphrase to create a basic network entry for the configuration file; if the file exists, it is probably half ready for you. In any case, read the relevant man page which describes exactly how you configure it.
After the configuration file is fine, you'll do something like this to run wpa_supplicant:
sudo wpa_supplicant -D wext -i wlan0 -c /etc/wpa_supplicant.conf -B
Though I suggest that you stick to KDE 3.5 (if you like KDE) because it's more usable as a desktop environment than KDE 4.0 as of now; for example it offers you a rather good-looking graphical application where you only need a few clicks to form a wireless internet connection.