Expanding PlasmaCore.Dialog in Qml

Onur-Hayri Bakici thehayro at gmail.com
Thu May 26 14:46:36 CEST 2011


> On Thursday 26 May 2011, Onur-Hayri Bakici wrote:
> > > the dialog is a top level widget/window (it's used to have standalone
> > > windows), and is not influenced  by its parent widget.
> > > instead, you put an Item inside the dialog and to control the size you
> > > either set the one of the dialog or its internal widget
> > 
> > Thank you for the clou, however I came across another limitation. The
> > PlasmaCore.Dialog Component only requires a QGraphicsWidget as the
> > mainItem. When I put a ListView into the QGraphicsWidget, it doesn't get
> > displayed. Is there maybe any other way to bypass this problem?
> 
> that strange, in the source code (you can take a look atkde-
> runtime/plasma/declarativeimports/core/dialog.cpp )
> there are 2 different code paths for qgraphicswidgets and
> qdeclarativeitems, there could be a bug there, but iirc i'm already ising
> normal
> qdeclaraticeitems elsewhere (note that they have to have a width and height
> set before being setted in the dialog, or the dialog could remain with 0,0
> size)

Yeah I just figured out that this was the case. I did not set the height/width. 
So this solved my problem:

QGraphicsWidget {
    height: myListView.height
    width: myListView.width
  
  ListView {
    id: myListView
    height: 200
    width: 200    
    anchors.fill: parent
    // some more stuff
}


More information about the Plasma-devel mailing list