text:
<!DOCTYPE html>

    <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Build a game at Wichita's biggest game development party!!">
<meta name="author" content="ICT Game Jam">
<title>ICT Game Jam</title>

<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Kaushan+Script" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700' rel='stylesheet' type='text/css'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>

              ICTGAMEJAM.COM Jul 29 - 31, 2022

                  Event

                  Schedule

                  Help!

            What's a game jam?
          Buy a Ticket Now

        What's a game jam?

It’s a PARTY

                  Ok, technically it’s a competition with prizes. It’s not a workshop or a class about making games. But if you want to spend a weekend learning game development and getting fed, you’ll be in good company.

Do I need to have made a game before?

Plenty of previous participants had little or no game development experience, but they had a blast.  We’ll have lots of people willing to answer questions and help you learn at your own pace!

Do I need to be a programmer?

No!  Games also need artists, writers, and designers.  There is no rule for whether your game must be 2D, 3D, complex, or even have graphics.  Make a board or card game if you like!

Do I need a computer?

If your game requires one, you need to bring your computer capable of connecting to Wi-Fi.

I love it! I must know more!

If you insist!  Participating gets you snacks and drinks, all while hanging out with local game developers!  Meals are provided throughout the weekend.  Follow @ICTGameJam, and join us in Slack to get involved with local game devs and upcoming events!

Location

            Butler Community College Andover Campus
715 East 13th Street, Andover, KS 67002

Buy a TICKET

            Click here to Buy a Ticket!

Schedule

Great! Now that you're going to the game jam, here's how the weekend will go...

Friday

Kickoff!

Doors open at 6pm, kickoff slides and intro start at 7pm.  Participants will receive an email to vote on the game jam’s theme.  Those needing teams will have an opportunity to pitch ideas and form or join teams as necessary.  You can even work solo if you want.  3 people is ideal, and we prefer teams stay below 5.  Then it’s time to start making games!  Work as long as you can, while staying healthy and safe!  Overnight work is permitted, but we send people home around midnight.

Saturday

Build Day!

Show up in the morning.  Enjoy refreshments, meals and … oh yeah… build a game!  Hit a wall?  Ask for help!  Lean on the volunteers and fellow game devs for feedback and encouragement!  Same closing rules as Friday!

Sunday

Polish, SHIP IT!!  Winners announced!

Arrive in the morning to put the finishing touches on your game.  Work stops, lunch begins at 12pm.  Developers will vote during/after lunch.  Winners announced once all of the vots are in and tallied.

Keep
making
games!

Help!

Check out the games from previous events on our Itch.io page!

The best way to help is to
                  participate!  Otherwise we welcome volunteered time or talent in any amount before, during or after the event.

Finally, if you absolutely insist, here are some sponsorship packages to consider!  For all these, please contact ictgamejam@devict.org.

This and other Wichita game development events are operated under devICT, a 501c3 organization.  All donations are used to run this and future game development events.

Our amazing sponsors

Thanks for making this event possible!!

        Published under the Apache License 2.0.

devICT

Email ICT Game Jam


text:
using HL7Enumerator.HL7Tables.Interfaces;
using System;
using System.Collections.Generic;

namespace HL7Enumerator.Types
{
    public static partial class DataTypes
    {

        public class XCN_ExtendedCompositeIDAndName : XPN_ExtendedPersonName
        {
            public override void Populate(HL7Element element, IEnumerable<string> tableIds = null)
            {
                if (element.IsRepeatingField)
                {
                    throw new InvalidOperationException("AsXCN() called on repeating field.\r\n" +
                        " The Field in question should be treated as an Enumerable type");
                }

                ID = element.ElementValue(0);
                FamilyName = element.ElementValue(1);
                GivenName = element.ElementValue(2);
                SecondGivenNamesOrInitials = element.ElementValue(3);
                Suffix = element.ElementValue(4);
                Prefix = element.ElementValue(5);

                var tblsUsed = 0;
                Degree = NewIS(element.ElementValue(6), NextTableId(tableIds, ref tblsUsed));

                SourceTable = element.ElementValue(7);
                AssigningAuthority = element.IndexedElement(8).AsHD(tableIds, Tables);
                tblsUsed += HD_HierarchicDesignator.TotalCodedFieldCount; ;

                NameTypeCode = NewID(element.ElementValue(9), NextTableId(tableIds, ref tblsUsed));
                IdentifierCheckDigit = element.ElementValue(10);
                CheckDigitScheme = element.ElementValue(11);
                IdentifierTypeCode = element.ElementValue(12);

                AssigningFacility = element.IndexedElement(13).AsHD(tableIds, Tables);
                tblsUsed += HD_HierarchicDesignator.TotalCodedFieldCount;

                NameRepresentationCode = NewID(element.ElementValue(14),
                    NextTableId(tableIds, ref tblsUsed));
                NameContext = element.IndexedElement(15).AsCE();

                NameValidityRange = element.IndexedElement(16).AsDateRange();
                NameAssemblyOrder = NewID(element.ElementValue(17), NextTableId(tableIds, ref tblsUsed));
            }

            public XCN_ExtendedCompositeIDAndName()
            {

            }

            public XCN_ExtendedCompositeIDAndName(HL7Element element, IEnumerable<string> tableIds = null, IDataTableProvider tables=null)
                : base(element, tableIds, tables)
            {
            }
            public string ID { get; set; }
            public string SourceTable { get; set; }
            public HD_HierarchicDesignator AssigningAuthority { get; set; }
            public string IdentifierCheckDigit { get; set; }
            public string CheckDigitScheme { get; set; }
            public string IdentifierTypeCode { get; set; }
            public HD_HierarchicDesignator AssigningFacility { get; set; }
            public DR_DateRange NameValidityRange { get; set; }
            public new static int TotalCodedFieldCount => (XPN_ExtendedPersonName.TotalCodedFieldCount + 2 * HD_HierarchicDesignator.TotalCodedFieldCount);
            public override int DataTablesRequired => TotalCodedFieldCount;

            public override string ToString(char separator)
            {
                var ns = NextSeparator(separator);
                return
                    $"{ID}{separator}{FamilyName}{separator}{GivenName}{separator}{SecondGivenNamesOrInitials}" +
                    $"{separator}{Suffix}{separator}{Prefix}{separator}{Degree}{separator}" +
                    $"{SourceTable}{separator}{AssigningAuthority?.ToString(ns)}{separator}" +
                    $"{NameTypeCode}{separator}{IdentifierCheckDigit}{separator}{CheckDigitScheme}{separator}" +
                    $"{IdentifierTypeCode}{separator}{AssigningFacility?.ToString(ns)}{separator}" +
                    $"{NameRepresentationCode}{separator}{NameContext?.ToString(ns)}{separator}" +
                    $"{NameValidityRange?.ToString(ns)}{separator}{NameAssemblyOrder}"
                    .TrimEnd(separator);
            }
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.nodlee.theogony.core;

import com.nodlee.theogony.bean.DragonData;
import com.nodlee.theogony.utils.LogHelper;
import com.nodlee.theogony.thirdparty.realm.RealmProvider;

import io.realm.Realm;

/**
 * Created by Vernon Lee on 15-11-22.
 */
public class DragonDataManager {
    private static DragonDataManager sManager;

    public static DragonDataManager getInstance() {
        if (sManager == null) {
            sManager = new DragonDataManager();
        }
        return sManager;
    }

    private DragonDataManager() {
    }

    public DragonData getDefault() {
        Realm realm = RealmProvider.getInstance().getRealm();
        try {
            DragonData result = realm.where(DragonData.class).findFirst();
            return result;
        } finally {
            realm.close();
        }
    }

    public void setOutDate() {
        Realm realm = RealmProvider.getInstance().getRealm();
        try {
            realm.beginTransaction();
            DragonData dragonData = getDefault();
            dragonData.setOutDate(true);
            realm.commitTransaction();
            LogHelper.LOGD("数据已过时");
        } finally {
            realm.close();
        }
    }

    public boolean isOutDate() {
        Realm realm = RealmProvider.getInstance().getRealm();
        try {
            DragonData result = realm.where(DragonData.class).findFirst();
            return result != null && result.isOutDate();
        } finally {
            realm.close();
        }
    }

