QInputBox Class Reference

[main.h Index] [main.h Hierarchy] [Headers]


#include <qinputbox.h>

Inherits: QDialog

Public Members

QInputBox attempts to mimic the InputBox function in Delphi/C++ Builder. While doing development of SambaLink/Q, I needed a simple way to grab a line of input from a user. Qt does not have this generic functionality. QInputBox consists of a fixed border QDialog with a QLineEdit, and two QPushButtons (OK, Cancel). The window is automatically centered. A simple example:

QString name;

QInputBox("Name Entry", "What is your name?", name);

If you have specified a value for name it will be displayed in the QLineEdit. Otherwise it is blank.

QInputBox :: QInputBox (QString caption, QString prompt, QString &defString)

Constructor. If the user clicks OK, defString is modified with the value in the QLineEdit and the value is given back in defString. If the user hits Cancel, defString remains whatever it was when it was passed in.Caption is the caption of the Window.Prompt is the prompt in the QLabel.

Public Slots

void QInputBox :: OKClicked ()

The user has clicked on the OK push button.

Documentation generated by root@rustycage.newdamage.com on Tue Jun 13 23:08:33 EDT 2000
Kdoc