From 97b5b8009254004608feefb903cbf44abaa099f6 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Mon, 7 May 2012 18:49:48 +0200 Subject: Doc: Modularize QtWidgets documentation. This change moves the snippets and images to the modularized directories. Change-Id: Idec1afb9db7ea6add1ca4cf25ec4019d8bce0c4d Reviewed-by: Marius Storm-Olsen --- src/widgets/widgets/qabstractbutton.cpp | 6 +++--- src/widgets/widgets/qabstractscrollarea.cpp | 4 ++-- src/widgets/widgets/qabstractspinbox.cpp | 4 ++-- src/widgets/widgets/qcalendarwidget.cpp | 12 ++++++------ src/widgets/widgets/qcheckbox.cpp | 2 +- src/widgets/widgets/qdatetimeedit.cpp | 14 +++++++------- src/widgets/widgets/qdialogbuttonbox.cpp | 8 +++++--- src/widgets/widgets/qdockwidget.cpp | 2 +- src/widgets/widgets/qframe.cpp | 2 +- src/widgets/widgets/qgroupbox.cpp | 4 ++-- src/widgets/widgets/qlabel.cpp | 6 +++--- src/widgets/widgets/qlineedit.cpp | 2 +- src/widgets/widgets/qmaccocoaviewcontainer_mac.mm | 2 +- src/widgets/widgets/qmacnativewidget_mac.mm | 4 ++-- src/widgets/widgets/qmainwindow.cpp | 12 ++++++------ src/widgets/widgets/qmdiarea.cpp | 4 ++-- src/widgets/widgets/qmenu.cpp | 14 +++++++------- src/widgets/widgets/qmenubar.cpp | 12 ++++++------ src/widgets/widgets/qplaintextedit.cpp | 8 ++++---- src/widgets/widgets/qpushbutton.cpp | 2 +- src/widgets/widgets/qradiobutton.cpp | 2 +- src/widgets/widgets/qrubberband.cpp | 2 +- src/widgets/widgets/qscrollarea.cpp | 2 +- src/widgets/widgets/qspinbox.cpp | 20 ++++++++++---------- src/widgets/widgets/qsplashscreen.cpp | 6 +++--- src/widgets/widgets/qsplitter.cpp | 14 +++++++------- src/widgets/widgets/qstackedwidget.cpp | 8 ++++---- src/widgets/widgets/qstatusbar.cpp | 6 +++--- src/widgets/widgets/qtextbrowser.cpp | 2 +- src/widgets/widgets/qtextedit.cpp | 14 +++++++------- 30 files changed, 101 insertions(+), 99 deletions(-) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 4e85eae3ff..0c22576f7f 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -86,7 +86,7 @@ Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets; ampersand ('&'), QAbstractButton automatically creates a shortcut key. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp 0 + \snippet code/src_gui_widgets_qabstractbutton.cpp 0 The \key Alt+C shortcut is assigned to the button, i.e., when the user presses \key Alt+C the button will call animateClick(). See @@ -97,7 +97,7 @@ Q_WIDGETS_EXPORT extern bool qt_tab_all_widgets; function. This is useful mostly for buttons that do not have any text, because they have no automatic shortcut. - \snippet doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp 1 + \snippet code/src_gui_widgets_qabstractbutton.cpp 1 All of the buttons provided by Qt (QPushButton, QToolButton, QCheckBox, and QRadioButton) can display both \l text and \l{icon}{icons}. @@ -1361,7 +1361,7 @@ For example, a slot that reacts to signals emitted by newly checked buttons but which ignores signals from buttons that have been unchecked can be implemented using the following pattern: -\snippet doc/src/snippets/code/src_gui_widgets_qabstractbutton.cpp 2 +\snippet code/src_gui_widgets_qabstractbutton.cpp 2 Button groups can be created using the QButtonGroup class, and updates to the button states monitored with the diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index dc96321599..d97b03128e 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -130,13 +130,13 @@ QT_BEGIN_NAMESPACE QWidget::move(). When the area contents or the viewport size changes, we do the following: - \snippet doc/src/snippets/myscrollarea.cpp 1 + \snippet myscrollarea.cpp 1 When the scroll bars change value, we need to update the widget position, i.e., find the part of the widget that is to be drawn in the viewport: - \snippet doc/src/snippets/myscrollarea.cpp 0 + \snippet myscrollarea.cpp 0 In order to track scroll bar movements, reimplement the virtual function scrollContentsBy(). In order to fine-tune scrolling diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp index 6c556dc870..4d55c9f0af 100644 --- a/src/widgets/widgets/qabstractspinbox.cpp +++ b/src/widgets/widgets/qabstractspinbox.cpp @@ -230,7 +230,7 @@ QString QAbstractSpinBox::text() const to automatically choose one that will enable the image to fit completely within the display window, you can set up the spin box like this: - \snippet examples/widgets/spinboxes/window.cpp 3 + \snippet widgets/spinboxes/window.cpp 3 The user will then be able to choose a scale from 1% to 1000% or select "Auto" to leave it up to the application to choose. Your code @@ -275,7 +275,7 @@ void QAbstractSpinBox::setSpecialValueText(const QString &specialValueText) to the minimum() value and vica versa. Wrapping only make sense if you have minimum() and maximum() values set. - \snippet doc/src/snippets/code/src_gui_widgets_qabstractspinbox.cpp 0 + \snippet code/src_gui_widgets_qabstractspinbox.cpp 0 \sa QSpinBox::minimum(), QSpinBox::maximum() */ diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index 427af68b64..acd07d2a5b 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -2004,7 +2004,7 @@ void QCalendarWidgetPrivate::_q_editingFinished() \row \li \image qcalendarwidget-grid.png \row \li - \snippet doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp 0 + \snippet code/src_gui_widgets_qcalendarwidget.cpp 0 \endtable Finally, the day in the first column can be altered using the @@ -2421,7 +2421,7 @@ void QCalendarWidget::showToday() \li \image qcalendarwidget-minimum.png \row \li - \snippet doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp 1 + \snippet code/src_gui_widgets_qcalendarwidget.cpp 1 \endtable By default, the minimum date is the earliest date that the QDate @@ -2472,7 +2472,7 @@ void QCalendarWidget::setMinimumDate(const QDate &date) \li \image qcalendarwidget-maximum.png \row \li - \snippet doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp 2 + \snippet code/src_gui_widgets_qcalendarwidget.cpp 2 \endtable By default, the maximum date is the last day the QDate class can @@ -2518,11 +2518,11 @@ void QCalendarWidget::setMaximumDate(const QDate &date) The date range restricts the user selection, i.e. the user can only select dates within the specified date range. Note that - \snippet doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp 3 + \snippet code/src_gui_widgets_qcalendarwidget.cpp 3 is analogous to - \snippet doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp 4 + \snippet code/src_gui_widgets_qcalendarwidget.cpp 4 If either the \a min or \a max parameters are not valid QDate objects, this function does nothing. @@ -2641,7 +2641,7 @@ void QCalendarWidget::setVerticalHeaderFormat(QCalendarWidget::VerticalHeaderFor \li \inlineimage qcalendarwidget-grid.png \row \li - \snippet doc/src/snippets/code/src_gui_widgets_qcalendarwidget.cpp 5 + \snippet code/src_gui_widgets_qcalendarwidget.cpp 5 \endtable The default value is false. diff --git a/src/widgets/widgets/qcheckbox.cpp b/src/widgets/widgets/qcheckbox.cpp index 13440ac104..a0093800a5 100644 --- a/src/widgets/widgets/qcheckbox.cpp +++ b/src/widgets/widgets/qcheckbox.cpp @@ -107,7 +107,7 @@ public: constructor or with setText(). A shortcut key can be specified by preceding the preferred character with an ampersand. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qcheckbox.cpp 0 + \snippet code/src_gui_widgets_qcheckbox.cpp 0 In this example the shortcut is \e{Alt+A}. See the \l{QShortcut#mnemonic} {QShortcut} documentation for details (to display an actual ampersand, diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 0cdb2d1176..4c418bde9e 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE QDateTimeEdit box. Dates and times appear in accordance with the format set; see setDisplayFormat(). - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 0 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 0 Here we've created a new QDateTimeEdit object initialized with today's date, and restricted the valid date range to today plus or @@ -397,11 +397,11 @@ void QDateTimeEdit::setMaximumDateTime(const QDateTime &dt) function call. \since 4.4 - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 1 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 1 is analogous to: - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 2 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 2 If either \a min or \a max are not valid, this function does nothing. @@ -560,11 +560,11 @@ void QDateTimeEdit::clearMaximumTime() Convenience function to set minimum and maximum date with one function call. - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 3 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 3 is analogous to: - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 4 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 4 If either \a min or \a max are not valid, this function does nothing. @@ -587,11 +587,11 @@ void QDateTimeEdit::setDateRange(const QDate &min, const QDate &max) Convenience function to set minimum and maximum time with one function call. - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 5 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 5 is analogous to: - \snippet doc/src/snippets/code/src_gui_widgets_qdatetimeedit.cpp 6 + \snippet code/src_gui_widgets_qdatetimeedit.cpp 6 If either \a min or \a max are not valid, this function does nothing. diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index b787522a50..bcf0753d33 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -86,19 +86,19 @@ QT_BEGIN_NAMESPACE destructive results. Most dialogs have buttons that can almost be considered standard (e.g. - \gui OK and \gui Cancel buttons). It is sometimes convenient to create these + \uicontrol OK and \uicontrol Cancel buttons). It is sometimes convenient to create these buttons in a standard way. There are a couple ways of using QDialogButtonBox. One ways is to create the buttons (or button texts) yourself and add them to the button box, specifying their role. - \snippet examples/dialogs/extension/finddialog.cpp 1 + \snippet dialogs/extension/finddialog.cpp 1 Alternatively, QDialogButtonBox provides several standard buttons (e.g. OK, Cancel, Save) that you can use. They exist as flags so you can OR them together in the constructor. - \snippet examples/dialogs/tabdialog/tabdialog.cpp 2 + \snippet dialogs/tabdialog/tabdialog.cpp 2 You can mix and match normal buttons and standard buttons. @@ -133,6 +133,8 @@ QT_BEGIN_NAMESPACE \table \row \li modeless horizontal MacLayout \li \inlineimage buttonbox-mac-modeless-horizontal.png Screenshot of modeless horizontal MacLayout + \row \li modeless vertical MacLayout + \li \inlineimage buttonbox-mac-modeless-vertical.png Screenshot of modeless vertical MacLayout \endtable When a button is clicked in the button box, the clicked() signal is emitted diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index e40b109455..db45bf4e46 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1547,7 +1547,7 @@ QAction * QDockWidget::toggleViewAction() const \li When DockWidgetVerticalTitleBar is set on QDockWidget, the title bar widget is repositioned accordingly. In resizeEvent(), the title bar should check what orientation it should assume: - \snippet doc/src/snippets/code/src_gui_widgets_qdockwidget.cpp 0 + \snippet code/src_gui_widgets_qdockwidget.cpp 0 \li The title bar widget must have a valid QWidget::sizeHint() and QWidget::minimumSizeHint(). These functions should take into account diff --git a/src/widgets/widgets/qframe.cpp b/src/widgets/widgets/qframe.cpp index b69f65828b..d11ff09a30 100644 --- a/src/widgets/widgets/qframe.cpp +++ b/src/widgets/widgets/qframe.cpp @@ -79,7 +79,7 @@ inline void QFramePrivate::init() screen. QProgressBar has a "sunken" look. QLabel has a flat look. The frames of widgets like these can be changed. - \snippet doc/src/snippets/code/src_gui_widgets_qframe.cpp 0 + \snippet code/src_gui_widgets_qframe.cpp 0 The QFrame class can also be used directly for creating simple placeholder frames without any contents. diff --git a/src/widgets/widgets/qgroupbox.cpp b/src/widgets/widgets/qgroupbox.cpp index d8ad04cd84..343fc85bc9 100644 --- a/src/widgets/widgets/qgroupbox.cpp +++ b/src/widgets/widgets/qgroupbox.cpp @@ -169,7 +169,7 @@ void QGroupBoxPrivate::click() widgets). The following example shows how we can set up a QGroupBox with a layout: - \snippet examples/widgets/groupbox/window.cpp 2 + \snippet widgets/groupbox/window.cpp 2 \table 100% \row \li \inlineimage windowsxp-groupbox.png Screenshot of a Windows XP style group box @@ -261,7 +261,7 @@ void QGroupBox::setTitle(const QString &title) The group box title text will have a keyboard shortcut if the title contains an ampersand ('&') followed by a letter. - \snippet doc/src/snippets/code/src_gui_widgets_qgroupbox.cpp 0 + \snippet code/src_gui_widgets_qgroupbox.cpp 0 In the example above, \key Alt+U moves the keyboard focus to the group box. See the \l {QShortcut#mnemonic}{QShortcut} diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp index 4450066df4..99deca4709 100644 --- a/src/widgets/widgets/qlabel.cpp +++ b/src/widgets/widgets/qlabel.cpp @@ -115,7 +115,7 @@ QT_BEGIN_NAMESPACE the bottom right corner (both lines being flush with the right side of the label): - \snippet doc/src/snippets/code/src_gui_widgets_qlabel.cpp 0 + \snippet code/src_gui_widgets_qlabel.cpp 0 The properties and functions QLabel inherits from QFrame can also be used to specify the widget frame to be used for any given label. @@ -125,7 +125,7 @@ QT_BEGIN_NAMESPACE mnemonic (see QKeySequence) that will set the keyboard focus to the other widget (called the QLabel's "buddy"). For example: - \snippet doc/src/snippets/code/src_gui_widgets_qlabel.cpp 1 + \snippet code/src_gui_widgets_qlabel.cpp 1 In this example, keyboard focus is transferred to the label's buddy (the QLineEdit) when the user presses Alt+P. If the buddy @@ -1150,7 +1150,7 @@ void QLabelPrivate::updateLabel() In a dialog, you might create two data entry widgets and a label for each, and set up the geometry layout so each label is just to the left of its data entry widget (its "buddy"), for example: - \snippet doc/src/snippets/code/src_gui_widgets_qlabel.cpp 2 + \snippet code/src_gui_widgets_qlabel.cpp 2 With the code above, the focus jumps to the Name field when the user presses Alt+N, and to the Phone field when the user presses diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 1ea636ffb2..bbf34b9853 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -1980,7 +1980,7 @@ void QLineEdit::dropEvent(QDropEvent* e) to extend the standard context menu, reimplement this function, call createStandardContextMenu() and extend the menu returned. - \snippet doc/src/snippets/code/src_gui_widgets_qlineedit.cpp 0 + \snippet code/src_gui_widgets_qlineedit.cpp 0 The \a event parameter is used to obtain the position where the mouse cursor was when the event was generated. diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm index 1c8e6ba0e8..3aff6ee5d9 100644 --- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm +++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm @@ -85,7 +85,7 @@ developer to provide the autorelease pool. The following is a snippet of subclassing QMacCocoaViewContainer to wrap a NSSearchField. - \snippet examples/mainwindows/macmainwindow/macmainwindow.mm 0 + \snippet mainwindows/macmainwindow/macmainwindow.mm 0 */ diff --git a/src/widgets/widgets/qmacnativewidget_mac.mm b/src/widgets/widgets/qmacnativewidget_mac.mm index 7974e93d88..e608b4a756 100644 --- a/src/widgets/widgets/qmacnativewidget_mac.mm +++ b/src/widgets/widgets/qmacnativewidget_mac.mm @@ -70,11 +70,11 @@ Here is an example of putting a QPushButton into a NSWindow: - \snippet doc/src/snippets/qmacnativewidget/main.mm 0 + \snippet qmacnativewidget/main.mm 0 On Carbon, this would do the equivalent: - \snippet doc/src/snippets/qmacnativewidget/main.mm 1 + \snippet qmacnativewidget/main.mm 1 Note that QMacNativeWidget requires knowledge of Carbon or Cocoa. All it does is get the Qt hierarchy into a window not owned by Qt. It is then up diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 7607f2f238..efd5db07ab 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -261,7 +261,7 @@ void QMainWindowPrivate::init() An example of how to create menus follows: - \snippet examples/mainwindows/application/mainwindow.cpp 26 + \snippet mainwindows/application/mainwindow.cpp 26 The \c createPopupMenu() function creates popup menus when the main window receives context menu events. The default @@ -288,7 +288,7 @@ void QMainWindowPrivate::init() An example of toolbar creation follows: - \snippet examples/mainwindows/application/mainwindow.cpp 29 + \snippet mainwindows/application/mainwindow.cpp 29 \section2 Creating Dock Widgets @@ -312,7 +312,7 @@ void QMainWindowPrivate::init() We give an example of how to create and add dock widgets to a main window: - \snippet doc/src/snippets/mainwindowsnippet.cpp 0 + \snippet mainwindowsnippet.cpp 0 \section2 The Status Bar @@ -485,7 +485,7 @@ void QMainWindow::setToolButtonStyle(Qt::ToolButtonStyle toolButtonStyle) can then share among all the Mac windows. Create a parent-less menu bar this way: - \snippet doc/src/snippets/code/src_gui_widgets_qmenubar.cpp 1 + \snippet code/src_gui_widgets_qmenubar.cpp 1 \sa setMenuBar() */ @@ -1213,7 +1213,7 @@ Qt::DockWidgetArea QMainWindow::dockWidgetArea(QDockWidget *dockwidget) const To save the geometry when the window closes, you can implement a close event like this: - \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 0 + \snippet code/src_gui_widgets_qmainwindow.cpp 0 \sa restoreState(), QWidget::saveGeometry(), QWidget::restoreGeometry() */ @@ -1237,7 +1237,7 @@ QByteArray QMainWindow::saveState(int version) const To restore geometry saved using QSettings, you can use code like this: - \snippet doc/src/snippets/code/src_gui_widgets_qmainwindow.cpp 1 + \snippet code/src_gui_widgets_qmainwindow.cpp 1 \sa saveState(), QWidget::saveGeometry(), QWidget::restoreGeometry(), restoreDockWidget() diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index eb483ac0fe..b859fc437e 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -53,7 +53,7 @@ applications, but can also be placed in any layout. The following code adds an area to a main window: - \snippet doc/src/snippets/mdiareasnippets.cpp 0 + \snippet mdiareasnippets.cpp 0 Unlike the window managers for top-level windows, all window flags (Qt::WindowFlags) are supported by QMdiArea as long as the flags @@ -1929,7 +1929,7 @@ void QMdiArea::activatePreviousSubWindow() \note Once the subwindow has been added, its parent will be the \e{viewport widget} of the QMdiArea. - \snippet doc/src/snippets/mdiareasnippets.cpp 1 + \snippet mdiareasnippets.cpp 1 When you create your own subwindow, you must set the Qt::WA_DeleteOnClose widget attribute if you want the window to be diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 2abd4ceef7..fccb062e07 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1990,11 +1990,11 @@ void QMenu::popup(const QPoint &p, QAction *atAction) In most situations you'll want to specify the position yourself, for example, the current mouse position: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 0 + \snippet code/src_gui_widgets_qmenu.cpp 0 or aligned to a widget: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 1 + \snippet code/src_gui_widgets_qmenu.cpp 1 or in reaction to a QMouseEvent *e: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 2 + \snippet code/src_gui_widgets_qmenu.cpp 2 */ QAction *QMenu::exec() { @@ -2022,11 +2022,11 @@ QAction *QMenu::exec() Common usage is to position the menu at the current mouse position: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 3 + \snippet code/src_gui_widgets_qmenu.cpp 3 or aligned to a widget: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 4 + \snippet code/src_gui_widgets_qmenu.cpp 4 or in reaction to a QMouseEvent *e: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 5 + \snippet code/src_gui_widgets_qmenu.cpp 5 When positioning a menu with exec() or popup(), bear in mind that you cannot rely on the menu's current size(). For performance @@ -2074,7 +2074,7 @@ QAction *QMenu::exec(const QPoint &p, QAction *action) (normally because the user pressed Esc). This is equivalent to: - \snippet doc/src/snippets/code/src_gui_widgets_qmenu.cpp 6 + \snippet code/src_gui_widgets_qmenu.cpp 6 \sa popup(), QWidget::mapToGlobal() */ diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index c9818e056c..104424cabf 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -586,7 +586,7 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti menu items with addMenu(). For example, asuming that \c menubar is a pointer to a QMenuBar and \c fileMenu is a pointer to a QMenu, the following statement inserts the menu into the menu bar: - \snippet doc/src/snippets/code/src_gui_widgets_qmenubar.cpp 0 + \snippet code/src_gui_widgets_qmenubar.cpp 0 The ampersand in the menu item's text sets Alt+F as a shortcut for this menu. (You can use "\&\&" to get a real ampersand in the menu @@ -605,7 +605,7 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti Example (from the \l{mainwindows/menus}{Menus} example): - \snippet examples/mainwindows/menus/mainwindow.cpp 9 + \snippet mainwindows/menus/mainwindow.cpp 9 Menu items may be removed with removeAction(). @@ -619,7 +619,7 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti of menu bars and their behavior when the user interacts with them. For example, Windows systems are often configured so that the underlined character mnemonics that indicate keyboard shortcuts - for items in the menu bar are only shown when the \gui{Alt} key is + for items in the menu bar are only shown when the \uicontrol{Alt} key is pressed. \table @@ -628,13 +628,13 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti Plastique widget style. \li The \l{QPlastiqueStyle}{Plastique widget style}, like most - other styles, handles the \gui{Help} menu in the same way as it + other styles, handles the \uicontrol{Help} menu in the same way as it handles any other menu. \row \li \inlineimage motif-menubar.png A menu bar shown in the Motif widget style. - \li The \l{QMotifStyle}{Motif widget style} treats \gui{Help} menus + \li The \l{QMotifStyle}{Motif widget style} treats \uicontrol{Help} menus in a special way, placing them at right-hand end of the menu bar. \endtable @@ -677,7 +677,7 @@ void QMenuBar::initStyleOption(QStyleOptionMenuItem *option, const QAction *acti bar, you must create a menu bar that does not have a parent. Create a parent-less menu bar this way: - \snippet doc/src/snippets/code/src_gui_widgets_qmenubar.cpp 1 + \snippet code/src_gui_widgets_qmenubar.cpp 1 \b{Note:} Do \e{not} call QMainWindow::menuBar() to create the shared menu bar, because that menu bar will have the QMainWindow diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp index fad2d4e747..dad0a6b7b6 100644 --- a/src/widgets/widgets/qplaintextedit.cpp +++ b/src/widgets/widgets/qplaintextedit.cpp @@ -2039,7 +2039,7 @@ bool QPlainTextEdit::focusNextPrevChild(bool next) Information about the event is passed in the \a event object. - \snippet doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp 0 + \snippet code/src_gui_widgets_qplaintextedit.cpp 0 */ void QPlainTextEdit::contextMenuEvent(QContextMenuEvent *e) { @@ -2479,7 +2479,7 @@ QTextCharFormat QPlainTextEdit::currentCharFormat() const It is equivalent to - \snippet doc/src/snippets/code/src_gui_widgets_qplaintextedit.cpp 1 + \snippet code/src_gui_widgets_qplaintextedit.cpp 1 */ void QPlainTextEdit::insertPlainText(const QString &text) { @@ -2528,10 +2528,10 @@ void QPlainTextEdit::print(QPagedPaintDevice *printer) const #endif /*! \property QPlainTextEdit::tabChangesFocus - \brief whether \gui Tab changes focus or is accepted as input + \brief whether \uicontrol Tab changes focus or is accepted as input In some occasions text edits should not allow the user to input - tabulators or change indentation using the \gui Tab key, as this breaks + tabulators or change indentation using the \uicontrol Tab key, as this breaks the focus chain. The default is false. */ diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp index 291e3548a2..9853924182 100644 --- a/src/widgets/widgets/qpushbutton.cpp +++ b/src/widgets/widgets/qpushbutton.cpp @@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE preceding the preferred character with an ampersand in the text. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qpushbutton.cpp 0 + \snippet code/src_gui_widgets_qpushbutton.cpp 0 In this example the shortcut is \e{Alt+D}. See the \l {QShortcut#mnemonic}{QShortcut} documentation for details (to diff --git a/src/widgets/widgets/qradiobutton.cpp b/src/widgets/widgets/qradiobutton.cpp index 11cd89bca2..15dbdd4284 100644 --- a/src/widgets/widgets/qradiobutton.cpp +++ b/src/widgets/widgets/qradiobutton.cpp @@ -105,7 +105,7 @@ void QRadioButtonPrivate::init() can be specified by preceding the preferred character with an ampersand in the text. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qradiobutton.cpp 0 + \snippet code/src_gui_widgets_qradiobutton.cpp 0 In this example the shortcut is \e{Alt+c}. See the \l {QShortcut#mnemonic}{QShortcut} documentation for details (to diff --git a/src/widgets/widgets/qrubberband.cpp b/src/widgets/widgets/qrubberband.cpp index 0f95f0188a..8173ffe657 100644 --- a/src/widgets/widgets/qrubberband.cpp +++ b/src/widgets/widgets/qrubberband.cpp @@ -112,7 +112,7 @@ void QRubberBand::initStyleOption(QStyleOptionRubberBand *option) const setGeometry(), move() or resize() to position and size it. A common pattern is to do this in conjunction with mouse events. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qrubberband.cpp 0 + \snippet code/src_gui_widgets_qrubberband.cpp 0 If you pass a parent to QRubberBand's constructor, the rubber band will display only inside its parent, but stays on top of other child widgets. diff --git a/src/widgets/widgets/qscrollarea.cpp b/src/widgets/widgets/qscrollarea.cpp index 84be2d569b..99b4151d8c 100644 --- a/src/widgets/widgets/qscrollarea.cpp +++ b/src/widgets/widgets/qscrollarea.cpp @@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE widget can be viewed. The child widget must be specified with setWidget(). For example: - \snippet doc/src/snippets/code/src_gui_widgets_qscrollarea.cpp 0 + \snippet code/src_gui_widgets_qscrollarea.cpp 0 The code above creates a scroll area (shown in the images below) containing an image label. When scaling the image, the scroll area diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp index 7dcaead2f4..cb88ca1b79 100644 --- a/src/widgets/widgets/qspinbox.cpp +++ b/src/widgets/widgets/qspinbox.cpp @@ -168,9 +168,9 @@ public: for a custom spin box that allows the user to enter icon sizes (e.g., "32 x 32"): - \snippet examples/widgets/icons/iconsizespinbox.cpp 1 + \snippet widgets/icons/iconsizespinbox.cpp 1 \codeline - \snippet examples/widgets/icons/iconsizespinbox.cpp 2 + \snippet widgets/icons/iconsizespinbox.cpp 2 See the \l{widgets/icons}{Icons} example for the full source code. @@ -238,7 +238,7 @@ void QSpinBox::setValue(int value) Typical use is to display a unit of measurement or a currency symbol. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 0 + \snippet code/src_gui_widgets_qspinbox.cpp 0 To turn off the prefix display, set this property to an empty string. The default is no prefix. The prefix is not displayed when @@ -274,7 +274,7 @@ void QSpinBox::setPrefix(const QString &prefix) use is to display a unit of measurement or a currency symbol. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 1 + \snippet code/src_gui_widgets_qspinbox.cpp 1 To turn off the suffix display, set this property to an empty string. The default is no suffix. The suffix is not displayed for @@ -405,9 +405,9 @@ void QSpinBox::setMaximum(int maximum) Convenience function to set the \a minimum, and \a maximum values with a single function call. - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 2 + \snippet code/src_gui_widgets_qspinbox.cpp 2 is equivalent to: - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 3 + \snippet code/src_gui_widgets_qspinbox.cpp 3 \sa minimum maximum */ @@ -610,7 +610,7 @@ void QDoubleSpinBox::setValue(double value) Typical use is to display a unit of measurement or a currency symbol. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 4 + \snippet code/src_gui_widgets_qspinbox.cpp 4 To turn off the prefix display, set this property to an empty string. The default is no prefix. The prefix is not displayed when @@ -644,7 +644,7 @@ void QDoubleSpinBox::setPrefix(const QString &prefix) use is to display a unit of measurement or a currency symbol. For example: - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 5 + \snippet code/src_gui_widgets_qspinbox.cpp 5 To turn off the suffix display, set this property to an empty string. The default is no suffix. The suffix is not displayed for @@ -784,9 +784,9 @@ void QDoubleSpinBox::setMaximum(double maximum) Note: The maximum and minimum values will be rounded to match the decimals property. - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 6 + \snippet code/src_gui_widgets_qspinbox.cpp 6 is equivalent to: - \snippet doc/src/snippets/code/src_gui_widgets_qspinbox.cpp 7 + \snippet code/src_gui_widgets_qspinbox.cpp 7 \sa minimum maximum */ diff --git a/src/widgets/widgets/qsplashscreen.cpp b/src/widgets/widgets/qsplashscreen.cpp index 5a7d6376ca..f3a19c88ec 100644 --- a/src/widgets/widgets/qsplashscreen.cpp +++ b/src/widgets/widgets/qsplashscreen.cpp @@ -94,9 +94,9 @@ public: some initialization tasks are performed before the application's main window is shown: - \snippet doc/src/snippets/qsplashscreen/main.cpp 0 + \snippet qsplashscreen/main.cpp 0 \dots - \snippet doc/src/snippets/qsplashscreen/main.cpp 1 + \snippet qsplashscreen/main.cpp 1 The user can hide the splash screen by clicking on it with the mouse. Since the splash screen is typically displayed before the @@ -107,7 +107,7 @@ public: for example, announcing connections established or modules loaded as the application starts up: - \snippet doc/src/snippets/code/src_gui_widgets_qsplashscreen.cpp 0 + \snippet code/src_gui_widgets_qsplashscreen.cpp 0 QSplashScreen supports this with the showMessage() function. If you wish to do your own drawing you can get a pointer to the pixmap diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 17e1c39cee..126f819541 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -84,12 +84,12 @@ QT_BEGIN_NAMESPACE reimplement QSplitter::createHandle() to instantiate the custom splitter handle. For example, a minimum QSplitter subclass might look like this: - \snippet doc/src/snippets/splitterhandle/splitter.h 0 + \snippet splitterhandle/splitter.h 0 The \l{QSplitter::}{createHandle()} implementation simply constructs a custom splitter handle, called \c Splitter in this example: - \snippet doc/src/snippets/splitterhandle/splitter.cpp 1 + \snippet splitterhandle/splitter.cpp 1 Information about a given handle can be obtained using functions like orientation() and opaqueResize(), and is retrieved from its parent splitter. @@ -100,7 +100,7 @@ QT_BEGIN_NAMESPACE needs to perform. A simple subclass might only provide a paintEvent() implementation: - \snippet doc/src/snippets/splitterhandle/splitter.cpp 0 + \snippet splitterhandle/splitter.cpp 0 In this example, a predefined gradient is set up differently depending on the orientation of the handle. QSplitterHandle provides a reasonable @@ -888,7 +888,7 @@ QSplitterLayoutStruct *QSplitterPrivate::insertWidget(int index, QWidget *w) The following example will show a QListView, QTreeView, and QTextEdit side by side, with two splitter handles: - \snippet doc/src/snippets/splitter/splitter.cpp 0 + \snippet splitter/splitter.cpp 0 If a widget is already inside a QSplitter when insertWidget() or addWidget() is called, it will move to the new position. This can be used @@ -1569,7 +1569,7 @@ static const qint32 SplitterMagic = 0xff; for a future session. A version number is stored as part of the data. Here is an example: - \snippet doc/src/snippets/splitter/splitter.cpp 1 + \snippet splitter/splitter.cpp 1 \sa restoreState() */ @@ -1604,7 +1604,7 @@ QByteArray QSplitter::saveState() const Restore the splitters's state: - \snippet doc/src/snippets/splitter/splitter.cpp 2 + \snippet splitter/splitter.cpp 2 A failure to restore the splitter's layout may result from either invalid or out-of-date data in the supplied byte array. @@ -1657,7 +1657,7 @@ bool QSplitter::restoreState(const QByteArray &state) This function is provided for convenience. It is equivalent to - \snippet doc/src/snippets/code/src_gui_widgets_qsplitter.cpp 0 + \snippet code/src_gui_widgets_qsplitter.cpp 0 \sa setSizes(), widget() */ diff --git a/src/widgets/widgets/qstackedwidget.cpp b/src/widgets/widgets/qstackedwidget.cpp index 5406f5dcf5..e239f86345 100644 --- a/src/widgets/widgets/qstackedwidget.cpp +++ b/src/widgets/widgets/qstackedwidget.cpp @@ -74,16 +74,16 @@ public: Like QStackedLayout, QStackedWidget can be constructed and populated with a number of child widgets ("pages"): - \snippet doc/src/snippets/qstackedwidget/main.cpp 0 - \snippet doc/src/snippets/qstackedwidget/main.cpp 2 - \snippet doc/src/snippets/qstackedwidget/main.cpp 3 + \snippet qstackedwidget/main.cpp 0 + \snippet qstackedwidget/main.cpp 2 + \snippet qstackedwidget/main.cpp 3 QStackedWidget provides no intrinsic means for the user to switch page. This is typically done through a QComboBox or a QListWidget that stores the titles of the QStackedWidget's pages. For example: - \snippet doc/src/snippets/qstackedwidget/main.cpp 1 + \snippet qstackedwidget/main.cpp 1 When populating a stacked widget, the widgets are added to an internal list. The indexOf() function returns the index of a diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp index 4b9242499c..2b17d7fb83 100644 --- a/src/widgets/widgets/qstatusbar.cpp +++ b/src/widgets/widgets/qstatusbar.cpp @@ -186,12 +186,12 @@ QRect QStatusBarPrivate::messageRect() const Use the showMessage() slot to display a \e temporary message: - \snippet examples/mainwindows/dockwidgets/mainwindow.cpp 8 + \snippet mainwindows/dockwidgets/mainwindow.cpp 8 To remove a temporary message, use the clearMessage() slot, or set a time limit when calling showMessage(). For example: - \snippet examples/mainwindows/dockwidgets/mainwindow.cpp 3 + \snippet mainwindows/dockwidgets/mainwindow.cpp 3 Use the currentMessage() function to retrieve the temporary message currently shown. The QStatusBar class also provide the @@ -205,7 +205,7 @@ QRect QStatusBarPrivate::messageRect() const addPermanentWidget() function. Use the removeWidget() function to remove such messages from the status bar. - \snippet doc/src/snippets/code/src_gui_widgets_qstatusbar.cpp 0 + \snippet code/src_gui_widgets_qstatusbar.cpp 0 By default QStatusBar provides a QSizeGrip in the lower-right corner. You can disable it using the setSizeGripEnabled() diff --git a/src/widgets/widgets/qtextbrowser.cpp b/src/widgets/widgets/qtextbrowser.cpp index 261b96f8af..b8ffced6bb 100644 --- a/src/widgets/widgets/qtextbrowser.cpp +++ b/src/widgets/widgets/qtextbrowser.cpp @@ -1170,7 +1170,7 @@ QUrl QTextBrowser::historyUrl(int i) const \row \li \a{i} > 0 \li \l forward() history \endtable - \snippet doc/src/snippets/code/src_gui_widgets_qtextbrowser.cpp 0 + \snippet code/src_gui_widgets_qtextbrowser.cpp 0 \since 4.4 */ diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 217fda61dc..7a7b977b89 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -472,12 +472,12 @@ void QTextEditPrivate::_q_ensureVisible(const QRectF &_rect) For example, to allow the user to drag and drop an image onto a QTextEdit, you could the implement these functions in the following way: - \snippet doc/src/snippets/textdocument-imagedrop/textedit.cpp 0 + \snippet textdocument-imagedrop/textedit.cpp 0 We add support for image MIME types by returning true. For all other MIME types, we use the default implementation. - \snippet doc/src/snippets/textdocument-imagedrop/textedit.cpp 1 + \snippet textdocument-imagedrop/textedit.cpp 1 We unpack the image from the QVariant held by the MIME source and insert it into the document as a resource. @@ -1583,7 +1583,7 @@ bool QTextEdit::focusNextPrevChild(bool next) Information about the event is passed in the \a event object. - \snippet doc/src/snippets/code/src_gui_widgets_qtextedit.cpp 0 + \snippet code/src_gui_widgets_qtextedit.cpp 0 */ void QTextEdit::contextMenuEvent(QContextMenuEvent *e) { @@ -2143,7 +2143,7 @@ void QTextEdit::setAutoFormatting(AutoFormatting features) It is equivalent to - \snippet doc/src/snippets/code/src_gui_widgets_qtextedit.cpp 1 + \snippet code/src_gui_widgets_qtextedit.cpp 1 */ void QTextEdit::insertPlainText(const QString &text) { @@ -2157,7 +2157,7 @@ void QTextEdit::insertPlainText(const QString &text) It is equivalent to: - \snippet doc/src/snippets/code/src_gui_widgets_qtextedit.cpp 2 + \snippet code/src_gui_widgets_qtextedit.cpp 2 \note When using this function with a style sheet, the style sheet will only apply to the current block in the document. In order to apply a style @@ -2273,10 +2273,10 @@ void QTextEdit::print(QPagedPaintDevice *printer) const #endif /*! \property QTextEdit::tabChangesFocus - \brief whether \gui Tab changes focus or is accepted as input + \brief whether \uicontrol Tab changes focus or is accepted as input In some occasions text edits should not allow the user to input - tabulators or change indentation using the \gui Tab key, as this breaks + tabulators or change indentation using the \uicontrol Tab key, as this breaks the focus chain. The default is false. */ -- cgit v1.2.3