QSplitter测试

很久没用过了,今天又用了

QSplitter *splitterMain;
    QTextEdit *textleft;
    QSplitter *splitterRight;
    QTextEdit *textUp;
    QTextEdit *textBottom;
    QVBoxLayout *vLayout=new QVBoxLayout(ui.centralWidget);

    splitterMain = new QSplitter(Qt::Horizontal, ui.centralWidget);                   //Horizontal:水平的
    textleft = new QTextEdit(QObject::tr("Left Widget"), splitterMain);
    textleft->setAlignment(Qt::AlignCenter);
    //右部分分割窗口
    splitterRight = new QSplitter(Qt::Vertical, splitterMain);        //Vertical:垂直的
    splitterRight->setOpaqueResize(false);                                    //Opaque:不透明的
    textUp = new QTextEdit(QObject::tr("Top Widget"), splitterRight);
    textUp->setAlignment(Qt::AlignCenter);
    textBottom = new QTextEdit(QObject::tr("Bottom Widget"), splitterRight);
    textBottom->setAlignment(Qt::AlignCenter);
    splitterMain->setStretchFactor(0, 1);

    vLayout->addWidget(splitterMain);

 

参考:https://www.cnblogs.com/fuqia/p/8882994.html

 

#####################33

QSplitter测试

上一篇:在 Golang 中用名字调用函数


下一篇:蓝桥杯基础练习VIP-报时助手