    public String getVersion() {
        Realm realm = RealmProvider.getInstance().getRealm();
        try {
            DragonData result = realm.where(DragonData.class).findFirst();
            return result != null ? result.getVersion() : null;
        } finally {
            realm.close();
        }
    }
}


text:
.zooniverse-dialog {
  display: block;
  font-size: 12px;
  height: 100%;
  min-height: 700px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 100;
}
.zooniverse-dialog .underlay {
  background: #0c9cf5;
  display: table;
  width: 100%;
  -webkit-transition: background-color 0.5s ease-in-out;
  -moz-transition: background-color 0.5s ease-in-out;
  -o-transition: background-color 0.5s ease-in-out;
  -ms-transition: background-color 0.5s ease-in-out;
  transition: background-color 0.5s ease-in-out;
  height: 100%;
  min-height: 700px;
}
.zooniverse-dialog .underlay .container {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
  -webkit-perspective: 1000px;
  -moz-perspective: 1000px;
  -ms-perspective: 1000px;
  perspective: 1000px;
}
.zooniverse-dialog .underlay .container .dialog {
  background: #0c9cf5;
  color: #fff;
  display: inline-block;
  margin: 50px 100px;
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  padding: 30px;
  position: relative;
  text-align: left;
  text-shadow: none;
  -webkit-transform: translateX(-100%);
  -moz-transform: translateX(-100%);
  -o-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  transform: translateX(-100%);
  -webkit-transition: opacity 0.25s ease-in-out, -webkit-transform 0.33s ease-in-out;
  -moz-transition: opacity 0.25s ease-in-out, -moz-transform 0.33s ease-in-out;
  -o-transition: opacity 0.25s ease-in-out, -o-transform 0.33s ease-in-out;
  -ms-transition: opacity 0.25s ease-in-out, -ms-transform 0.33s ease-in-out;
  transition: opacity 0.25s ease-in-out, transform 0.33s ease-in-out;
}
.zooniverse-dialog .underlay .container .dialog > form > button[name="close-dialog"] {
  font-size: 16px;
  height: 1em;
  position: absolute;
  right: 4px;
  top: 0;
  width: 1em;
}
.zooniverse-dialog.warning .underlay .container .dialog {
  border: 5px solid #f90;
}
.zooniverse-dialog.error .underlay .container .dialog {
  border: 5px solid #c30;
}
.zooniverse-dialog.showing .underlay {
  background: #0c9cf5;
}
.zooniverse-dialog.showing .underlay .container .dialog {
  opacity: 1;
  -ms-filter: none;
  filter: none;
  -webkit-transform: translateY(0) rotateX(0) scale(1);
  -moz-transform: translateY(0) rotateX(0) scale(1);
  -o-transform: translateY(0) rotateX(0) scale(1);
  -ms-transform: translateY(0) rotateX(0) scale(1);
  transform: translateY(0) rotateX(0) scale(1);
}
.zooniverse-dialog button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  margin: 0;
  padding: 0;
}
.zooniverse-dialog a {
  color: inherit;
}
.zooniverse-dialog header {
  font-size: 16px;
  margin-bottom: 20px;
}
.zooniverse-dialog header .zooniverse-logo {
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAACUUlEQVR42rzWSYjOYRwH8M+MsdOUJUtZChEylsguBwdRlpMsJQ4i4SIkRSlSDhJxcrCcyNVBkW0kawoxpSZryDpIk3H5vdPj8c477yR+l/f9bc/3/1ufp6Kpqcm/pqpyjDp1rarBNAxDNT7jCWq/NzTeas2/omOXdqX0q7ABNSVsHuAgjrQVZDBOYUobsnIby/EwkY3F0soixuPwqI0AMD6imhH8RlzDlzySPniOPLyXOIub+IDumICFGFgE8AKGYBmu5CD3MTpz2IXdaGwhgq3Yk8m+oj8+QpquZUUAFmNnCQDYi/mZrEvU54/CP42CF2g3dpRRi6E4iQHol8jfoVcaycgM4G0LAD2iFj2CX4E7qI0a1Ce2PTE1BZmTHXaiCMBKPIviP8NV7McSbMI3HMt8ZqcTPyJTXs/4vjiKDsF3xuSI6m5iV5v5DUgj6ZYp32f88ASgQJWxYlL6UKQBmkEaMmV1EdCfmewH6lrx+5aCPM6Uk5L/83AeNwpO8bsmBrclP1G75hYeg3uJ8hUGYR9WYx2Oo3dMeD3eFGmOuuiyAs3CpXROnseUpqvkRXRPXRnzshaHE/5TIX3tqtpXpkVbkBh1j5RcLwNgJk5nsu2FbksjqY4c5p22JdLWEq2P+ySl19H2v62VKbEa6iOPxXJ9JqL6FB8yCYtiW+Q0KtZ+M8jm2LTbcADTcfkvrvS5OJcPVO/YMQdCdiW28f02Hv4YE3OAcu74TZHzISVs6nGoVN0qynkSdepaNT121cCox9c4/Mb3hsaLrb5W/se769cAaz6BAxgHPGwAAAAASUVORK5CYII=");
  display: inline-block;
  height: 25px;
  margin-right: 5px;
  position: relative;
  top: -2px;
  vertical-align: middle;
  width: 25px;
}
.zooniverse-dialog .loader {
  -webkit-animation: 1s zooniverse-progress linear infinite;
  -moz-animation: 1s zooniverse-progress linear infinite;
  -o-animation: 1s zooniverse-progress linear infinite;
  -ms-animation: 1s zooniverse-progress linear infinite;
  animation: 1s zooniverse-progress linear infinite;
  background: -webkit-gradient(linear, left top, right bottom, color-stop(0.25, transparent), color-stop(0.25, #000), color-stop(0.5, #000), color-stop(0.5, transparent), color-stop(0.75, transparent), color-stop(0.75, #000));
  background: -webkit-linear-gradient(left top, transparent 25%, #000 25%, #000 50%, transparent 50%, transparent 75%, #000 75%);
  background: -moz-linear-gradient(left top, transparent 25%, #000 25%, #000 50%, transparent 50%, transparent 75%, #000 75%);
  background: -o-linear-gradient(left top, transparent 25%, #000 25%, #000 50%, transparent 50%, transparent 75%, #000 75%);
  background: -ms-linear-gradient(left top, transparent 25%, #000 25%, #000 50%, transparent 50%, transparent 75%, #000 75%);
  background: linear-gradient(left top, transparent 25%, #000 25%, #000 50%, transparent 50%, transparent 75%, #000 75%);
  -webkit-background-size: 25px 25px;
  -moz-background-size: 25px 25px;
  background-size: 25px 25px;
  bottom: 0;
  display: none;
  left: 0;
  opacity: 0.05;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=5)";
  filter: alpha(opacity=5);
  position: absolute;
  right: 0;
  top: 0;
  z-index: -1;
}
.zooniverse-dialog .loading .loader {
  display: block;
}
.zooniverse-dialog label {
  display: block;
  margin: 10px 0;
}
.zooniverse-dialog input, .zooniverse-dialog select {
  background: #0c9cf5;
  border: 3px solid #fff;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-box-shadow: 0 1px 0 #fff;
  font-size: 12px;
  color: #fff;
  font-size: 16px;
  padding: 10px;
}
.zooniverse-dialog input:first-child {
  width: 100%;
}
.zooniverse-dialog .explanation {
  font-size: 10px;
  margin: 5px 13px;
  opacity: 0.75;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=75)";
  filter: alpha(opacity=75);
}
.zooniverse-dialog .error-message {
  color: #800000;
  font-weight: bold;
  text-align: center;
}
.zooniverse-dialog .action {
  margin: 1em 0;
  text-align: center;
}
.zooniverse-dialog .action button {
  background: #333;
  border: none;
  font-size: 20px;
  height: 35px;
  margin: 0 5px;
  padding: 3px 10px;
}
.zooniverse-dialog .action button:active {
  background: #525252;
}

.zooniverse-dialog .action button:hover {
  background: #525252;
}

@-moz-keyframes zooniverse-progress {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 0;
  }
}
@-webkit-keyframes zooniverse-progress {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 0;
  }
}
@-o-keyframes zooniverse-progress {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 0;
  }
}
@-ms-keyframes zooniverse-progress {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 0;
  }
}
@keyframes zooniverse-progress {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 50px 0;
  }
}


text:
//
// Copyright (c) 2009-2010 Shawn Singh, Mubbasir Kapadia, Petros Faloutsos, Glenn Reinman
// See license.txt for complete license.
//

#ifndef __STEERLIB_OBSTACLE_INTERFACE_H__
#define __STEERLIB_OBSTACLE_INTERFACE_H__

/// @file ObstacleInterface.h
/// @brief Declares the SteerLib::ObstacleInterface virtual interface.

#include "Globals.h"
#include "griddatabase/GridDatabase2D.h"
#include "util/Geometry.h"

namespace SteerLib {

	/**
	 * @brief The virtual interface for any non-agent object in the environment.
	 */
	class STEERLIB_API ObstacleInterface : public SteerLib::SpatialDatabaseItem {
	public:
		virtual ~ObstacleInterface() { }
		virtual void init() { }
		virtual void update(float timeStamp, float dt, unsigned int frameNumber) { }
		virtual void draw() = 0;
		virtual const Util::AxisAlignedBox & getBounds() = 0;

		/// @name The SpatialDatabaseItem interface
		/// @brief This interface is kept pure abstract.
		//@{
		virtual bool isAgent() = 0;
		virtual bool blocksLineOfSight() = 0;
		virtual float getTraversalCost() = 0;
		virtual bool intersects(const Util::Ray &r, float &t) = 0;
		virtual bool overlaps(const Util::Point & p, float radius) = 0;
		virtual float computePenetration(const Util::Point & p, float radius) = 0;
		//@}
	};

} // end namespace SteerLib

#endif


text:
import com.intellij.openapi.extensions.PluginId;

class UsePluginIdEquals {

  void any() {
    PluginId id1 = PluginId.getId("id1");
    PluginId id2 = PluginId.getId("id2");

    boolean result = <warning descr="'PluginId' instances should be compared for equality, not identity">id1 != <caret>id2</warning>;
  }

}


text:
package org.brunocvcunha.instagram4j.requests.payload;

import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author Alexander Kohonovsky
 * @since 2019-04-28
 */
@Getter
@Setter
public class InstagramCurrentUserProfile {

    private long pk;
    private String username;
    private String full_name;
    private boolean is_private;
    private String profile_pic_url;
    private boolean is_verified;
    private boolean has_anonymous_profile_picture;
    private String biography;
    private String external_url;

    /**
     * Auto archive stories for viewing them later.
     * It will appear in your archive once it has disappeared from your story feed.
     * Possible values: "unset" (initial value), "on", "off"
     */
    private String reel_auto_archive;
    private List<InstagramProfilePic> hd_profile_pic_versions;
    private InstagramProfilePic hd_profile_pic_url_info;
    private boolean show_conversion_edit_entry;

    /**
     * Possible values: "any", ...
     */
    private String allowed_commenter_type;

    private String birthday;

    private String phone_number;
    private String country_code;
    private Long national_number;

