Initialize the graphicsview with default properties regardless of which
constructor is called. This is important to the panel because QGraphicsView has an off-by-one bug when using the default AlignCenter alignment and an odd height. CCBUG: 154832 svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=754550
This commit is contained in:
parent
5326f56dbb
commit
4a1823bff4
27
view.cpp
27
view.cpp
@ -48,6 +48,22 @@ public:
|
||||
View::View(int screen, Corona *corona, QWidget *parent)
|
||||
: QGraphicsView(parent),
|
||||
d(new Private)
|
||||
{
|
||||
initGraphicsView();
|
||||
setScene(corona);
|
||||
setScreen(screen);
|
||||
}
|
||||
|
||||
View::View(Containment *containment, QWidget *parent)
|
||||
: QGraphicsView(parent),
|
||||
d(new Private)
|
||||
{
|
||||
initGraphicsView();
|
||||
setScene(containment->scene());
|
||||
setContainment(containment);
|
||||
}
|
||||
|
||||
void View::initGraphicsView()
|
||||
{
|
||||
setFrameShape(QFrame::NoFrame);
|
||||
setAutoFillBackground(true);
|
||||
@ -58,17 +74,6 @@ View::View(int screen, Corona *corona, QWidget *parent)
|
||||
setAlignment(Qt::AlignLeft | Qt::AlignTop);
|
||||
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
|
||||
setScene(corona);
|
||||
setScreen(screen);
|
||||
}
|
||||
|
||||
View::View(Containment *containment, QWidget *parent)
|
||||
: QGraphicsView(parent),
|
||||
d(new Private)
|
||||
{
|
||||
setScene(containment->scene());
|
||||
setContainment(containment);
|
||||
}
|
||||
|
||||
View::~View()
|
||||
|
Loading…
Reference in New Issue
Block a user