PDA

View Full Version : Simple problem with layout



damon_1990
17th October 2011, 22:39
Hi. I have a simple problem with layout. I'm creating label and text edit:


QLabel *label = new QLabel("Label:");
QTextEdit *textEdit = new QTextEdit;

QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(label);
layout->addWidget(textEdit);


and I'm getting something like:


------------------------

|-------------|
|-------------|
Label: |-------------|
|-------------|
|-------------|




but I would like to get this:



------------------------

Label: |-------------|
|-------------|
|-------------|
|-------------|
|-------------|


How to do that? Thanks in advance.

starkid
17th October 2011, 22:53
You can try the setAlignment function.

damon_1990
17th October 2011, 23:02
Yes, it works. Thanks for help.