    private InstagramUserGenderEnum gender;
    private String email;
    private boolean can_link_entities_in_bio;

}


text:
using MahApps.Metro.Controls.Dialogs;
using System;
using System.Threading.Tasks;
using System.Windows;

namespace VersionrUI
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow
    {
        public static readonly MetroDialogColorScheme DialogColorScheme = MetroDialogColorScheme.Accented;

        private bool _userSettingsLoaded = false;

        public MainWindow()
        {
            Instance = this;
            InitializeComponent();
        }

        public static MainWindow Instance { get; private set; }
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            System.Drawing.Size windowSize = Properties.Settings.Default.WindowSize;
            this.Width = windowSize.Width;
            this.Height = windowSize.Height;

            System.Drawing.Point windowLocation = Properties.Settings.Default.WindowLocation;
            this.Left = windowLocation.X;
            this.Top = windowLocation.Y;

            WindowState state = (WindowState)Properties.Settings.Default.WindowState;
            if (state != WindowState.Minimized)
                this.WindowState = state;

            _userSettingsLoaded = true;
        }

        private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            if (_userSettingsLoaded && this.WindowState == WindowState.Normal)
            {
                Properties.Settings.Default.WindowSize = new System.Drawing.Size((int)e.NewSize.Width, (int)e.NewSize.Height);
                Properties.Settings.Default.Save();
            }
        }

        private void Window_LocationChanged(object sender, EventArgs e)
        {
            if (_userSettingsLoaded && this.WindowState == WindowState.Normal)
            {
                Properties.Settings.Default.WindowLocation = new System.Drawing.Point((int)this.Left, (int)this.Top);
                Properties.Settings.Default.Save();
            }
        }

        private void Window_StateChanged(object sender, EventArgs e)
        {
            if (_userSettingsLoaded && this.WindowState != WindowState.Minimized)
            {
                Properties.Settings.Default.WindowState = (int)this.WindowState;
                Properties.Settings.Default.Save();
            }
        }

        public static Task<MessageDialogResult> ShowMessage(string title, string message, MessageDialogStyle style = MessageDialogStyle.Affirmative, MetroDialogSettings settings = null)
        {
            MetroDialogSettings dialogSettings = (settings != null) ? settings : new MetroDialogSettings() { ColorScheme = MainWindow.DialogColorScheme };

            return MainWindow.Instance.ShowMessageAsync(title, message, style, dialogSettings);
        }
    }
}


