~ubuntu-branches/ubuntu/vivid/youker-assistant/vivid

« back to all changes in this revision

Viewing changes to src/youker-application.cpp

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2014-03-24 15:52:37 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140324155237-3kod0m3wr2a2ag39
Tags: 1.0.1-0ubuntu1
* New upstream release (LP: #1294936).
* Modify display mode of weather forecast and system settings.
* Add file manager and font style settings.
* Improve system settings and restoring default settings.
* Cache user account (not password).
* Change the position of window control buttons.
* Add configuration for Kingsoft KuaiPan cloud client.
* Add the instruction of Youker Assistant.
* Open related folders when scanning items got double-clicked.
* Notify users when operating the Kingsoft disk cloud configuration.
* Modify Dbus starting method.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
{
31
31
    viewer = new QDeclarativeView;
32
32
    tray = new Tray();
33
 
//    mTopLevel = new TopLevel;
34
33
    connect(tray,SIGNAL(showOrHideQmlSignal()),this,SLOT(showOrHideMainPage()));
35
 
//    QHBoxLayout* layout = new QHBoxLayout(this);
36
 
//    layout->addWidget(viewer);
37
 
//    layout->setContentsMargins(5, 3, 4, 6);
38
 
////    layout->setContentsMargins(5, 3, 5, 7);
39
 
//    setLayout(layout);
40
 
//    setFixedSize(860, 610);
41
 
//    this->setAttribute(Qt::WA_DeleteOnClose);//防止内存泄漏
42
 
//    this->setWindowFlags(Qt::FramelessWindowHint);
43
 
//    this->setAttribute(Qt::WA_TranslucentBackground);
44
 
////    setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint);
45
 
////    setAttribute(Qt::WA_TranslucentBackground);
46
 
//    viewer->rootContext()->setContextProperty("mainwindow", this);
47
34
}
48
35
 
49
36
IhuApplication::~IhuApplication() {
53
40
    if (tray) {
54
41
        delete tray;
55
42
    }
56
 
 
57
 
 
58
 
//    if (mTopLevel)
59
 
//        delete mTopLevel;
60
43
}
61
44
 
62
45
inline bool isRunningInstalled() {
83
66
}
84
67
 
85
68
void IhuApplication::setup() {
86
 
//    viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory()));
87
 
//    viewer->setSource(QUrl::fromLocalFile("main.qml"));
88
 
//    this->show();
89
 
 
90
69
 
91
70
    viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory()));
92
71
    viewer->setSource(QUrl::fromLocalFile("main.qml"));
94
73
    viewer->setStyleSheet("background:transparent");
95
74
    viewer->setAttribute(Qt::WA_TranslucentBackground);
96
75
    viewer->setWindowFlags(Qt::FramelessWindowHint);
97
 
//    viewer->setWindowFlags(Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint);
 
76
    viewer->resize(850, 600);
98
77
    QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit()));
99
 
//    mTopLevel->setCenterWidget(viewer);
100
 
////    mTopLevel->setTopLevelVisible(true,true,true);
101
 
//    viewer->setContentsMargins(0, 0, 0, 0);
102
 
//    viewer->setResizeMode(QDeclarativeView::SizeViewToRootObject);
103
 
//    viewer->setResizeAnchor(QGraphicsView::AnchorViewCenter);
104
 
//    viewer->viewport()->setAutoFillBackground(false);
105
 
//    viewer->rootContext()->setContextProperty("mainwindow", mTopLevel);
106
 
//    viewer->engine()->setBaseUrl(QUrl::fromLocalFile(getAppDirectory()));
107
 
//    viewer->setSource(QUrl::fromLocalFile("main.qml"));
108
 
//    QObject::connect(viewer->engine(), SIGNAL(quit()), qApp, SLOT(quit()));
109
78
}
110
79
 
111
80
void IhuApplication::showQMLWidget() {
120
89
    viewer->move(centerW, centerH);
121
90
    viewer->show();
122
91
}
123
 
 
124
 
 
125
 
 
126
 
 
127
 
//------------------
128
 
//void IhuApplication::paintEvent(QPaintEvent *e) {
129
 
//    QPainter painter(this);
130
 
 
131
 
//    QRect bottom(5, 136, 200, 7);
132
 
//    QRect top(5, 0, 200, 3);
133
 
//    QRect left(0, 3, 5, 133);
134
 
//    QRect right(205, 3, 5, 133);
135
 
//    QRect topRight(205, 0, 5, 3);
136
 
//    QRect topLeft(0, 0, 5, 3);
137
 
//    QRect bottomLeft(0, 136, 5, 7);
138
 
//    QRect bottomRight(205, 136, 5, 7);
139
 
 
140
 
//    QRect tBottom(5, this->height() - 7, this->width() - 10, 7);
141
 
//    QRect tTop(5, 0, this->width() - 10, 3);
142
 
//    QRect tLeft(0, 3, 5, this->height() - 10);
143
 
//    QRect tRight(this->width() - 5, 3, 5, this->height() - 10);
144
 
//    QRect tTopLeft(0, 0, 5, 3);
145
 
//    QRect tTopRight(this->width() - 5, 0, 5, 3);
146
 
//    QRect tBottomLeft(0, this->height() - 7, 5, 7);
147
 
//    QRect tBottomRight(this->width() - 5, this->height() - 7, 5, 7);
148
 
 
149
 
//    painter.drawPixmap(tBottom, m_shadow, bottom);
150
 
//    painter.drawPixmap(tTop, m_shadow, top);
151
 
//    painter.drawPixmap(tLeft, m_shadow, left);
152
 
//    painter.drawPixmap(tRight, m_shadow, right);
153
 
//    painter.drawPixmap(tTopRight, m_shadow, topRight);
154
 
//    painter.drawPixmap(tTopLeft, m_shadow, topLeft);
155
 
//    painter.drawPixmap(tBottomLeft, m_shadow, bottomLeft);
156
 
//    painter.drawPixmap(tBottomRight, m_shadow, bottomRight);
157
 
//}
158
 
 
159
 
//void IhuApplication::showEvent(QShowEvent *e) {
160
 
//    repaint();
161
 
//}