[Qt-interest] [qt-interest] For classes with namespace style sheets not applied

Anton Chernov mechernov at gmail.com
Thu Mar 24 20:01:29 CET 2011


Good guess! :) Thank you!

Actually it was another sort of problem - setting some of the
properties gave simply no effect. :)

However a problem persists:
I made a zoom label that had to be in the bottom left corner of an
QGraphicsView. There is no direct public access method to this layout,
but with

QBoxLayout* layout = qobject_cast<QBoxLaxout*>(
view->horizontalScrollBar()->parentWidget()->layout() );

can be nicely handled. I place my

layout->insertWidget( 0, zoomLabel ):

in it and its perfect. The zoomLabel is right befor the scroll bar.

The problem is that i have rulers that should be on the left & top of
the view. I made

QGridLayout* layout = new QGridLayout( parent );
layout->addWidget( 0, 1, verticalRuler );
layout->addWidget( 1, 0, horizontalRuler );
layout->addWidget( 1, 1, graphicsView );

but the zoomLabel (that is now in the graphicsView) should be on TOP
of the vertical ruler.

I have tried:
theLayoutThatHasTheZoomWidget->insertSpacing( 0, -rulerWidth );

this moved the widget accordingly to the left, BUT the outstanding
part is covered by the ruler widget!

None of the following worked too:
- graphicsView->raise() | ruler->lower()
- padding: 0 0 0 -16px; margin: 0 0 0 16px;

I guess it can have something to do with:
- painter of the graphicsView clips to the views rect
- the grid layout clips all widgets according to their cells
- the mask (i dont have one by default right?) on the widget clips the
graphicsView widget

Does anyone know if any of them sound realistic?

Does anyone have an another idea?

2011/3/24 Thiago Macieira <thiago at kde.org>:
> Em quinta-feira, 24 de março de 2011, às 14:53:59, Anton Chernov escreveu:
>> ns--MyPushButton is working in a test application, but NOT IN MY
>> APPLICATION!
>>
>> What can be the trick?
>
> We don't know, you haven't posted your application code.
>
> Do you want us to guess?
>
> Ok, here's a guess: your namespace declarations are macros that moc isn't
> expanding. So it doesn't know that your class is inside a namespace.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>



More information about the Qt-interest-old mailing list