text:
define("mojo/public/js/bindings/codec", [
  "mojo/public/js/bindings/unicode",
  "mojo/public/js/bindings/buffer"
  ], function(unicode, buffer) {

  var kErrorUnsigned = "Passing negative value to unsigned";

  // Memory -------------------------------------------------------------------

  var kAlignment = 8;

  function align(size) {
    return size + (kAlignment - (size % kAlignment)) % kAlignment;
  }

  function isAligned(offset) {
    return offset >= 0 && (offset % kAlignment) === 0;
  }

  // Constants ----------------------------------------------------------------

  var kArrayHeaderSize = 8;
  var kStructHeaderSize = 8;
  var kMessageHeaderSize = 16;
  var kMessageWithRequestIDHeaderSize = 24;

  var kStructHeaderNumBytesOffset = 0;
  var kStructHeaderNumFieldsOffset = 4;

  // Decoder ------------------------------------------------------------------

  function Decoder(buffer, handles, base) {
    this.buffer = buffer;
    this.handles = handles;
    this.base = base;
    this.next = base;
  }

  Decoder.prototype.skip = function(offset) {
    this.next += offset;
  };

  Decoder.prototype.readInt8 = function() {
    var result = this.buffer.getInt8(this.next);
    this.next += 1;
    return result;
  };

  Decoder.prototype.readUint8 = function() {
    var result = this.buffer.getUint8(this.next);
    this.next += 1;
    return result;
  };

  Decoder.prototype.readInt16 = function() {
    var result = this.buffer.getInt16(this.next);
    this.next += 2;
    return result;
  };

  Decoder.prototype.readUint16 = function() {
    var result = this.buffer.getUint16(this.next);
    this.next += 2;
    return result;
  };

  Decoder.prototype.readInt32 = function() {
    var result = this.buffer.getInt32(this.next);
    this.next += 4;
    return result;
  };

  Decoder.prototype.readUint32 = function() {
    var result = this.buffer.getUint32(this.next);
    this.next += 4;
    return result;
  };

  Decoder.prototype.readInt64 = function() {
    var result = this.buffer.getInt64(this.next);
    this.next += 8;
    return result;
  };

  Decoder.prototype.readUint64 = function() {
    var result = this.buffer.getUint64(this.next);
    this.next += 8;
    return result;
  };

  Decoder.prototype.readFloat = function() {
    var result = this.buffer.getFloat32(this.next);
    this.next += 4;
    return result;
  };

  Decoder.prototype.readDouble = function() {
    var result = this.buffer.getFloat64(this.next);
    this.next += 8;
    return result;
  };

  Decoder.prototype.decodePointer = function() {
    // TODO(abarth): To correctly decode a pointer, we need to know the real
    // base address of the array buffer.
    var offsetPointer = this.next;
    var offset = this.readUint64();
    if (!offset)
      return 0;
    return offsetPointer + offset;
  };

  Decoder.prototype.decodeAndCreateDecoder = function(pointer) {
    return new Decoder(this.buffer, this.handles, pointer);
  };

  Decoder.prototype.decodeHandle = function() {
    return this.handles[this.readUint32()];
  };

  Decoder.prototype.decodeString = function() {
    var numberOfBytes = this.readUint32();
    var numberOfElements = this.readUint32();
    var base = this.next;
    this.next += numberOfElements;
    return unicode.decodeUtf8String(
        new Uint8Array(this.buffer.arrayBuffer, base, numberOfElements));
  };

  Decoder.prototype.decodeArray = function(cls) {
    var numberOfBytes = this.readUint32();
    var numberOfElements = this.readUint32();
    var val = new Array(numberOfElements);
    if (cls.cls === PackedBool) {
      var byte;
      for (var i = 0; i < numberOfElements; ++i) {
        if (i % 8 === 0)
          byte = this.readUint8();
        val[i] = (byte & (1 << i % 8)) ? true : false;
      }
    } else {
      for (var i = 0; i < numberOfElements; ++i) {
        val[i] = cls.decode(this);
      }
    }
    return val;
  };

  Decoder.prototype.decodeStruct = function(cls) {
    return cls.decode(this);
  };

  Decoder.prototype.decodeStructPointer = function(cls) {
    var pointer = this.decodePointer();
    if (!pointer) {
      return null;
    }
    return cls.decode(this.decodeAndCreateDecoder(pointer));
  };

  Decoder.prototype.decodeArrayPointer = function(cls) {
    var pointer = this.decodePointer();
    if (!pointer) {
      return null;
    }
    return this.decodeAndCreateDecoder(pointer).decodeArray(cls);
  };

  Decoder.prototype.decodeStringPointer = function() {
    var pointer = this.decodePointer();
    if (!pointer) {
      return null;
    }
    return this.decodeAndCreateDecoder(pointer).decodeString();
  };

  // Encoder ------------------------------------------------------------------

  function Encoder(buffer, handles, base) {
    this.buffer = buffer;
    this.handles = handles;
    this.base = base;
    this.next = base;
  }

  Encoder.prototype.skip = function(offset) {
    this.next += offset;
  };

  Encoder.prototype.writeInt8 = function(val) {
    this.buffer.setInt8(this.next, val);
    this.next += 1;
  };

  Encoder.prototype.writeUint8 = function(val) {
    if (val < 0) {
      throw new Error(kErrorUnsigned);
    }
    this.buffer.setUint8(this.next, val);
    this.next += 1;
  };

  Encoder.prototype.writeInt16 = function(val) {
    this.buffer.setInt16(this.next, val);
    this.next += 2;
  };

  Encoder.prototype.writeUint16 = function(val) {
    if (val < 0) {
      throw new Error(kErrorUnsigned);
    }
    this.buffer.setUint16(this.next, val);
    this.next += 2;
  };

  Encoder.prototype.writeInt32 = function(val) {
    this.buffer.setInt32(this.next, val);
    this.next += 4;
  };

  Encoder.prototype.writeUint32 = function(val) {
    if (val < 0) {
      throw new Error(kErrorUnsigned);
    }
    this.buffer.setUint32(this.next, val);
    this.next += 4;
  };

  Encoder.prototype.writeInt64 = function(val) {
    this.buffer.setInt64(this.next, val);
    this.next += 8;
  };

  Encoder.prototype.writeUint64 = function(val) {
    if (val < 0) {
      throw new Error(kErrorUnsigned);
    }
    this.buffer.setUint64(this.next, val);
    this.next += 8;
  };

  Encoder.prototype.writeFloat = function(val) {
    this.buffer.setFloat32(this.next, val);
    this.next += 4;
  };

  Encoder.prototype.writeDouble = function(val) {
    this.buffer.setFloat64(this.next, val);
    this.next += 8;
  };

  Encoder.prototype.encodePointer = function(pointer) {
    if (!pointer)
      return this.writeUint64(0);
    // TODO(abarth): To correctly encode a pointer, we need to know the real
    // base address of the array buffer.
    var offset = pointer - this.next;
    this.writeUint64(offset);
  };

  Encoder.prototype.createAndEncodeEncoder = function(size) {
    var pointer = this.buffer.alloc(align(size));
    this.encodePointer(pointer);
    return new Encoder(this.buffer, this.handles, pointer);
  };

  Encoder.prototype.encodeHandle = function(handle) {
    this.handles.push(handle);
    this.writeUint32(this.handles.length - 1);
  };

  Encoder.prototype.encodeString = function(val) {
    var base = this.next + kArrayHeaderSize;
    var numberOfElements = unicode.encodeUtf8String(
        val, new Uint8Array(this.buffer.arrayBuffer, base));
    var numberOfBytes = kArrayHeaderSize + numberOfElements;
    this.writeUint32(numberOfBytes);
    this.writeUint32(numberOfElements);
    this.next += numberOfElements;
  };

  Encoder.prototype.encodeArray =
      function(cls, val, numberOfElements, encodedSize) {
    if (numberOfElements === undefined)
      numberOfElements = val.length;
    if (encodedSize === undefined)
      encodedSize = kArrayHeaderSize + cls.encodedSize * numberOfElements;

    this.writeUint32(encodedSize);
    this.writeUint32(numberOfElements);

    if (cls.cls === PackedBool) {
      var byte = 0;
      for (i = 0; i < numberOfElements; ++i) {
        if (val[i])
          byte |= (1 << i % 8);
        if (i % 8 === 7 || i == numberOfElements - 1) {
          Uint8.encode(this, byte);
          byte = 0;
        }
      }
    } else {
      for (var i = 0; i < numberOfElements; ++i)
        cls.encode(this, val[i]);
    }
  };

  Encoder.prototype.encodeStruct = function(cls, val) {
    return cls.encode(this, val);
  };

  Encoder.prototype.encodeStructPointer = function(cls, val) {
    if (!val) {
      this.encodePointer(val);
      return;
    }
    var encoder = this.createAndEncodeEncoder(cls.encodedSize);
    cls.encode(encoder, val);
  };

  Encoder.prototype.encodeArrayPointer = function(cls, val) {
    if (!val) {
      this.encodePointer(val);
      return;
    }
    var numberOfElements = val.length;
    var encodedSize = kArrayHeaderSize + ((cls.cls === PackedBool) ?
        Math.ceil(numberOfElements / 8) : cls.encodedSize * numberOfElements);
    var encoder = this.createAndEncodeEncoder(encodedSize);
    encoder.encodeArray(cls, val, numberOfElements, encodedSize);
  };

  Encoder.prototype.encodeStringPointer = function(val) {
    if (!val) {
      this.encodePointer(val);
      return;
    }
    var encodedSize = kArrayHeaderSize + unicode.utf8Length(val);
    var encoder = this.createAndEncodeEncoder(encodedSize);
    encoder.encodeString(val);
  };

  // Message ------------------------------------------------------------------

  var kMessageNameOffset = kStructHeaderSize;
  var kMessageFlagsOffset = kMessageNameOffset + 4;
  var kMessageRequestIDOffset = kMessageFlagsOffset + 4;

  var kMessageExpectsResponse = 1 << 0;
  var kMessageIsResponse      = 1 << 1;

  function Message(buffer, handles) {
    this.buffer = buffer;
    this.handles = handles;
  }

  Message.prototype.getHeaderNumBytes = function() {
    return this.buffer.getUint32(kStructHeaderNumBytesOffset);
  };

  Message.prototype.getHeaderNumFields = function() {
    return this.buffer.getUint32(kStructHeaderNumFieldsOffset);
  };

  Message.prototype.getFlags = function() {
    return this.buffer.getUint32(kMessageFlagsOffset);
  };

  Message.prototype.isResponse = function() {
    return (this.getFlags() & kMessageIsResponse) != 0;
  };

  Message.prototype.expectsResponse = function() {
    return (this.getFlags() & kMessageExpectsResponse) != 0;
  };

  Message.prototype.setRequestID = function(requestID) {
    // TODO(darin): Verify that space was reserved for this field!
    this.buffer.setUint64(kMessageRequestIDOffset, requestID);
  };

  // MessageBuilder -----------------------------------------------------------

  function MessageBuilder(messageName, payloadSize) {
    // Currently, we don't compute the payload size correctly ahead of time.
    // Instead, we resize the buffer at the end.
    var numberOfBytes = kMessageHeaderSize + payloadSize;
    this.buffer = new buffer.Buffer(numberOfBytes);
    this.handles = [];
    var encoder = this.createEncoder(kMessageHeaderSize);
    encoder.writeUint32(kMessageHeaderSize);
    encoder.writeUint32(2);  // num_fields.
    encoder.writeUint32(messageName);
    encoder.writeUint32(0);  // flags.
  }

  MessageBuilder.prototype.createEncoder = function(size) {
    var pointer = this.buffer.alloc(size);
    return new Encoder(this.buffer, this.handles, pointer);
  };

  MessageBuilder.prototype.encodeStruct = function(cls, val) {
    cls.encode(this.createEncoder(cls.encodedSize), val);
  };

  MessageBuilder.prototype.finish = function() {
    // TODO(abarth): Rather than resizing the buffer at the end, we could
    // compute the size we need ahead of time, like we do in C++.
    this.buffer.trim();
    var message = new Message(this.buffer, this.handles);
    this.buffer = null;
    this.handles = null;
    this.encoder = null;
    return message;
  };

  // MessageWithRequestIDBuilder -----------------------------------------------

  function MessageWithRequestIDBuilder(messageName, payloadSize, flags,
                                       requestID) {
    // Currently, we don't compute the payload size correctly ahead of time.
    // Instead, we resize the buffer at the end.
    var numberOfBytes = kMessageWithRequestIDHeaderSize + payloadSize;
    this.buffer = new buffer.Buffer(numberOfBytes);
    this.handles = [];
    var encoder = this.createEncoder(kMessageWithRequestIDHeaderSize);
    encoder.writeUint32(kMessageWithRequestIDHeaderSize);
    encoder.writeUint32(3);  // num_fields.
    encoder.writeUint32(messageName);
    encoder.writeUint32(flags);
    encoder.writeUint64(requestID);
  }

  MessageWithRequestIDBuilder.prototype =
      Object.create(MessageBuilder.prototype);

  MessageWithRequestIDBuilder.prototype.constructor =
      MessageWithRequestIDBuilder;

  // MessageReader ------------------------------------------------------------

  function MessageReader(message) {
    this.decoder = new Decoder(message.buffer, message.handles, 0);
    var messageHeaderSize = this.decoder.readUint32();
    this.payloadSize = message.buffer.byteLength - messageHeaderSize;
    var numFields = this.decoder.readUint32();
    this.messageName = this.decoder.readUint32();
    this.flags = this.decoder.readUint32();
    if (numFields >= 3)
      this.requestID = this.decoder.readUint64();
    this.decoder.skip(messageHeaderSize - this.decoder.next);
  }

  MessageReader.prototype.decodeStruct = function(cls) {
    return cls.decode(this.decoder);
  };

  // Built-in types -----------------------------------------------------------

  // This type is only used with ArrayOf(PackedBool).
  function PackedBool() {
  }

  function Int8() {
  }

  Int8.encodedSize = 1;

  Int8.decode = function(decoder) {
    return decoder.readInt8();
  };

  Int8.encode = function(encoder, val) {
    encoder.writeInt8(val);
  };

  Uint8.encode = function(encoder, val) {
    encoder.writeUint8(val);
  };

  function Uint8() {
  }

  Uint8.encodedSize = 1;

  Uint8.decode = function(decoder) {
    return decoder.readUint8();
  };

  Uint8.encode = function(encoder, val) {
    encoder.writeUint8(val);
  };

  function Int16() {
  }

  Int16.encodedSize = 2;

  Int16.decode = function(decoder) {
    return decoder.readInt16();
  };

  Int16.encode = function(encoder, val) {
    encoder.writeInt16(val);
  };

  function Uint16() {
  }

  Uint16.encodedSize = 2;

  Uint16.decode = function(decoder) {
    return decoder.readUint16();
  };

  Uint16.encode = function(encoder, val) {
    encoder.writeUint16(val);
  };

  function Int32() {
  }

  Int32.encodedSize = 4;

  Int32.decode = function(decoder) {
    return decoder.readInt32();
  };

  Int32.encode = function(encoder, val) {
    encoder.writeInt32(val);
  };

  function Uint32() {
  }

  Uint32.encodedSize = 4;

  Uint32.decode = function(decoder) {
    return decoder.readUint32();
  };

  Uint32.encode = function(encoder, val) {
    encoder.writeUint32(val);
  };

  function Int64() {
  }

  Int64.encodedSize = 8;

  Int64.decode = function(decoder) {
    return decoder.readInt64();
  };

  Int64.encode = function(encoder, val) {
    encoder.writeInt64(val);
  };

  function Uint64() {
  }

  Uint64.encodedSize = 8;

  Uint64.decode = function(decoder) {
    return decoder.readUint64();
  };

  Uint64.encode = function(encoder, val) {
    encoder.writeUint64(val);
  };

  function String() {
  };

  String.encodedSize = 8;

  String.decode = function(decoder) {
    return decoder.decodeStringPointer();
  };

  String.encode = function(encoder, val) {
    encoder.encodeStringPointer(val);
  };

  function Float() {
  }

  Float.encodedSize = 4;

  Float.decode = function(decoder) {
    return decoder.readFloat();
  };

  Float.encode = function(encoder, val) {
    encoder.writeFloat(val);
  };

  function Double() {
  }

  Double.encodedSize = 8;

  Double.decode = function(decoder) {
    return decoder.readDouble();
  };

  Double.encode = function(encoder, val) {
    encoder.writeDouble(val);
  };

  function PointerTo(cls) {
    this.cls = cls;
  }

  PointerTo.prototype.encodedSize = 8;

  PointerTo.prototype.decode = function(decoder) {
    var pointer = decoder.decodePointer();
    if (!pointer) {
      return null;
    }
    return this.cls.decode(decoder.decodeAndCreateDecoder(pointer));
  };

  PointerTo.prototype.encode = function(encoder, val) {
    if (!val) {
      encoder.encodePointer(val);
      return;
    }
    var objectEncoder = encoder.createAndEncodeEncoder(this.cls.encodedSize);
    this.cls.encode(objectEncoder, val);
  };

  function ArrayOf(cls) {
    this.cls = cls;
  }

  ArrayOf.prototype.encodedSize = 8;

  ArrayOf.prototype.decode = function(decoder) {
    return decoder.decodeArrayPointer(this.cls);
  };

  ArrayOf.prototype.encode = function(encoder, val) {
    encoder.encodeArrayPointer(this.cls, val);
  };

  function Handle() {
  }

  Handle.encodedSize = 4;

  Handle.decode = function(decoder) {
    return decoder.decodeHandle();
  };

  Handle.encode = function(encoder, val) {
    encoder.encodeHandle(val);
  };

  var exports = {};
  exports.align = align;
  exports.isAligned = isAligned;
  exports.Message = Message;
  exports.MessageBuilder = MessageBuilder;
  exports.MessageWithRequestIDBuilder = MessageWithRequestIDBuilder;
  exports.MessageReader = MessageReader;
  exports.kArrayHeaderSize = kArrayHeaderSize;
  exports.kStructHeaderSize = kStructHeaderSize;
  exports.kMessageHeaderSize = kMessageHeaderSize;
  exports.kMessageWithRequestIDHeaderSize = kMessageWithRequestIDHeaderSize;
  exports.kMessageExpectsResponse = kMessageExpectsResponse;
  exports.kMessageIsResponse = kMessageIsResponse;
  exports.Int8 = Int8;
  exports.Uint8 = Uint8;
  exports.Int16 = Int16;
  exports.Uint16 = Uint16;
  exports.Int32 = Int32;
  exports.Uint32 = Uint32;
  exports.Int64 = Int64;
  exports.Uint64 = Uint64;
  exports.Float = Float;
  exports.Double = Double;
  exports.String = String;
  exports.PointerTo = PointerTo;
  exports.ArrayOf = ArrayOf;
  exports.PackedBool = PackedBool;
  exports.Handle = Handle;
  return exports;
});


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">

  <title>Qt 4.3: QWizard Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />

  	Home · All Classes · Main Classes · Grouped Classes · Modules · Functions

