| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 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 |
} |