diff options
Diffstat (limited to 'src/gui/doc')
-rw-r--r-- | src/gui/doc/snippets/code/src_gui_util_qvalidator.cpp | 43 | ||||
-rw-r--r-- | src/gui/doc/snippets/textdocument-tables/mainwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/doc/snippets/textdocument-texttable/main.cpp | 2 | ||||
-rw-r--r-- | src/gui/doc/src/external-resources.qdoc | 5 | ||||
-rw-r--r-- | src/gui/doc/src/paintsystem.qdoc | 10 | ||||
-rw-r--r-- | src/gui/doc/src/qtgui.qdoc | 2 |
6 files changed, 56 insertions, 8 deletions
diff --git a/src/gui/doc/snippets/code/src_gui_util_qvalidator.cpp b/src/gui/doc/snippets/code/src_gui_util_qvalidator.cpp index fbf58a8c09..f9a4ee4ad1 100644 --- a/src/gui/doc/snippets/code/src_gui_util_qvalidator.cpp +++ b/src/gui/doc/snippets/code/src_gui_util_qvalidator.cpp @@ -133,3 +133,46 @@ s = "README.1ST"; v.validate(s, pos); // Returns Acceptable s = "read me.txt"; v.validate(s, pos); // Returns Invalid s = "readm"; v.validate(s, pos); // Returns Intermediate //! [4] + +//! [5] +// regexp: optional '-' followed by between 1 and 3 digits +QRegularExpression rx("-?\\d{1,3}"); +QValidator *validator = new QRegularExpressionValidator(rx, this); + +QLineEdit *edit = new QLineEdit(this); +edit->setValidator(validator); +//! [5] + +//! [6] +// integers 1 to 9999 +QRegularExpression re("[1-9]\\d{0,3}"); +// the validator treats the regexp as "^[1-9]\\d{0,3}$" +QRegularExpressionValidator v(re, 0); +QString s; +int pos = 0; + +s = "0"; v.validate(s, pos); // returns Invalid +s = "12345"; v.validate(s, pos); // returns Invalid +s = "1"; v.validate(s, pos); // returns Acceptable + +re.setPattern("\\S+"); // one or more non-whitespace characters +v.setRegularExpression(re); +s = "myfile.txt"; v.validate(s, pos); // Returns Acceptable +s = "my file.txt"; v.validate(s, pos); // Returns Invalid + +// A, B or C followed by exactly five digits followed by W, X, Y or Z +re.setPattern("[A-C]\\d{5}[W-Z]"); +v.setRegularExpression(re); +s = "a12345Z"; v.validate(s, pos); // Returns Invalid +s = "A12345Z"; v.validate(s, pos); // Returns Acceptable +s = "B12"; v.validate(s, pos); // Returns Intermediate + +// match most 'readme' files +re.setPattern("read\\S?me(\.(txt|asc|1st))?"); +re.setPatternOptions(QRegularExpression::CaseInsensitiveOption); +v.setRegularExpression(re); +s = "readme"; v.validate(s, pos); // Returns Acceptable +s = "README.1ST"; v.validate(s, pos); // Returns Acceptable +s = "read me.txt"; v.validate(s, pos); // Returns Invalid +s = "readm"; v.validate(s, pos); // Returns Intermediate +//! [6] diff --git a/src/gui/doc/snippets/textdocument-tables/mainwindow.cpp b/src/gui/doc/snippets/textdocument-tables/mainwindow.cpp index 443f5407e0..1169254253 100644 --- a/src/gui/doc/snippets/textdocument-tables/mainwindow.cpp +++ b/src/gui/doc/snippets/textdocument-tables/mainwindow.cpp @@ -87,7 +87,7 @@ MainWindow::MainWindow() int row; QTextTableCell cell; QTextCursor cellCursor; - + QTextCharFormat charFormat; charFormat.setForeground(Qt::black); diff --git a/src/gui/doc/snippets/textdocument-texttable/main.cpp b/src/gui/doc/snippets/textdocument-texttable/main.cpp index 0024d8592b..f82b5235cf 100644 --- a/src/gui/doc/snippets/textdocument-texttable/main.cpp +++ b/src/gui/doc/snippets/textdocument-texttable/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char * argv[]) tableFormat.setCellSpacing(2); QTextTable *table = cursor.insertTable(rows, columns); table->setFormat(tableFormat); - + QTextCharFormat boldFormat; boldFormat.setFontWeight(QFont::Bold); diff --git a/src/gui/doc/src/external-resources.qdoc b/src/gui/doc/src/external-resources.qdoc index 858dd76bbf..0e955b11f6 100644 --- a/src/gui/doc/src/external-resources.qdoc +++ b/src/gui/doc/src/external-resources.qdoc @@ -45,3 +45,8 @@ \externalpage http://www.xfree86.org/4.3.0/Xcursor.3.html \title Xcursor */ + +/*! + \externalpage http://www.opengl.org/wiki/Tessellation_Shader + \title OpenGL Tessellation Shaders +*/
\ No newline at end of file diff --git a/src/gui/doc/src/paintsystem.qdoc b/src/gui/doc/src/paintsystem.qdoc index 7857a160ac..cd208e9e18 100644 --- a/src/gui/doc/src/paintsystem.qdoc +++ b/src/gui/doc/src/paintsystem.qdoc @@ -50,7 +50,7 @@ \ingroup qt-graphics \ingroup frameworks-technologies \ingroup qt-basic-concepts - + Qt's paint system enables painting on screen and print devices using the same API, and is primarily based on the QPainter, @@ -70,7 +70,7 @@ same painting pipeline making it easy to add support for new features and providing default implementations for unsupported ones. - + \section1 Topics \list \li \l{Classes for Painting} @@ -126,7 +126,7 @@ in a platform-independent way. Another benefit is that the painting can be performed in another thread than the current GUI thread. - + \row \li \b Pixmap The QPixmap class is an off-screen image representation which is @@ -175,7 +175,7 @@ actually be able to draw on the device, this paint engine must be a custom paint engine created by deriving from the QPaintEngine class. - + \endtable */ @@ -183,7 +183,7 @@ /*! \page paintsystem-drawing.html \title Drawing and Filling - + \previouspage Paint Devices and Backends \contentspage The Paint System \nextpage Coordinate System diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc index aa44dcfad5..201bb03a14 100644 --- a/src/gui/doc/src/qtgui.qdoc +++ b/src/gui/doc/src/qtgui.qdoc @@ -62,7 +62,7 @@ For application developers writing user interfaces, Qt provides higher level API's, like Qt Quick, that are much more suitable - than the enablers found in the Qt GUI module. + than the enablers found in the Qt GUI module. \section1 Getting started |