summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/doc/src/application.qdoc11
-rw-r--r--examples/widgets/doc/src/icons.qdoc4
-rw-r--r--examples/widgets/doc/src/styles.qdoc20
-rw-r--r--examples/widgets/widgets/styles/norwegianwoodstyle.cpp12
-rw-r--r--examples/widgets/widgets/styles/norwegianwoodstyle.h4
-rw-r--r--examples/widgets/widgets/styles/styles.pro2
-rw-r--r--examples/widgets/widgets/widgets.pro2
7 files changed, 24 insertions, 31 deletions
diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc
index 4d795099e4..ef6dabc33b 100644
--- a/examples/widgets/doc/src/application.qdoc
+++ b/examples/widgets/doc/src/application.qdoc
@@ -231,16 +231,9 @@
Just before we create the \uicontrol{Help} menu, we call
QMenuBar::addSeparator(). This has no effect for most widget
- styles (e.g., Windows and Mac OS X styles), but for Motif-based
+ styles (e.g., Windows and Mac OS X styles), but for some
styles this makes sure that \uicontrol{Help} is pushed to the right
- side of the menu bar. Try running the application with various
- styles and see the results:
-
- \code
- application -style=windows
- application -style=motif
- application -style=cde
- \endcode
+ side of the menu bar.
Let's now review the toolbars:
diff --git a/examples/widgets/doc/src/icons.qdoc b/examples/widgets/doc/src/icons.qdoc
index 04ae310ced..d39f104bf1 100644
--- a/examples/widgets/doc/src/icons.qdoc
+++ b/examples/widgets/doc/src/icons.qdoc
@@ -600,8 +600,8 @@
In particular we create the \c styleActionGroup based on the
currently available GUI styles using
QStyleFactory. QStyleFactory::keys() returns a list of valid keys,
- typically including "windows", "motif", "cde", and
- "plastique". Depending on the platform, "windowsxp" and
+ typically including "windows", "cleanlooks" and
+ "plastique". Depending on the platform, "windowsxp", "windowsvista", "gtk" and
"macintosh" may be available.
We create one action for each key, and adds the action to the
diff --git a/examples/widgets/doc/src/styles.qdoc b/examples/widgets/doc/src/styles.qdoc
index 1297356e6f..773c7a7677 100644
--- a/examples/widgets/doc/src/styles.qdoc
+++ b/examples/widgets/doc/src/styles.qdoc
@@ -42,7 +42,7 @@
reimplementing a few virtual functions.
In this example, the custom style is called \c NorwegianWoodStyle
- and derives from QMotifStyle. Its main features are the wooden
+ and derives from QWindowsStyle. Its main features are the wooden
textures used for filling most of the widgets and its round
buttons and comboboxes.
@@ -56,7 +56,7 @@
The example consists of the following classes:
\list
- \li \c NorwegianWoodStyle inherits from QMotifStyle and implements
+ \li \c NorwegianWoodStyle inherits from QWindowsStyle and implements
the Norwegian Wood style.
\li \c WidgetGallery is a \c QDialog subclass that shows the most
common widgets and allows the user to switch style
@@ -69,8 +69,8 @@
\snippet widgets/styles/norwegianwoodstyle.h 0
- The public functions are all declared in QStyle (QMotifStyle's
- grandparent class) and reimplemented here to override the Motif
+ The public functions are all declared in QStyle (QWindowsStyle's
+ grandparent class) and reimplemented here to override the Windows
look and feel. The private functions are helper functions.
\section1 NorwegianWoodStyle Class Implementation
@@ -154,7 +154,7 @@
\image styles-disabledwood.png The Norwegian Wood style with disabled widgets
Let's move on to the other functions reimplemented from
- QMotifStyle:
+ QWindowsStyle:
\snippet widgets/styles/norwegianwoodstyle.cpp 3
\snippet widgets/styles/norwegianwoodstyle.cpp 4
@@ -186,23 +186,23 @@
widgets are drawn and their size hint. Here, we return 8 as the
width around a shown in a QComboBox, ensuring that there is
enough place around the text and the arrow for the Norwegian Wood
- round corners. The default value for this setting in the Motif
+ round corners. The default value for this setting in the Windows
style is 2.
We also change the extent of \l{QScrollBar}s, i.e., the height
for a horizontal scroll bar and the width for a vertical scroll
- bar, to be 4 pixels more than in the Motif style. This makes the
+ bar, to be 4 pixels more than in the Windows style. This makes the
style a bit more distinctive.
- For all other QStyle::PixelMetric elements, we use the Motif
+ For all other QStyle::PixelMetric elements, we use the Windows
settings.
\snippet widgets/styles/norwegianwoodstyle.cpp 9
\snippet widgets/styles/norwegianwoodstyle.cpp 10
The \l{QStyle::styleHint()}{styleHint()} function returns some
- hints to widgets or to the base style (in our case QMotifStyle)
- about how to draw the widgets. The Motif style returns \c true
+ hints to widgets or to the base style (in our case QWindowsStyle)
+ about how to draw the widgets. The Windows style returns \c true
for the QStyle::SH_DitherDisabledText hint, resulting in a most
unpleasing visual effect. We override this behavior and return \c
false instead. We also return \c true for the
diff --git a/examples/widgets/widgets/styles/norwegianwoodstyle.cpp b/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
index 143732952c..b8a677b9fa 100644
--- a/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
+++ b/examples/widgets/widgets/styles/norwegianwoodstyle.cpp
@@ -112,9 +112,9 @@ int NorwegianWoodStyle::pixelMetric(PixelMetric metric,
case PM_ComboBoxFrameWidth:
return 8;
case PM_ScrollBarExtent:
- return QMotifStyle::pixelMetric(metric, option, widget) + 4;
+ return QWindowsStyle::pixelMetric(metric, option, widget) + 4;
default:
- return QMotifStyle::pixelMetric(metric, option, widget);
+ return QWindowsStyle::pixelMetric(metric, option, widget);
}
}
//! [8]
@@ -131,7 +131,7 @@ int NorwegianWoodStyle::styleHint(StyleHint hint, const QStyleOption *option,
case SH_EtchDisabledText:
return int(true);
default:
- return QMotifStyle::styleHint(hint, option, widget, returnData);
+ return QWindowsStyle::styleHint(hint, option, widget, returnData);
}
}
//! [10]
@@ -256,7 +256,7 @@ void NorwegianWoodStyle::drawPrimitive(PrimitiveElement element,
//! [32] //! [33]
default:
//! [33] //! [34]
- QMotifStyle::drawPrimitive(element, option, painter, widget);
+ QWindowsStyle::drawPrimitive(element, option, painter, widget);
}
}
//! [34]
@@ -284,11 +284,11 @@ void NorwegianWoodStyle::drawControl(ControlElement element,
}
}
}
- QMotifStyle::drawControl(element, &myButtonOption, painter, widget);
+ QWindowsStyle::drawControl(element, &myButtonOption, painter, widget);
}
break;
default:
- QMotifStyle::drawControl(element, option, painter, widget);
+ QWindowsStyle::drawControl(element, option, painter, widget);
}
}
//! [36]
diff --git a/examples/widgets/widgets/styles/norwegianwoodstyle.h b/examples/widgets/widgets/styles/norwegianwoodstyle.h
index 1f1e38cfcb..84ace3b7a8 100644
--- a/examples/widgets/widgets/styles/norwegianwoodstyle.h
+++ b/examples/widgets/widgets/styles/norwegianwoodstyle.h
@@ -41,7 +41,7 @@
#ifndef NORWEGIANWOODSTYLE_H
#define NORWEGIANWOODSTYLE_H
-#include <QMotifStyle>
+#include <QWindowsStyle>
#include <QPalette>
QT_BEGIN_NAMESPACE
@@ -49,7 +49,7 @@ class QPainterPath;
QT_END_NAMESPACE
//! [0]
-class NorwegianWoodStyle : public QMotifStyle
+class NorwegianWoodStyle : public QWindowsStyle
{
Q_OBJECT
diff --git a/examples/widgets/widgets/styles/styles.pro b/examples/widgets/widgets/styles/styles.pro
index fef1dc6084..0be4f1ef3c 100644
--- a/examples/widgets/widgets/styles/styles.pro
+++ b/examples/widgets/widgets/styles/styles.pro
@@ -5,7 +5,7 @@ SOURCES = main.cpp \
widgetgallery.cpp
RESOURCES = styles.qrc
-REQUIRES += "contains(styles, motif)"
+REQUIRES += "contains(styles, windows)"
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/styles
diff --git a/examples/widgets/widgets/widgets.pro b/examples/widgets/widgets/widgets.pro
index 65289da995..b14a587968 100644
--- a/examples/widgets/widgets/widgets.pro
+++ b/examples/widgets/widgets/widgets.pro
@@ -26,7 +26,7 @@ SUBDIRS = analogclock \
wiggly \
windowflags
-contains(styles, motif): SUBDIRS += styles
+contains(styles, windows): SUBDIRS += styles
# install
sources.files = widgets.pro README