[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Widgets on top of OpenGL game widget
From:       Thomas =?iso-8859-1?q?L=FCbking?= <thomas.luebking () web ! de>
Date:       2009-06-11 13:40:53
Message-ID: 200906111540.53967.thomas.luebking () web ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Am Thursday 11 June 2009 schrieb John-Paul Stanford:
> 1) Am I doing the correct thing to add a dialog?
if this asks whether you do the right steps to get some overlay dialog into 
your game: yes.
if this asks whether it's the right thing to do: i have no idea ;-)

> 2) How to I make the dialog appear at different positions within the
> dialog?
dialog within the scene? just move it around (QWidget::move())

> 3) What do I need to do to make it a window (can be closed and moved)?
you can try to use a QMdiSubWindow (QDockWidget) - but i have no idea whether 
it works outside a QMdiArea (inside a scene) and the look will be probably not 
entirely configurable by stylesheeets (e.g. regarding button positions)

another way (if you want to achive exactly the mock or the subwindow/dockwiget 
does not survive in your context) was to alter the ChatPane and implement you 
own little "windowmanager"

that's not hard:
- catch the mousepress/release events, save the state and handle the 
mousemoveevents in accordance - i think i've done that a dozen times, ask if 
you need some code snippet
- add a push or toolbuttons (as you like it) and bind the "clicked" signal to 
the windows close slot
- to achieve that shape you can:
set a gradient background (even via stylesheet) that creates a hard border 
(0:blue, 0.3:blue, 0.301:transparent)
- set a mask on the widget
- create an independent widget for the titlebar (i.e. parented by the scene) 
that just attaches and moves/closes the actual dialog

> 4) Is the QT Stylesheet going to be able to resyle the in game windows
> similar to the mockup?
if you use the proper sheet: yes.
(personal and mean note - scnr:
red on blue? are you kidding? do you sell glasses? maybe rethink colors...)

Thomas

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Segoe'; font-size:9pt; font-weight:400; \
font-style:normal;">Am Thursday 11 June 2009 schrieb John-Paul Stanford:<br> &gt; 1) \
Am I doing the correct thing to add a dialog?<br> if this asks whether you do the \
right steps to get some overlay dialog into your game: yes.<br> if this asks whether \
it's the right thing to do: i have no idea ;-)<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>&gt; 2) How to I make the dialog appear at different \
positions within the<br> &gt; dialog?<br>
dialog within the scene? just move it around (QWidget::move())<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>&gt; 3) What do I need to do to make it a window (can be \
closed and moved)?<br> you can try to use a QMdiSubWindow (QDockWidget) - but i have \
no idea whether it works outside a QMdiArea (inside a scene) and the look will be \
probably not entirely configurable by stylesheeets (e.g. regarding button \
positions)<br> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>another way (if you want to achive exactly the mock or the \
subwindow/dockwiget does not survive in your context) was to alter the ChatPane and \
implement you own little "windowmanager"<br> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
                -qt-block-indent:0; text-indent:0px; \
                -qt-user-state:0;"><br></p>that's not hard:<br>
- catch the mousepress/release events, save the state and handle the mousemoveevents \
in accordance - i think i've done that a dozen times, ask if you need some code \
                snippet<br>
- add a push or toolbuttons (as you like it) and bind the "clicked" signal to the \
                windows close slot<br>
- to achieve that shape you can:<br>
set a gradient background (even via stylesheet) that creates a hard border (0:blue, \
                0.3:blue, 0.301:transparent)<br>
- set a mask on the widget<br>
- create an independent widget for the titlebar (i.e. parented by the scene) that \
just attaches and moves/closes the actual dialog<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>&gt; 4) Is the QT Stylesheet going to be able to resyle \
the in game windows<br> &gt; similar to the mockup?<br>
if you use the proper sheet: yes.<br>
(personal and mean note - scnr:<br>
red on blue? are you kidding? do you sell glasses? maybe rethink colors...)<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Thomas</p></body></html>



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic