Another Qt question

D

Damjan Rems

def create_central_widget
cw = Qt::Widget.new self
self.central_widget = cw
# Input search text
@search_text = Qt::LineEdit.new
@search_text.text = 'Search?'
# Search result list
@search_result = Qt::ListWidget.new
# Dummy fill
1.upto(100) { |i| @search_result.add_item i.to_s }
# Middle window is editor
@big_editor = Qt::TextEdit.new
@big_editor.setPlainText("Just a text")

search_area_widget = Qt::Widget.new

l = Qt::VBoxLayout.new search_area_widget cw
l.add_widget @search_text
l.add_widget @search_result

splitter = Qt::Splitter.new cw
splitter.add_widget(search_area_widget)
splitter.add_widget(@big_editor)

end
##########################################################

This is part of program which creates main window dialog.

I would like to have two areas splitted by splitter. On the left side
there a two widgets. Input search LineEdit widget and search result
ListWidget widget. They both reside on VBoxLayout.

On the second area there is big_editor TextEdit widget.

My problem is that I expect that dialog will fill whole dialog window.
It will be streched from to to bottom and from left to right. But it
doesnt. It has it's default size (which I was unuble to resize). I have
tried all kind of streches but nothing helps.

Splitter works as expected. It resizes left and right part of split area
and widget resize ok.

What am I doing wrong.

by
TheR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,121
Latest member
LowellMcGu
Top