开发者

using layouts in qwidget

开发者 https://www.devze.com 2023-03-09 04:48 出处:网络
I am using qt 4.7 on RHEL 6.0. I am finding very difficut use te layouts.Here is my code. I have two widgets that are arranged using grid layout.

I am using qt 4.7 on RHEL 6.0. I am finding very difficut use te layouts. Here is my code.

I have two widgets that are arranged using grid layout.

QWidget *topWidget = new QWidget();
QWidget *bottomwidget = new QWidget();

These two widgets are contained in a QFrame. So now i wanted to add a QPhonon::VideoPlayer widget exactly in b/w the above two widget. For adding am doing like this..

VideoPlayer *vPlayer = new VideoPlayer(Phonon::VideoCategory,this);
vPlayer->setSizePolicy(QSizeHint::Expanding, QSizeHint::Expanding);
QVBoxLayOut *layOut = (QVBoxLayOut*)ui->frame->layout();
layout->insertWidget(1,vPlayer,5,Qt::AlignCenter);

the size of all topWidget, boottomWidget are 768 and 576 which is the size of the D1 video frame. I am playing a video in vPlayer phonon widget. But what I am seeing is vPlayer size is very small and video size also small. Means to say I am not seeing the 768/576 size 开发者_如何学Cvideo. Can somebody help me? Any help would be appreciated.


1)

QVBoxLayOut *layOut = (QVBoxLayOut*)ui->frame->layout();

Do not use C-style casts! Use

dynamic_casr<QVBoxLayout*>(ui->frame->layout())

2)Try to vPlayer->setMinimumSize(QSize(500, 500))

3)And as far as I know Qt, if you want to change GUI or construct complicated ones, then it is preferred to construct GUI's by itself, not with QtDesigner.

0

精彩评论

暂无评论...
验证码 换一张
取 消