System notice: In light of the Debian OpenSSL security issue we've regenerated the server keys. See this thread for instructions and the new key fingerprints.

Blob of examples/frameless/main.cpp (raw blob data)

1 /***************************************************************************
2 * Copyright (C) 2008 by David Cuadrado *
3 * krawek@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21 #include <QApplication>
22 #include <QLabel>
23 #include <QIcon>
24 #include <QCalendarWidget>
25 #include <QTableWidget>
26 #include <QTextEdit>
27 #include <QDial>
28 #include <QGraphicsView>
29 #include <QGraphicsScene>
30 #include <QGraphicsRectItem>
31 #include <QGraphicsEllipseItem>
32
33 #include "sif/mainwindow.h"
34 #include "sif/view.h"
35 #include "sif/aerobutton.h"
36
37 int main(int argc, char **argv)
38 {
39 QApplication app(argc, argv);
40 app.setApplicationName("Player");
41
42 SIF::MainWindow mw;
43 mw.setWindowFlags(mw.windowFlags() | Qt::FramelessWindowHint);
44 QObject::connect(&mw, SIGNAL(titleClicked()), qApp, SLOT(aboutQt()));
45
46 mw.addPage("View", new QGraphicsView);
47
48
49 SIF::View *view1 = new SIF::View;
50 view1->addPage("Collection", new QCalendarWidget);
51 view1->addPage("Information", new QTableWidget(10, 10));
52
53 mw.addPage("Music", view1);
54
55
56 SIF::View *view2 = new SIF::View;
57 view2->addPage("Collection", new QTextEdit("An editor"));
58 view2->addPage("Information", new QDial);
59
60 QGraphicsView *qgv = new QGraphicsView;
61 qgv->setRenderHints(QPainter::Antialiasing);
62 QGraphicsScene *scene = new QGraphicsScene;
63
64 scene->addRect(QRect(25, 150, 100, 100))->setBrush(Qt::red);
65 scene->addEllipse(QRect(100, 20, 40, 100))->setBrush(Qt::blue);
66
67 qgv->setScene(scene);
68 view2->addPage("Graphics", qgv);
69
70
71 mw.addPage("Video", view2);
72
73
74 QObject::connect(mw.addButton("Quit"), SIGNAL(clicked()), &app, SLOT(closeAllWindows()));
75
76
77 mw.show();
78
79 return app.exec();
80 }