QWizard Class Reference
[QtGui module]

The QWizard class provides a framework for wizards. More...

 #include <QWizard>

Inherits QDialog.

This class was introduced in Qt 4.3.

List of all members, including inherited members

Public Types

enum WizardButton { BackButton, NextButton, CommitButton, FinishButton, ..., Stretch }

enum WizardOption { IndependentPages, IgnoreSubTitles, ExtendedWatermarkPixmap, NoDefaultButton, ..., HaveCustomButton3 }

flags WizardOptions

enum WizardPixmap { WatermarkPixmap, LogoPixmap, BannerPixmap, BackgroundPixmap }

enum WizardStyle { ClassicStyle, ModernStyle, MacStyle, AeroStyle }

Properties

currentId : const int

options : WizardOptions

startId : int

subTitleFormat : Qt::TextFormat

titleFormat : Qt::TextFormat

wizardStyle : WizardStyle

2 properties inherited from QDialog

56 properties inherited from QWidget

1 property inherited from QObject

Public Functions

QWizard ( QWidget * parent = 0, Qt::WindowFlags flags = 0 )

~QWizard ()

int addPage ( QWizardPage * page )

QAbstractButton * button ( WizardButton which ) const

QString buttonText ( WizardButton which ) const

int currentId () const

QWizardPage * currentPage () const

QVariant field ( const QString & name ) const

bool hasVisitedPage ( int id ) const

virtual int nextId () const

WizardOptions options () const

QWizardPage * page ( int id ) const

QPixmap pixmap ( WizardPixmap which ) const

void setButton ( WizardButton which, QAbstractButton * button )

void setButtonLayout ( const QList<WizardButton> & layout )

void setButtonText ( WizardButton which, const QString & text )

void setDefaultProperty ( const char * className, const char * property, const char * changedSignal )

void setField ( const QString & name, const QVariant & value )

void setOption ( WizardOption option, bool on = true )

void setOptions ( WizardOptions options )

void setPage ( int id, QWizardPage * page )

void setPixmap ( WizardPixmap which, const QPixmap & pixmap )

void setStartId ( int id )

void setSubTitleFormat ( Qt::TextFormat format )

void setTitleFormat ( Qt::TextFormat format )

void setWizardStyle ( WizardStyle style )

int startId () const

Qt::TextFormat subTitleFormat () const

bool testOption ( WizardOption option ) const

Qt::TextFormat titleFormat () const

virtual bool validateCurrentPage ()

QList<int> visitedPages () const

WizardStyle wizardStyle () const

5 public functions inherited from QDialog

201 public functions inherited from QWidget

29 public functions inherited from QObject

12 public functions inherited from QPaintDevice

Public Slots

void back ()

void next ()

void restart ()

4 public slots inherited from QDialog

19 public slots inherited from QWidget

1 public slot inherited from QObject

Signals

void currentIdChanged ( int id )

void customButtonClicked ( int which )

void helpRequested ()

3 signals inherited from QDialog

1 signal inherited from QWidget

1 signal inherited from QObject

Protected Functions

virtual void cleanupPage ( int id )

virtual void initializePage ( int id )

38 protected functions inherited from QWidget

7 protected functions inherited from QObject

1 protected function inherited from QPaintDevice

Additional Inherited Members

4 static public members inherited from QWidget

5 static public members inherited from QObject

1 protected slot inherited from QWidget

Detailed Description

The QWizard class provides a framework for wizards.

A wizard (also called an assistant on Mac OS X) is a special type of input dialog that consists of a sequence of pages. A wizard's purpose is to guide the user through a process step by step. Wizards are useful for complex or infrequent tasks that users may find difficult to learn.

QWizard inherits QDialog and represents a wizard. Each page is a QWizardPage (a QWidget subclass). To create your own wizards, you can use these classes directly, or you can subclass them for more control.

Topics:

A Trivial Example

Wizard Look and Feel

Elements of a Wizard Page

Registering and Using Fields

Creating Linear Wizards

Creating Non-Linear Wizards

A Trivial Example

The following example illustrates how to create wizard pages and add them to a wizard. For more advanced examples, see Class Wizard and License Wizard.

 QWizardPage *createIntroPage()
 {
     QWizardPage *page = new QWizardPage;
     page->setTitle("Introduction");

     QLabel *label = new QLabel("This wizard will help you register your copy "
                                "of Super Product Two.");
     label->setWordWrap(true);

     QVBoxLayout *layout = new QVBoxLayout;
     layout->addWidget(label);
     page->setLayout(layout);

     return page;
 }

 QWizardPage *createRegistrationPage()
 {
     ...
 }

 QWizardPage *createConclusionPage()
 {
     ...
 }

 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);

     QString translatorFileName = QLatin1String("qt_");
     translatorFileName += QLocale::system().name();
     QTranslator *translator = new QTranslator(&app);
     if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
         app.installTranslator(translator);

     QWizard wizard;
     wizard.addPage(createIntroPage());
     wizard.addPage(createRegistrationPage());
     wizard.addPage(createConclusionPage());

     wizard.setWindowTitle("Trivial Wizard");
     wizard.show();

     return app.exec();
 }

Wizard Look and Feel

QWizard supports four wizard looks:

ClassicStyle

ModernStyle

MacStyle

AeroStyle

You can explicitly set the look to use using setWizardStyle() (e.g., if you want the same look on all platforms).

ClassicStyle	ModernStyle	MacStyle	AeroStyle

Note: AeroStyle has effect only on a Windows Vista system with alpha compositing enabled. ModernStyle is used as a fallback when this condition is not met.

In addition to the wizard style, there are several options that control the look and feel of the wizard. These can be set using setOption() or setOptions(). For example, HaveHelpButton makes QWizard show a Help button along with the other wizard buttons.

You can even change the order of the wizard buttons to any arbitrary order using setButtonLayout(), and you can add up to three custom buttons (e.g., a Print button) to the button row. This is achieved by calling setButton() or setButtonText() with CustomButton1, CustomButton2, or CustomButton3 to set up the button, and by enabling the HaveCustomButton1, HaveCustomButton2, or HaveCustomButton3 options. Whenever the user clicks a custom button, customButtonClicked() is emitted. For example:

         wizard()->setButtonText(QWizard::CustomButton1, tr("&Print"));
         wizard()->setOption(QWizard::HaveCustomButton1, true);
         connect(wizard(), SIGNAL(customButtonClicked(int)),
                 this, SLOT(printButtonClicked()));

Elements of a Wizard Page

Wizards consist of a sequence of QWizardPages. At any time, only one page is shown. A page has the following attributes:

A title.

A subTitle.

A set of pixmaps, which may or may not be honored, depending on the wizard's style:

WatermarkPixmap (used by ClassicStyle and ModernStyle)

BannerPixmap (used by ModernStyle)

LogoPixmap (used by ClassicStyle and ModernStyle)

BackgroundPixmap (used by MacStyle)

The diagram belows showns how QWizard renders these attributes, assuming they are all present and ModernStyle is used:

When a subTitle is set, QWizard displays it in a header, in which case it also uses the BannerPixmap and the LogoPixmap to decorate the header. The WatermarkPixmap is displayed on the left side, below the header. At the bottom, there is a row of buttons allowing the user to navigate through the pages.

The page itself (the QWizardPage widget) occupies the area between the header, the watermark, and the button row. Typically, the page is a QWizardPage on which a QGridLayout is installed, with standard child widgets (QLabels, QLineEdits, etc.).

If the wizard's style is MacStyle, the page looks radically different:

The watermark, banner, and logo pixmaps are ignored by the MacStyle. If the BackgroundPixmap is set, it is used as the background for the wizard; otherwise, a default "assistant" image is used.

The title and subtitle are set by calling QWizardPage::setTitle() and QWizardPage::setSubTitle() on the individual pages. They may be plain text or HTML (see titleFormat and subTitleFormat). The pixmaps can be set globally for the entire wizard using setPixmap(), or on a per-page basis using QWizardPage::setPixmap().

Registering and Using Fields

In many wizards, the contents of a page may affect the default values of the fields of a later page. To make it easy to communicate between pages, QWizard supports a "field" mechanism that allows you to register a field (e.g., a QLineEdit) on a page and to access its value from any page. It is also possible to specify mandatory fields (i.e., fields that must be filled before the user can advance to the next page).

