Qt 4.8
Classes | Functions | Variables
qwizard.cpp File Reference
#include "qwizard.h"
#include "qabstractspinbox.h"
#include "qalgorithms.h"
#include "qapplication.h"
#include "qboxlayout.h"
#include "qlayoutitem.h"
#include "qdesktopwidget.h"
#include "qevent.h"
#include "qframe.h"
#include "qlabel.h"
#include "qlineedit.h"
#include "qpainter.h"
#include "qpushbutton.h"
#include "qset.h"
#include "qstyle.h"
#include "qvarlengtharray.h"
#include "private/qt_mac_p.h"
#include "qlibrary.h"
#include "private/qdialog_p.h"
#include <qdebug.h>
#include <string.h>
#include "moc_qwizard.cpp"

Go to the source code of this file.

Classes

class  QWatermarkLabel
 
class  QWizardAntiFlickerWidget
 
class  QWizardDefaultProperty
 
class  QWizardField
 
class  QWizardHeader
 
class  QWizardLayoutInfo
 
class  QWizardPagePrivate
 
class  QWizardPrivate
 
class  QWizardRuler
 

Functions

static QString buttonDefaultText (int wstyle, int which, const QWizardPrivate *wizardPrivate)
 
static void changeSpacerSize (QLayout *layout, int index, int width, int height)
 
static QWidgetiWantTheFocus (QWidget *ancestor)
 
static QString object_name_for_button (QWizard::WizardButton which)
 
static bool objectInheritsXAndXIsCloserThanY (const QObject *object, const QByteArray &classX, const QByteArray &classY)
 
bool qt_wince_is_mobile ()
 

Variables

static const char *const buttonSlots [QWizard::NStandardButtons]
 
const int ClassicHMargin = 4
 
struct {
   const char *   changedSignal
 
   const char *   className
 
