Ktam3874/pitx software guide – Kontron KTAM3874-pITX User Manual
Page 189

KTD-S0057-I
Page 185 Linux® Programming Examples (DebianTM)
KTAM3874/pITX Software Guide
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
****************************************************************************/
#include <QtGui/QtGui>
#include "moc_main.cpp"
int main (int argc, char **argv)
{
Q_INIT_RESOURCE
(animatedtiles);
QApplication app (argc, argv);
QPixmap kineticPix (":/images/kinetic.png");
/* QPixmap bgPix (":/images/Time-For-Lunch-2.jpg"); */
QGraphicsScene
scene (-350, -350, 700, 700);
QList<Pixmap *> items;
for (int i = 0; i < 64; ++i)
{
Pixmap *item = new Pixmap (kineticPix);
item->setOffset (-kineticPix.width () / 2, -kineticPix.height () / 2);
item->setZValue
(i);
items << item;
scene.addItem
(item);
}
//
Buttons
QGraphicsItem *buttonParent = new QGraphicsRectItem;
Button *ellipseButton = new Button (QPixmap (":/images/ellipse.png"), buttonParent);
Button *figure8Button = new Button (QPixmap (":/images/figure8.png"), buttonParent);
Button *randomButton = new Button (QPixmap (":/images/random.png"), buttonParent);
Button *tiledButton = new Button (QPixmap (":/images/tile.png"), buttonParent);
Button *centeredButton = new Button (QPixmap (":/images/centered.png"), buttonParent);
ellipseButton->setPos (-100, -100);
figure8Button->setPos (100, -100);
randomButton->setPos (0, 0);
tiledButton->setPos (-100, 100);
centeredButton->setPos (100, 100);
scene.addItem
(buttonParent);
buttonParent->scale (0.75, 0.75);
buttonParent->setPos (200, 200);
buttonParent->setZValue
(65);
//
States
QState *rootState = new QState;
QState *ellipseState = new QState (rootState);
QState *figure8State = new QState (rootState);
QState *randomState = new QState (rootState);
QState *tiledState = new QState (rootState);
QState *centeredState = new QState (rootState);