To register a field, call QWizardPage::registerField() field. For example:

 ClassInfoPage::ClassInfoPage(QWidget *parent)
     : QWizardPage(parent)
 {
     ...
     classNameLabel = new QLabel(tr("&Class name:"));
     classNameLineEdit = new QLineEdit;
     classNameLabel->setBuddy(classNameLineEdit);

     baseClassLabel = new QLabel(tr("B&ase class:"));
     baseClassLineEdit = new QLineEdit;
     baseClassLabel->setBuddy(baseClassLineEdit);

     qobjectMacroCheckBox = new QCheckBox(tr("Generate Q_OBJECT &macro"));

     registerField("className*", classNameLineEdit);
     registerField("baseClass", baseClassLineEdit);
     registerField("qobjectMacro", qobjectMacroCheckBox);
     ...
 }

The above code registers three fields, <tt>className</tt>, <tt>baseClass</tt>, and <tt>qobjectMacro</tt>, which are associated with three child widgets. The asterisk (<tt>*</tt>) next to <tt>className</tt> denotes a mandatory field.

The fields of any page are accessible from any other page. For example:

 void OutputFilesPage::initializePage()
 {
     QString className = field("className").toString();
     headerLineEdit->setText(className.toLower() + ".h");
     implementationLineEdit->setText(className.toLower() + ".cpp");
     outputDirLineEdit->setText(QDir::convertSeparators(QDir::tempPath()));
 }

Here, we call QWizardPage::field() to access the contents of the <tt>className</tt> field (which was defined in the <tt>ClassInfoPage</tt>) and use it to initialize the <tt>OuputFilePage</tt>. The field's contents is returned as a QVariant.

When we create a field using QWizardPage::registerField(), we pass a unique field name and a widget. We can also provide a Qt property name and a "changed" signal (a signal that is emitted when the property changes) as third and fourth arguments; however, this is not necessary for the most common Qt widgets, such as QLineEdit, QCheckBox, and QComboBox, because QWizard knows which properties to look for.

If an asterisk (<tt>*</tt>) is appended to the name when the property is registered, the field is a mandatory field. When a page has mandatory fields, the Next and/or Finish buttons are enabled only when all mandatory fields are filled.

To consider a field "filled", QWizard simply checks that the field's current value doesn't equal the original value (the value it had when initializePage() was called). For QLineEdit, QWizard also checks that hasAcceptableInput() returns true, to honor any validator or mask.

QWizard's mandatory field mechanism is provided for convenience. A more powerful (but also more cumbersome) alternative is to reimplement QWizardPage::isComplete() and to emit the QWizardPage::completeChanged() signal whenever the page becomes complete or incomplete.

The enabled/disabled state of the Next and/or Finish buttons is one way to perform validation on the user input. Another way is to reimplement validateCurrentPage() (or QWizardPage::validatePage()) to perform some last-minute validation (and show an error message if the user has entered incomplete or invalid information). If the function returns true, the next page is shown (or the wizard finishes); otherwise, the current page stays up.

Creating Linear Wizards

Most wizards have a linear structure, with page 1 followed by page 2 and so on until the last page. The Class Wizard example is such a wizard. With QWizard, linear wizards are created by instantiating the QWizardPages and inserting them using addPage(). By default, the pages are shown in the order in which they were added. For example:

 ClassWizard::ClassWizard(QWidget *parent)
     : QWizard(parent)
 {
     addPage(new IntroPage);
     addPage(new ClassInfoPage);
     addPage(new CodeStylePage);
     addPage(new OutputFilesPage);
     addPage(new ConclusionPage);
     ...
 }

When a page is about to be shown, QWizard calls initializePage() (which in turn calls QWizardPage::initializePage()) to fill the page with default values. By default, this function does nothing, but it can be reimplemented to initialize the page's contents based on other pages' fields (see the example above).

If the user presses Back, cleanupPage() is called (which in turn calls QWizardPage::cleanupPage()). The default implementation resets the page's fields to their original values (the values they had before initializePage() was called). If you want the Back button to be non-destructive and keep the values entered by the user, simply enable the IndependentPages option.

Creating Non-Linear Wizards

Some wizards are more complex in that they allow different traversal paths based on the information provided by the user. The License Wizard example illustrates this. It provides five wizard pages; depending on which options are selected, the user can reach different pages.

In complex wizards, pages are identified by IDs. These IDs are typically defined using an enum. For example:

 class LicenseWizard : public QWizard
 {
     ...
     enum { Page_Intro, Page_Evaluate, Page_Register, Page_Details,
            Page_Conclusion };
     ...
 };

The pages are inserted using setPage(), which takes an ID and an instance of QWizardPage (or of a subclass):

 LicenseWizard::LicenseWizard(QWidget *parent)
     : QWizard(parent)
 {
     setPage(Page_Intro, new IntroPage);
     setPage(Page_Evaluate, new EvaluatePage);
     setPage(Page_Register, new RegisterPage);
     setPage(Page_Details, new DetailsPage);
     setPage(Page_Conclusion, new ConclusionPage);
     ...
 }

By default, the pages are shown in increasing ID order. To provide a dynamic order that depends on the options chosen by the user, we must reimplement QWizardPage::nextId(). For example:

 int IntroPage::nextId() const
 {
     if (evaluateRadioButton->isChecked()) {
         return LicenseWizard::Page_Evaluate;
     } else {
         return LicenseWizard::Page_Register;
     }
 }

 int EvaluatePage::nextId() const
 {
     return LicenseWizard::Page_Conclusion;
 }

 int RegisterPage::nextId() const
 {
     if (upgradeKeyLineEdit->text().isEmpty()) {
         return LicenseWizard::Page_Details;
     } else {
         return LicenseWizard::Page_Conclusion;
     }
 }

 int DetailsPage::nextId() const
 {
     return LicenseWizard::Page_Conclusion;
 }

 int ConclusionPage::nextId() const
 {
     return -1;
 }

It would also be possible to put all the logic in one place, in a QWizard::nextId() reimplementation. For example:

 int LicenseWizard::nextId() const
 {
     switch (currentId()) {
     case Page_Intro:
         if (field("intro.evaluate").toBool()) {
             return Page_Evaluate;
         } else {
             return Page_Register;
         }
     case Page_Evaluate:
         return Page_Conclusion;
     case Page_Register:
         if (field("register.upgradeKey").toString().isEmpty()) {
             return Page_Details;
         } else {
             return Page_Conclusion;
         }
     case Page_Details:
         return Page_Conclusion;
     case Page_Conclusion:
     default:
         return -1;
     }
 }

To start at another page than the page with the lowest ID, call setStartId().

To test whether a page has been visited or not, call hasVisitedPage(). For example:

 void ConclusionPage::initializePage()
 {
     QString licenseText;

     if (wizard()->hasVisitedPage(LicenseWizard::Page_Evaluate)) {
         licenseText = tr("<u>Evaluation License Agreement:</u> "
                          "You can use this software for 30 days and make one "
                          "backup, but you are not allowed to distribute it.");
     } else if (wizard()->hasVisitedPage(LicenseWizard::Page_Details)) {
         licenseText = tr("<u>First-Time License Agreement:</u> "
                          "You can use this software subject to the license "
                          "you will receive by email.");
     } else {
         licenseText = tr("<u>Upgrade License Agreement:</u> "
                          "This software is licensed under the terms of your "
                          "current license.");
     }
     bottomLabel->setText(licenseText);
 }

See also QWizardPage, Class Wizard Example, and License Wizard Example.

Member Type Documentation

enum QWizard::WizardButton

This enum specifies the buttons in a wizard.

Constant	Value	Description

<tt>QWizard::BackButton</tt>	<tt>0</tt>	The Back button (Go Back on Mac OS X)

<tt>QWizard::NextButton</tt>	<tt>1</tt>	The Next button (Continue on Mac OS X)

<tt>QWizard::CommitButton</tt>	<tt>2</tt>	The Commit button

<tt>QWizard::FinishButton</tt>	<tt>3</tt>	The Finish button (Done on Mac OS X)

<tt>QWizard::CancelButton</tt>	<tt>4</tt>	The Cancel button (see also NoCancelButton)

<tt>QWizard::HelpButton</tt>	<tt>5</tt>	The Help button (see also HaveHelpButton)

<tt>QWizard::CustomButton1</tt>	<tt>6</tt>	The first user-defined button (see also HaveCustomButton1)

<tt>QWizard::CustomButton2</tt>	<tt>7</tt>	The second user-defined button (see also HaveCustomButton2)

<tt>QWizard::CustomButton3</tt>	<tt>8</tt>	The third user-defined button (see also HaveCustomButton3)

The following value is only useful when calling setButtonLayout():

Constant	Value	Description

<tt>QWizard::Stretch</tt>	<tt>9</tt>	A horizontal stretch in the button layout

See also setButton(), setButtonText(), setButtonLayout(), and customButtonClicked().

enum QWizard::WizardOption
flags QWizard::WizardOptions

This enum specifies various options that affect the look and feel of a wizard.

Constant	Value	Description

