Results 1 to 5 of 5

Thread: QSplitter and QStackedWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    troy, new york
    Posts
    24
    Thanks
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QSplitter and QStackedWidget

    hi, the problem is that i have a page in within a stacked widget which won't show the first two widgets, maybe i've missed something in the docs or the forums:


    QLabel *label = new QLabel(this);
    label->setText("Compare Versions");
    label->setFont(QFont("System", 12, QFont:: DemiBold));
    label->setAlignment(Qt::AlignCenter);
    QFile file0("in.txt");
    if (!file0.open(QIODevice::ReadOnly | QIODevice::Text))
    return;
    QTextStream in0(&file0);
    QString line0 = in0.readAll();
    QTextEdit *editor0 = new QTextEdit(this);
    editor0->setFontPointSize(16.0);
    editor0->setFontWeight(QFont:: DemiBold);
    editor0->setPlainText(line0);
    QFile file1("ain.txt");
    if (!file1.open(QIODevice::ReadOnly | QIODevice::Text))
    return;
    QTextStream in1(&file1);
    QString line1 = in1.readAll();
    QTextEdit *editor1 = new QTextEdit(this);
    editor1->setFontPointSize(16.0);
    editor1->setFontWeight(QFont:: DemiBold);
    editor1->setPlainText(line1);
    QSplitter spl(Qt::Vertical, this);
    spl.addWidget(editor0);
    spl.addWidget(editor1);
    QVBoxLayout *glayout = new QVBoxLayout(this);
    glayout->addWidget(&spl);
    glayout->addWidget(label);
    setLayout(glayout);





    the label show()s, but not the editors. thanx.
    Last edited by nikita; 15th November 2006 at 04:32. Reason: missing [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.