summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiWoong Kim <giwoong.kim@samsung.com>2014-10-13 15:55:37 +0900
committerGiWoong Kim <giwoong.kim@samsung.com>2014-10-27 02:55:24 -0700
commitb7932f328863cd3f536544427042cf2fa50f82af (patch)
treec1712d1d8239e0978ef8c661a486728c7fd8f38d
parent74d1a3157e26e7197d3355b80c2778057f286353 (diff)
downloadqemu-b7932f328863cd3f536544427042cf2fa50f82af.tar.gz
qemu-b7932f328863cd3f536544427042cf2fa50f82af.tar.bz2
qemu-b7932f328863cd3f536544427042cf2fa50f82af.zip
controller: modify inheritance of docking controller class
DockingConView -> QWidget Change-Id: Id8c75a073fe7af94b9cc0f113fc96fa44f51d21f Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
-rw-r--r--tizen/src/ui/dockingcontroller.cpp20
-rw-r--r--tizen/src/ui/dockingcontroller.h9
-rw-r--r--tizen/src/ui/dockingconview.cpp10
-rw-r--r--tizen/src/ui/dockingconview.h1
-rw-r--r--tizen/src/ui/floatingcontroller.cpp1
-rw-r--r--tizen/src/ui/floatingconview.cpp4
-rw-r--r--tizen/src/ui/floatingconview.h3
-rw-r--r--tizen/src/ui/mainwindow.cpp8
-rw-r--r--tizen/src/ui/mainwindow.h1
9 files changed, 31 insertions, 26 deletions
diff --git a/tizen/src/ui/dockingcontroller.cpp b/tizen/src/ui/dockingcontroller.cpp
index 8c2a811f95..fa1dd45903 100644
--- a/tizen/src/ui/dockingcontroller.cpp
+++ b/tizen/src/ui/dockingcontroller.cpp
@@ -30,16 +30,26 @@
#include "dockingcontroller.h"
#include "mainwindow.h"
-DockingController::DockingController(int dockPos, ControllerForm *conForm,
- QGraphicsScene *conScene, QAction *menu, QWidget *parent)
- : DockingConView(conForm, conScene, parent)
+DockingController::DockingController(ControllerForm *conForm,
+ QAction *menu, int dockPos, QWidget *parent) : QWidget(parent)
{
- this->dockPos = dockPos;
this->conForm = conForm;
this->menu = menu;
+ this->dockPos = dockPos;
+ setStyleSheet("border-style: none");
setAttribute(Qt::WA_DeleteOnClose);
- setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ layout->setMargin(0);
+ layout->setSpacing(0);
+
+ QGraphicsScene *conScene = new QGraphicsScene(this);
+ conScene->setBackgroundBrush(Qt::black);
+
+ conView = new DockingConView(conForm, conScene, this);
+ conView->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+ layout->addWidget(conView);
}
int DockingController::getDockPos()
diff --git a/tizen/src/ui/dockingcontroller.h b/tizen/src/ui/dockingcontroller.h
index ddd9b0dedd..b218f8c904 100644
--- a/tizen/src/ui/dockingcontroller.h
+++ b/tizen/src/ui/dockingcontroller.h
@@ -35,13 +35,13 @@
#include "controllerform.h"
#include "dockingconview.h"
-class DockingController : public DockingConView
+class DockingController : public QWidget
{
Q_OBJECT
public:
- explicit DockingController(int dockPos, ControllerForm *conForm,
- QGraphicsScene *conScene, QAction *menu, QWidget *parent = 0);
+ explicit DockingController(ControllerForm *conForm,
+ QAction *menu, int dockPos, QWidget *parent = 0);
~DockingController();
int getDockPos();
@@ -53,9 +53,10 @@ protected:
void setRegion(QImage baseImage);
private:
- int dockPos;
+ DockingConView *conView;
ControllerForm *conForm;
QAction *menu;
+ int dockPos;
};
#endif // DOCKINGCONTROLLER_H
diff --git a/tizen/src/ui/dockingconview.cpp b/tizen/src/ui/dockingconview.cpp
index d69ede3eba..e56c514f9c 100644
--- a/tizen/src/ui/dockingconview.cpp
+++ b/tizen/src/ui/dockingconview.cpp
@@ -31,8 +31,8 @@
#include "mainwindow.h"
#include "skinkeyitem.h"
-DockingConView::DockingConView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent) :
- QGraphicsView(scene, parent)
+DockingConView::DockingConView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent)
+ : QGraphicsView(scene, parent)
{
setStyleSheet("background: transparent");
setStyleSheet("border-style: none");
@@ -83,11 +83,11 @@ void DockingConView::mousePressEvent(QMouseEvent *event)
}
if (event->button() == Qt::LeftButton) {
- QWidget *win = ((QWidget *) this->parent());
+ QWidget *win = ((QWidget *)this->parent()->parent());
grabPos = event->globalPos();
eventPos = event->pos();
- rubberPos = win->pos() + this->pos();
+ rubberPos = win->pos() + ((QWidget *)this->parent())->pos();
if (rubberBand != NULL) {
rubberBand->setGeometry(QRect(rubberPos, size()));
@@ -111,7 +111,7 @@ void DockingConView::mouseReleaseEvent(QMouseEvent *event)
}
/* toggle */
- MainWindow *win = ((MainWindow *)this->parent());
+ MainWindow *win = ((MainWindow *)this->parent()->parent());
win->getUIState()->conState.recentlyFloatPos = event->globalPos() - eventPos;
win->openController(win->getUIState()->conState.conFormIndex, -1);
diff --git a/tizen/src/ui/dockingconview.h b/tizen/src/ui/dockingconview.h
index dc1b6ff9d5..e4dc7d0c48 100644
--- a/tizen/src/ui/dockingconview.h
+++ b/tizen/src/ui/dockingconview.h
@@ -44,7 +44,6 @@ public:
protected:
void resizeEvent(QResizeEvent *event);
-
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
diff --git a/tizen/src/ui/floatingcontroller.cpp b/tizen/src/ui/floatingcontroller.cpp
index dc2cc0ceb3..36091f5c19 100644
--- a/tizen/src/ui/floatingcontroller.cpp
+++ b/tizen/src/ui/floatingcontroller.cpp
@@ -47,6 +47,7 @@ FloatingController::FloatingController(ControllerForm *conForm,
layout->setSpacing(0);
QGraphicsScene *conScene = new QGraphicsScene(this);
+ conScene->setBackgroundBrush(Qt::black);
conView = new FloatingConView(conForm, conScene, this);
conView->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
diff --git a/tizen/src/ui/floatingconview.cpp b/tizen/src/ui/floatingconview.cpp
index c79df1baa7..16038b7e39 100644
--- a/tizen/src/ui/floatingconview.cpp
+++ b/tizen/src/ui/floatingconview.cpp
@@ -33,8 +33,8 @@
#define DOCKABLE_AREA_WIDTH 30
-FloatingConView::FloatingConView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent) :
- QGraphicsView(scene, parent)
+FloatingConView::FloatingConView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent)
+ : QGraphicsView(scene, parent)
{
setStyleSheet("background: transparent");
setStyleSheet("border-style: none");
diff --git a/tizen/src/ui/floatingconview.h b/tizen/src/ui/floatingconview.h
index 506a389074..02830e1da4 100644
--- a/tizen/src/ui/floatingconview.h
+++ b/tizen/src/ui/floatingconview.h
@@ -41,12 +41,13 @@ public:
~FloatingConView();
protected:
- int isDockable(QWidget *object, QWidget *subject);
void resizeEvent(QResizeEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
+ int isDockable(QWidget *object, QWidget *subject);
+
QPoint grabPos;
QPoint conPos;
diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp
index 3599c49bc7..08819c9e38 100644
--- a/tizen/src/ui/mainwindow.cpp
+++ b/tizen/src/ui/mainwindow.cpp
@@ -236,10 +236,8 @@ void MainWindow::openController(int index, int dockPos)
getUIState()->conState.floatingCon =
new FloatingController(conForm, action, this);
} else {
- conScene = new QGraphicsScene(this);
- conScene->setBackgroundBrush(Qt::black);
getUIState()->conState.dockingCon =
- new DockingController(dockPos, conForm, conScene, action, this);
+ new DockingController(conForm, action, dockPos, this);
}
/* update layout */
@@ -273,10 +271,6 @@ void MainWindow::closeController()
getDockingCon()->close();
getUIState()->conState.dockingCon = NULL;
- conScene->clear();
- delete conScene;
- conScene = NULL;
-
adjustSize();
}
diff --git a/tizen/src/ui/mainwindow.h b/tizen/src/ui/mainwindow.h
index 4dfc19b790..e68c1d33de 100644
--- a/tizen/src/ui/mainwindow.h
+++ b/tizen/src/ui/mainwindow.h
@@ -100,7 +100,6 @@ private:
/* windowing */
QHBoxLayout *winLayout;
QGraphicsScene *skinScene;
- QGraphicsScene *conScene; /* for docking controller */
SkinView* skinView;
DisplayBase *display;
ContextMenu *popupMenu;