<tt>QWizard::IndependentPages</tt>	<tt>0x00000001</tt>	The pages are independent of each other (i.e., they don't derive values from each other).

<tt>QWizard::IgnoreSubTitles</tt>	<tt>0x00000002</tt>	Don't show any subtitles, even if they are set.

<tt>QWizard::ExtendedWatermarkPixmap</tt>	<tt>0x00000004</tt>	Extend any WatermarkPixmap all the way down to the window's edge.

<tt>QWizard::NoDefaultButton</tt>	<tt>0x00000008</tt>	Don't make the Next or Finish button the dialog's default button.

<tt>QWizard::NoBackButtonOnStartPage</tt>	<tt>0x00000010</tt>	Don't show the Back button on the start page.

<tt>QWizard::NoBackButtonOnLastPage</tt>	<tt>0x00000020</tt>	Don't show the Back button on the last page.

<tt>QWizard::DisabledBackButtonOnLastPage</tt>	<tt>0x00000040</tt>	Disable the Back button on the last page.

<tt>QWizard::HaveNextButtonOnLastPage</tt>	<tt>0x00000080</tt>	Show the (disabled) Next button on the last page.

<tt>QWizard::HaveFinishButtonOnEarlyPages</tt>	<tt>0x00000100</tt>	Show the (disabled) Finish button on non-final pages.

<tt>QWizard::NoCancelButton</tt>	<tt>0x00000200</tt>	Don't show the Cancel button.

<tt>QWizard::CancelButtonOnLeft</tt>	<tt>0x00000400</tt>	Put the Cancel button on the left of Back (rather than on the right of Finish or Next).

<tt>QWizard::HaveHelpButton</tt>	<tt>0x00000800</tt>	Show the Help button.

<tt>QWizard::HelpButtonOnRight</tt>	<tt>0x00001000</tt>	Put the Help button on the far right of the button layout (rather than on the far left).

<tt>QWizard::HaveCustomButton1</tt>	<tt>0x00002000</tt>	Show the first user-defined button (CustomButton1).

<tt>QWizard::HaveCustomButton2</tt>	<tt>0x00004000</tt>	Show the second user-defined button (CustomButton2).

<tt>QWizard::HaveCustomButton3</tt>	<tt>0x00008000</tt>	Show the third user-defined button (CustomButton3).

The WizardOptions type is a typedef for QFlags<WizardOption>. It stores an OR combination of WizardOption values.

See also setOptions(), setOption(), and testOption().

enum QWizard::WizardPixmap

This enum specifies the pixmaps that can be associated with a page.

Constant	Value	Description

<tt>QWizard::WatermarkPixmap</tt>	<tt>0</tt>	The tall pixmap on the left side of a ClassicStyle or ModernStyle page

<tt>QWizard::LogoPixmap</tt>	<tt>1</tt>	The small pixmap on the right side of a ClassicStyle or ModernStyle page header

<tt>QWizard::BannerPixmap</tt>	<tt>2</tt>	The pixmap that occupies the background of a ModernStyle page header

<tt>QWizard::BackgroundPixmap</tt>	<tt>3</tt>	The pixmap that occupies the background of a MacStyle wizard

See also setPixmap(), QWizardPage::setPixmap(), and Elements of a Wizard Page.

enum QWizard::WizardStyle

This enum specifies the different looks supported by QWizard.

Constant	Value	Description

<tt>QWizard::ClassicStyle</tt>	<tt>0</tt>	Classic Windows look

<tt>QWizard::ModernStyle</tt>	<tt>1</tt>	Modern Windows look

<tt>QWizard::MacStyle</tt>	<tt>2</tt>	Mac OS X look

<tt>QWizard::AeroStyle</tt>	<tt>3</tt>	Windows Aero look

See also setWizardStyle(), WizardOption, and Wizard Look and Feel.

Property Documentation

currentId : const int

This property holds the ID of the current page.

This property cannot be set directly. To change the current page, call next(), back(), or restart().

Access functions:

int currentId () const

See also currentIdChanged() and currentPage().

options : WizardOptions

This property holds the various options that affect the look and feel of the wizard.

By default, the following options are set (depending on the platform):

Windows: HelpButtonOnRight.

Mac OS X: NoDefaultButton and NoCancelButton.

X11 and QWS (Qtopia Core): none.

Access functions:

WizardOptions options () const

void setOptions ( WizardOptions options )

See also wizardStyle.

startId : int

This property holds the ID of the first page.

If this property isn't explicitly set, this property defaults to the lowest page ID in this wizard, or -1 if no page has been inserted yet.

Access functions:

int startId () const

void setStartId ( int id )

See also restart() and nextId().

subTitleFormat : Qt::TextFormat

This property holds the text format used by page subtitles.

The default format is Qt::AutoText.

Access functions:

Qt::TextFormat subTitleFormat () const

void setSubTitleFormat ( Qt::TextFormat format )

See also QWizardPage::title and titleFormat.

titleFormat : Qt::TextFormat

This property holds the text format used by page titles.

The default format is Qt::AutoText.

Access functions:

Qt::TextFormat titleFormat () const

void setTitleFormat ( Qt::TextFormat format )

See also QWizardPage::title and subTitleFormat.

wizardStyle : WizardStyle

This property holds the look and feel of the wizard.

By default, QWizard uses the AeroStyle on a Windows Vista system with alpha compositing enabled, regardless of the current widget style. If this is not the case, the default wizard style depends on the current widget style as follows: MacStyle is the default if the current widget style is QMacStyle, ModernStyle is the default if the current widget style is QWindowsStyle, and ClassicStyle is the default in all other cases.

Access functions:

WizardStyle wizardStyle () const

void setWizardStyle ( WizardStyle style )

See also Wizard Look and Feel and options.

Member Function Documentation

QWizard::QWizard ( QWidget * parent = 0, Qt::WindowFlags flags = 0 )

Constructs a wizard with the given parent and window flags.

See also parent() and windowFlags().

QWizard::~QWizard ()

Destroys the wizard and its pages, releasing any allocated resources.

int QWizard::addPage ( QWizardPage * page )

Adds the given page to the wizard, and returns the page's ID.

The ID is guaranteed to be larger than any other ID in the QWizard so far.

See also setPage() and page().

void QWizard::back ()  <tt> [slot]</tt>

Goes back to the previous page.

This is equivalent to pressing the Back button.

See also next(), accept(), reject(), and restart().

QAbstractButton * QWizard::button ( WizardButton which ) const

Returns the button corresponding to role which.

See also setButton() and setButtonText().

QString QWizard::buttonText ( WizardButton which ) const

Returns the text on button which.

If a text has ben set using setButtonText(), this text is returned.

By default, the text on buttons depends on the wizardStyle. For example, on Mac OS X, the Next button is called Continue.

See also button(), setButton(), setButtonText(), QWizardPage::buttonText(), and QWizardPage::setButtonText().

void QWizard::cleanupPage ( int id )  <tt> [virtual protected]</tt>

This virtual function is called by QWizard when the user clicks Back (unless the QWizard::IndependentPages option is set).

The default implementation calls QWizardPage::cleanupPage() on page(id).

See also QWizardPage::cleanupPage() and initializePage().

void QWizard::currentIdChanged ( int id )  <tt> [signal]</tt>

This signal is emitted when the current page changes, with the new current id.

See also currentId() and currentPage().

QWizardPage * QWizard::currentPage () const

Returns a pointer to the current page, or 0 if there is no current page (e.g., before the wizard is shown).

This is equivalent to calling page(currentId()).

See also page(), currentId(), and restart().

void QWizard::customButtonClicked ( int which )  <tt> [signal]</tt>

This signal is emitted when the user clicks a custom button. which can be CustomButton1, CustomButton2, or CustomButton3.

By default, no custom button is shown. Call setOption() with HaveCustomButton1, HaveCustomButton2, or HaveCustomButton3 to have one, and use setButtonText() or setButton() to configure it.

See also helpRequested().

QVariant QWizard::field ( const QString & name ) const

Returns the value of the field called name.

This function can be used to access fields on any page of the wizard.

See also QWizardPage::registerField(), QWizardPage::field(), and setField().

bool QWizard::hasVisitedPage ( int id ) const

Returns true if the page history contains page id; otherwise, returns false.

Pressing Back marks the current page as "unvisited" again.

See also visitedPages().

void QWizard::helpRequested ()  <tt> [signal]</tt>

This signal is emitted when the user clicks the Help button.

By default, no Help button is shown. Call setOption(HaveHelpButton, true) to have one.

Example:

 LicenseWizard::LicenseWizard(QWidget *parent)
     : QWizard(parent)
 {
     ...
     setOption(HaveHelpButton, true);
     connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));
     ...
 }

 void LicenseWizard::showHelp()
 {
     static QString lastHelpMessage;

     QString message;

     switch (currentId()) {
     case Page_Intro:
         message = tr("The decision you make here will affect which page you "
                      "get to see next.");
         break;
     ...
     default:
         message = tr("This help is likely not to be of any help.");
     }

     QMessageBox::information(this, tr("License Wizard Help"), message);

 }

See also customButtonClicked().

void QWizard::initializePage ( int id )  <tt> [virtual protected]</tt>

This virtual function is called by QWizard to prepare page id just before it is shown. (However, if the QWizard::IndependentPages option is set, this function is only called the first time the page is shown.)

By reimplementing this function, you can ensure that the page's fields are properly initialized based on fields from previous pages.

The default implementation calls QWizardPage::initializePage() on page(id).

See also QWizardPage::initializePage() and cleanupPage().

void QWizard::next ()  <tt> [slot]</tt>

Advances to the next page.

This is equivalent to pressing the Next or Commit button.

See also nextId(), back(), accept(), reject(), and restart().

int QWizard::nextId () const  <tt> [virtual]</tt>

This virtual function is called by QWizard to find out which page to show when the user clicks the Next button.

The default implementation calls QWizardPage::nextId() on the currentPage().

See also QWizardPage::nextId() and currentPage().

QWizardPage * QWizard::page ( int id ) const

Returns the page with the given id, or 0 if there is no such page.

See also addPage() and setPage().

QPixmap QWizard::pixmap ( WizardPixmap which ) const

Returns the pixmap set for role which.

By default, the only pixmap that is set is the BackgroundPixmap on Mac OS X.

See also setPixmap(), QWizardPage::pixmap(), and Elements of a Wizard Page.

void QWizard::restart ()  <tt> [slot]</tt>

Restarts the wizard at the start page.

See also startId().

void QWizard::setButton ( WizardButton which, QAbstractButton * button )

Sets the button corresponding to role which to button.

To add extra buttons to the wizard (e.g., a Print button), one way is to call setButton() with CustomButton1 to CustomButton3, and make the buttons visible using the HaveCustomButton1 to HaveCustomButton3 options.

See also button(), setButtonText(), setButtonLayout(), and options.

void QWizard::setButtonLayout ( const QList<WizardButton> & layout )

Sets the order in which buttons are displayed to layout, where layout is a list of WizardButtons.

The default layout depends on the options (e.g., whether HelpButtonOnRight) that are set. You can call this function if you need more control over the buttons' layout than what options already provides.

You can specify horizontal stretches in the layout using Stretch.

Example:

 MyWizard::MyWizard(QWidget *parent)
     : QWizard(parent)
 {
     ...
     QList<QWizard::WizardButton> layout;
     layout << QWizard::Stretch << QWizard::BackButton << QWizard::CloseButton
            << QWizard::NextButton << QWizard::FinishButton;
     setButtonLayout(layout);
     ...
 }

See also setButton(), setButtonText(), and setOptions().

void QWizard::setButtonText ( WizardButton which, const QString & text )

Sets the text on button which to be text.

By default, the text on buttons depends on the wizardStyle. For example, on Mac OS X, the Next button is called Continue.

To add extra buttons to the wizard (e.g., a Print button), one way is to call setButtonText() with CustomButton1, CustomButton2, or CustomButton3 to set their text, and make the buttons visible using the HaveCustomButton1, HaveCustomButton2, and/or HaveCustomButton3 options.

Button texts may also be set on a per-page basis using QWizardPage::setButtonText().

See also buttonText(), setButton(), button(), setButtonLayout(), setOptions(), and QWizardPage::setButtonText().

void QWizard::setDefaultProperty ( const char * className, const char * property, const char * changedSignal )

Sets the default property for className to be property, and the associated change signal to be changedSignal.

The default property is used when an instance of className (or of one of its subclasses) is passed to QWizardPage::registerField() and no property is specified.

QWizard knows the most common Qt widgets. For these (or their subclasses), you don't need to specify a property or a changedSignal. The table below lists these widgets:

Widget	Property	Change Notification Signal

QAbstractButton	bool checked	toggled()

QAbstractSlider	int value	valueChanged()

QComboBox	int currentIndex	currentIndexChanged()

QDateTimeEdit	QDateTime dateTime	dateTimeChanged()

QLineEdit	QString text	textChanged()

QListWidget	int currentRow	currentRowChanged()

QSpinBox	int value	valueChanged()

See also QWizardPage::registerField().

void QWizard::setField ( const QString & name, const QVariant & value )

Sets the value of the field called name to value.

This function can be used to set fields on any page of the wizard.

See also QWizardPage::registerField(), QWizardPage::setField(), and field().

void QWizard::setOption ( WizardOption option, bool on = true )

Sets the given option to be enabled if on is true; otherwise, clears the given option.

See also options, testOption(), and setWizardStyle().

void QWizard::setPage ( int id, QWizardPage * page )

Adds the given page to the wizard with the given id.

See also addPage() and page().

void QWizard::setPixmap ( WizardPixmap which, const QPixmap & pixmap )

Sets the pixmap for role which to pixmap.

The pixmaps are used by QWizard when displaying a page. Which pixmaps are actually used depend on the wizard style.

Pixmaps can also be set for a specific page using QWizardPage::setPixmap().

See also pixmap(), QWizardPage::setPixmap(), and Elements of a Wizard Page.

bool QWizard::testOption ( WizardOption option ) const

Returns true if the given option is enabled; otherwise, returns false.

See also options, setOption(), and setWizardStyle().

bool QWizard::validateCurrentPage ()  <tt> [virtual]</tt>

This virtual function is called by QWizard when the user clicks Next or Finish to perform some last-minute validation. If it returns true, the next page is shown (or the wizard finishes); otherwise, the current page stays up.

The default implementation calls QWizardPage::validatePage() on the currentPage().

When possible, it is usually better style to disable the Next or Finish button (by specifying mandatory fields or by reimplementing QWizardPage::isComplete()) than to reimplement validateCurrentPage().

See also QWizardPage::validatePage() and currentPage().

QList<int> QWizard::visitedPages () const

Returns the list of visited pages, in the order in which they were visited.

Pressing Back marks the current page as "unvisited" again.

See also hasVisitedPage().

<address>

Copyright © 2008 Trolltech
Trademarks

Qt 4.3.5

</address>


text:
import { ConfigParams } from './ConfigParams';
import { FileConfigReader } from './FileConfigReader';
export declare class YamlConfigReader extends FileConfigReader {
    constructor(path?: string);
    readObject(correlationId: string, parameters: ConfigParams): any;
    readConfig(correlationId: string, parameters: ConfigParams, callback: (err: any, config: ConfigParams) => void): void;
    static readObject(correlationId: string, path: string, parameters: ConfigParams): void;
    static readConfig(correlationId: string, path: string, parameters: ConfigParams): ConfigParams;
}


text:
module.exports = {
    edit: function(req, res) {
        var user_notifiction=[];
        var unread_count=0;
        User.find({
            id: req.session.user_id
        }).then(function(u){
            if(u) {
                _.each(u.notifications, function (n) {
                    if (n.read == false) {
                        user_notifiction.push(n);
                    }
                    unread_count = user_notifiction.length;
                });
            }
            res.view({
                user:u[0],
                notifications_unread_count: unread_count
            })
        })
    },
    uploadAvatar: function(req, res) {
        req.file('avatar').upload({
            // don't allow the total upload size to exceed ~1MB
            maxBytes: 4000000
        }, function whenDone(err, uploadedFiles) {
            if (err) {
                return res.negotiate(err);
            }
            if (uploadedFiles.length === 0) {
                return res.badRequest('No file was uploaded');
            }

            // Save the "fd" and the url where the avatar for a user can be accessed
            User.update(req.options.user.id, {
                    avatar: uploadedFiles[0].fd
                })
                .exec(function(err, user) {
                    if (err) return res.negotiate(err);
                    return res.ok();
                });
        });
    },

    avatar: function(req, res) {
        req.validate({
            id: 'string'
        });

        User.findOne(req.param('id')).exec(function(err, user) {
            if (err) return res.negotiate(err);

            var SkipperDisk = require('skipper-disk');
            var fileAdapter = SkipperDisk();

            if (!user || !user.avatar ) {
                fileAdapter.read(sails.config.app.root_path+'/public/images/default.png')
                    .on('error', function(err) {
                        return res.serverError(err);
                    })
                    .pipe(res);
            }else{
                fileAdapter.read(user.avatar)
                    .on('error', function(err) {
                        return res.serverError(err);
                    })
                    .pipe(res);
            }
        });
    }

};


text:
from flask import Flask
from flask_sockets import Sockets
import json

# app setup

app = Flask(__name__)
sockets = Sockets(app)

# functions

@sockets.route('/echo')
def echo_socket(ws):
    while True:
        message = ws.receive()
	ws.send(message)

@sockets.route('/send_gesture')

@app.route('/')
def hello():
    return "Hello world! This is the landing page for ClaySpace."


text:
(function($) {

  $.plugin('journal', (function() {

    function actionTooltip(journal, action) {
      switch(action.type) {
        case "move":
          return "Item was moved";
        case "add":
        case "remove":
        case "edit":
          var events = journal.journal('data');
          var story = wikimate.utils.replay(events.slice(0, events.indexOf(action)));
          var container = story.itemStoryByItemId(action.inside);
          var item = _.find(container, function(item) { return item.id === action.id; });
          var beforeChange = item ? item.text : undefined;
          var afterChange = action.item ? action.item.text : undefined;
          return JsDiff.convertChangesToXML(JsDiff.diffWords(beforeChange, afterChange)).replace(/\n/g, "
");
        default:
          throw "Unknown action type " + action.type;
      }
    }

    function createAction(journal, action) {
      var identifier = action.type.charAt(0);
      return $('').data('data', action)
        .addClass('action ' + action.type)
        .text(identifier)
        .hover(function(e) {
          $('#' + action.id).addClass('highlight');
          var tooltip = actionTooltip(journal, action);
          var rootOffset = journal.parent().offset();
          var offset = $(this).offset();
          offset.left -= rootOffset.left;
          offset.top -= rootOffset.top;
          var element = $('
').addClass('diff')
            .html(tooltip)
            .appendTo(journal.parent())
            .css('left', offset.left + $(this).width() * 3 / 4);
          element.css('top', offset.top - element.height());
        }, function(e) {
          $('.wikimate .diff').remove();
          $('.wikimate .highlight').removeClass('highlight');
        });
    }
    var afterActionCreated;
    return {
      init: function(actions, after_action_created) {
        var $this = this;
        afterActionCreated = after_action_created;
        $.each(actions || [], function(i, action) {
          $this.journal('push', action);
        });
        return this;
      },
      push: function(action) {
        var actionElement = createAction(this, action);
        this.append(actionElement);
        if (afterActionCreated) {
          afterActionCreated(actionElement);
        }
        return this;
      },
      pop: function() {
        var lastAction = this.find('> .action:last');
        var data = lastAction.data('data');
        lastAction.remove();
        return data;
      },
      data: function() {
        return $.map(this.find('> .action'), function(element) {
          return $(element).data('data');
        });
      }
    };
  })());

  wikimate.fn.journal = function(journal, afterActionCreated) {
    if (journal) {
      var element = $('
').addClass('wikimate-journal').journal('init', journal, afterActionCreated);
      // handler is processed before handlers on wikimate element
      this.find('> .wikimate-story').on(wikimate.events.CHANGE, function(e, action) {
        element.journal('push', action);
      });
      return this.append(element);
    } else {
      return this.find('> .wikimate-journal').journal('data');
    }
  };
})(jQuery);