150 likes | 258 Views
L9: Qt Implementation. QTextEdit QButton QMainWindow Signal and Slot. QTextEdit. QTextEdit + QButton. QTextEdit + QButton. QMainWindow: Header. QmainWindow: Constructor. QmainWindow: Save Slot. QmainWindow: Open Slot. QmainWindow:Main. API Reference: QIODevice.
E N D
L9: Qt Implementation • QTextEdit • QButton • QMainWindow • Signal and Slot
API Reference: QIODevice • The QIODevice class is the base interface class of all I/O devices in Qt. • Mostly used IO Mode Flags are listed below. • QIODevice::NotOpen : The device is not open. • QIODevice::ReadOnly: The device is open for reading. • QIODevice::WriteOnly: The device is open for writing. • QIODevice::ReadWrite: The device is open for reading and writing. • QIODevice::Append: The device is opened in append mode, so that all data is written to the end of the file.
API Reference: QFileDialog::getSaveFileName • QString QFileDialog::getSaveFileName( • QWidget * parent = 0, • const QString & caption = QString(), • const QString & dir = QString(), • const QString & filter = QString(), • QString * selectedFilter = 0, • Options options = 0 )
API Reference: QFileDialog::getSaveFileName • Caption: The dialog's caption is set to caption. If caption is not specified, a default caption will be used. • Dir: The file dialog's working directory will be set to dir. If dir includes a file name, the file will be selected. • Filter: Only files that match the filter are shown. Multiple filters are separated with ';;'. For instance:"Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" • SelectedFilter: The filter selected is set to selectedFilter. • Option: The options argument holds various options about how to run the dialog. • For instance, QFileDialog::ShowDirsOnly: Only show directories in the file dialog. By default both files and directories are shown. (Valid only in the Directory file mode.) • QFileDialog::DontResolveSymlinks: Don't resolve symlinks in the file dialog. By default symlinks are resolved.
API Reference: QFileDialog::getOpenFileName • QStringList QfileDialog::getOpenFileName( • QWidget * parent = 0, • const QString & caption = QString(), • const QString & dir = QString(), • const QString & filter = QString(), • QString * selectedFilter = 0, • Options options = 0 )
References • Qt.Nokia (2011). Qt Reference Documentation: Getting Started. Available from: http://doc.qt.nokia.com/4.7/gettingstartedqt.html [Accessed: 22 January 2011]