   const char *   property
 
fallbackProperties [NFallbackDefaultProperties]
 
const int GapBetweenLogoAndRightEdge = 5
 
const int MacButtonTopMargin = 13
 
const int MacLayoutBottomMargin = 17
 
const int MacLayoutLeftMargin = 20
 
const int MacLayoutRightMargin = 20
 
const int ModernHeaderTopMargin = 2
 
const int NFallbackDefaultProperties = 7
 

Function Documentation

◆ buttonDefaultText()

static QString buttonDefaultText ( int  wstyle,
int  which,
const QWizardPrivate wizardPrivate 
)
static

Definition at line 680 of file qwizard.cpp.

Referenced by QWizard::buttonText(), QWizardPrivate::ensureButton(), and QWizardPrivate::updateButtonTexts().

681 {
682 #if defined(QT_NO_STYLE_WINDOWSVISTA)
683  Q_UNUSED(wizardPrivate);
684 #endif
685  const bool macStyle = (wstyle == QWizard::MacStyle);
686  switch (which) {
687  case QWizard::BackButton:
688  return macStyle ? QWizard::tr("Go Back") : QWizard::tr("< &Back");
689  case QWizard::NextButton:
690  if (macStyle)
691  return QWizard::tr("Continue");
692  else
693  return wizardPrivate->isVistaThemeEnabled()
694  ? QWizard::tr("&Next") : QWizard::tr("&Next >");
696  return QWizard::tr("Commit");
698  return macStyle ? QWizard::tr("Done") : QWizard::tr("&Finish");
700  return QWizard::tr("Cancel");
701  case QWizard::HelpButton:
702  return macStyle ? QWizard::tr("Help") : QWizard::tr("&Help");
703  default:
704  return QString();
705  }
706 }
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isVistaThemeEnabled(QVistaHelper::VistaState state) const
Definition: qwizard.cpp:1563
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
The QWizard class provides a framework for wizards.
Definition: qwizard.h:59

◆ changeSpacerSize()

static void changeSpacerSize ( QLayout layout,
int  index,
int  width,
int  height 
)
static

Definition at line 94 of file qwizard.cpp.

Referenced by QWizardPrivate::recreateLayout().

95 {
96  QSpacerItem *spacer = layout->itemAt(index)->spacerItem();
97  if (!spacer)
98  return;
99  spacer->changeSize(width, height);
100 }
virtual QLayoutItem * itemAt(int index) const =0
Must be implemented in subclasses to return the layout item at index.
virtual QSpacerItem * spacerItem()
If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned.
The QSpacerItem class provides blank space in a layout.
Definition: qlayoutitem.h:96
quint16 index
void changeSize(int w, int h, QSizePolicy::Policy hData=QSizePolicy::Minimum, QSizePolicy::Policy vData=QSizePolicy::Minimum)
Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hPolic...

◆ iWantTheFocus()

static QWidget* iWantTheFocus ( QWidget ancestor)
static

Definition at line 102 of file qwizard.cpp.

Referenced by QWizardPrivate::switchToPage().

103 {
104  const int MaxIterations = 100;
105 
106  QWidget *candidate = ancestor;
107  for (int i = 0; i < MaxIterations; ++i) {
108  candidate = candidate->nextInFocusChain();
109  if (!candidate)
110  break;
111 
112  if (candidate->focusPolicy() & Qt::TabFocus) {
113  if (candidate != ancestor && ancestor->isAncestorOf(candidate))
114  return candidate;
115  }
116  }
117  return 0;
118 }
Qt::FocusPolicy focusPolicy
the way the widget accepts keyboard focus
Definition: qwidget.h:187
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QWidget * nextInFocusChain() const
Returns the next widget in this widget&#39;s focus chain.
Definition: qwidget.cpp:6873
bool isAncestorOf(const QWidget *child) const
Returns true if this widget is a parent, (or grandparent and so on to any level), of the given child...
Definition: qwidget.cpp:8573

◆ object_name_for_button()

static QString object_name_for_button ( QWizard::WizardButton  which)
static

Definition at line 1353 of file qwizard.cpp.

Referenced by QWizardPrivate::ensureButton().

1354 {
1355  switch (which) {
1356  case QWizard::CommitButton:
1357  return QLatin1String("qt_wizard_") + QLatin1String("commit");
1358  case QWizard::FinishButton:
1359  return QLatin1String("qt_wizard_") + QLatin1String("finish");
1360  case QWizard::CancelButton:
1361  return QLatin1String("qt_wizard_") + QLatin1String("cancel");
1362  case QWizard::BackButton:
1363  case QWizard::NextButton:
1364  case QWizard::HelpButton:
1368  // Make navigation buttons detectable as passive interactor in designer
1369  return QLatin1String("__qt__passive_wizardbutton") + QString::number(which);
1370  case QWizard::Stretch:
1371  case QWizard::NoButton:
1372  //case QWizard::NStandardButtons:
1373  //case QWizard::NButtons:
1374  ;
1375  }
1376  //Q_UNREACHABLE();
1377  return QString();
1378 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83

◆ objectInheritsXAndXIsCloserThanY()

static bool objectInheritsXAndXIsCloserThanY ( const QObject object,
const QByteArray classX,
const QByteArray classY 
)
static

Definition at line 120 of file qwizard.cpp.

Referenced by QWizardField::findProperty().

122 {
123  const QMetaObject *metaObject = object->metaObject();
124  while (metaObject) {
125  if (metaObject->className() == classX)
126  return true;
127  if (metaObject->className() == classY)
128  return false;
129  metaObject = metaObject->superClass();
130  }
131  return false;
132 }
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
const QMetaObject * superClass() const
Returns the meta-object of the superclass, or 0 if there is no such object.
Definition: qobjectdefs.h:494
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491

◆ qt_wince_is_mobile()

bool qt_wince_is_mobile ( )

Definition at line 296 of file qguifunctions_wince.cpp.

Referenced by QWizard::QWizard().

296  {
298 }
bool qt_wince_is_pocket_pc()
bool qt_wince_is_smartphone()

Variable Documentation

◆ buttonSlots

const char* const buttonSlots[QWizard::NStandardButtons]
static
Initial value:
= {
SLOT(back()), SLOT(next()), SLOT(next()), SLOT(accept()), SLOT(reject()),
}
#define SLOT(a)
Definition: qobjectdefs.h:226

Definition at line 895 of file qwizard.cpp.

Referenced by QWizardPrivate::connectButton(), and QWizardPrivate::handleAeroStyleChange().

◆ changedSignal

const char* changedSignal

Definition at line 139 of file qwizard.cpp.

Referenced by QWizardPrivate::init().

◆ ClassicHMargin

const int ClassicHMargin = 4

Definition at line 87 of file qwizard.cpp.

Referenced by QWizardPrivate::recreateLayout(), and QWizardHeader::setup().

◆ className

const char* className

◆ fallbackProperties

const { ... } fallbackProperties[NFallbackDefaultProperties]
Initial value:
= {
{ "QAbstractButton", "checked", SIGNAL(toggled(bool)) },
{ "QAbstractSlider", "value", SIGNAL(valueChanged(int)) },
{ "QComboBox", "currentIndex", SIGNAL(currentIndexChanged(int)) },
{ "QDateTimeEdit", "dateTime", SIGNAL(dateTimeChanged(QDateTime)) },
{ "QLineEdit", "text", SIGNAL(textChanged(QString)) },
{ "QListWidget", "currentRow", SIGNAL(currentRowChanged(int)) },
{ "QSpinBox", "value", SIGNAL(valueChanged(int)) }
}
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define SIGNAL(a)
Definition: qobjectdefs.h:227
The QDateTime class provides date and time functions.
Definition: qdatetime.h:216

Referenced by QWizardPrivate::init().

◆ GapBetweenLogoAndRightEdge

const int GapBetweenLogoAndRightEdge = 5

Definition at line 85 of file qwizard.cpp.

Referenced by QWizardHeader::QWizardHeader(), and QWizardHeader::setup().

◆ MacButtonTopMargin

const int MacButtonTopMargin = 13

Definition at line 88 of file qwizard.cpp.

Referenced by QWizardPrivate::recreateLayout().

◆ MacLayoutBottomMargin

const int MacLayoutBottomMargin = 17

Definition at line 92 of file qwizard.cpp.

Referenced by QWizardPrivate::recreateLayout().

◆ MacLayoutLeftMargin

const int MacLayoutLeftMargin = 20

Definition at line 89 of file qwizard.cpp.

Referenced by QWizardPrivate::recreateLayout().

◆ MacLayoutRightMargin

const int MacLayoutRightMargin = 20

Definition at line 91 of file qwizard.cpp.

Referenced by QWizardPrivate::recreateLayout().

◆ ModernHeaderTopMargin

const int ModernHeaderTopMargin = 2

Definition at line 86 of file qwizard.cpp.

Referenced by QWizardHeader::setup().

◆ NFallbackDefaultProperties

const int NFallbackDefaultProperties = 7

Definition at line 134 of file qwizard.cpp.

Referenced by QWizardPrivate::init().

◆ property

const char* property