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

List:       kde-devel
Subject:    Problem with QGraphicsLinearLayout
From:       Christophe Olinger <olingerc () binarylooks ! com>
Date:       2010-04-15 9:53:51
Message-ID: l2x1718db771004150253o2e1de85by55e70ea4e5c88879 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hey everybody,

I have a crash in my application (plasma media center) that I do not
understand. This is my situation:

I have a bar which is supposed to show iconwidgets. The class of that bar
has a function which I use to add widgets to my bar. Depending on the
widget, I want it to be on the left, the middle or the right side of my bar.
Later I want to add a bottom part but that's not the problem at the moment.
(The function takes a list of Widgets as paramter)

The way I understood layouts in Qt I did the following:
1) I created a QGraphicsLinearLayout m_layoutHorizontalTop (this is the
container)
2) I created additional layouts: m_layoutTopLeft, m_layoutTopMiddle,
m_layoutTopRight (this will be boxes in the container)
3) In the init() of my bar I did:
m_layoutHorizontalTop->addItem(m_layoutTopLeft) (I only add the first box)
4) On my bar I do: addLayout->(m_layoutHorizontalTop)
5) my function adds items only to the m_layoutTopLeft, (later also to the
other layouts)
6) no problem, icons are there

Now as soon as I add this line in my init (which would add the next box):
m_layoutHorizontalTop->addItem(m_layoutTopMiddle) my application crashes on
startup?!

It is not the fact that I add this layout that makes it crash, but the fact
that my function wants to add widgets to the TopLeft layout. I thought these
layouts would be boxes that I could fill with widgets, but why does that
fact that I put two boxes next to each other interfere with me adding
widgets in one box?

Confusion :-?

Christophe

[Attachment #5 (text/html)]

Hey everybody,<br><br>I have a crash in my application (plasma media center=
) that I do not understand. This is my situation:<br><br>I have a bar which=
 is supposed to show iconwidgets. The class of that bar has a function whic=
h I use to add widgets to my bar. Depending on the widget, I want it to be =
on the left, the middle or the right side of my bar. Later I want to add a =
bottom part but that&#39;s not the problem at the moment. (The function tak=
es a list of Widgets as paramter)<br>
<br>The way I understood layouts in Qt I did the following:<br>1) I created=
 a QGraphicsLinearLayout m_layoutHorizontalTop (this is the container)<br>2=
) I created additional layouts: m_layoutTopLeft, m_layoutTopMiddle, m_layou=
tTopRight (this will be boxes in the container)<br>
3) In the init() of my bar I did: m_layoutHorizontalTop-&gt;addItem(m_layou=
tTopLeft) (I only add the first box)<br>4) On my bar I do: addLayout-&gt;(m=
_layoutHorizontalTop)<br>5) my function adds items only to the m_layoutTopL=
eft, (later also to the other layouts)<br>
6) no problem, icons are there<br><br>Now as soon as I add this line in my =
init (which would add the next box):<br>m_layoutHorizontalTop-&gt;addItem(m=
_layoutTopMiddle) my application crashes on startup?!<br><br>It is not the =
fact that I add this layout that makes it crash, but the fact that my funct=
ion wants to add widgets to the TopLeft layout. I thought these layouts wou=
ld be boxes that I could fill with widgets, but why does that fact that I p=
ut two boxes next to each other interfere with me adding widgets in one box=
?<br>
<br>Confusion :-?<br><br>Christophe<br><br>


>> 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