Qt-Resizing window

View: New views
8 Messages — Rating Filter:   Alert me  

Qt-Resizing window

by Keval Vora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hii,
I was trying to write a code through Qt creator. On a click of a button, a
label simply disappears. I was able to disappear the label but I could not
resize the window. Instead, the layouts in the window managed to get the
button to the center of the window.
Is there a direct method/slot to resize the window?

--
Thanks & Regards,
Keval Vora.


[Non-text portions of this message have been removed]


Re: Qt-Resizing window

by Anirudh Ramachandran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did not understand what you are trying to do. Could you please
explain with code?


2009/6/25 Keval Vora <kevalvora@...>:

>
>
> Hii,
> I was trying to write a code through Qt creator. On a click of a button, a
> label simply disappears. I was able to disappear the label but I could not
> resize the window. Instead, the layouts in the window managed to get the
> button to the center of the window.
> Is there a direct method/slot to resize the window?
>
> --
> Thanks & Regards,
> Keval Vora.
>
> [Non-text portions of this message have been removed]
>
>

Re: Qt-Resizing window

by Keval Vora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jun 26, 2009 at 1:38 PM, Anirudh Ramachandran <pitbull.159@...
> wrote:

> I did not understand what you are trying to do. Could you please
> explain with code?
>

Ok, there is a window, it has a button and a label with caption "Hello" in
it. Now, when I click this button, I want to make the label invisible. So I
used "clicked(bool)" signal of button and "setVisible(bool)" slot of label.

Using this my goal was easily achieved. But, the window size remains as it
is. It does not change to the least possible size required. The layout
automatically brings the button on the center and there is blank space all
over around.

So is there a defined slot of resizing as I want or to change the way layout
acts?


Thanks & Regards,
Keval Vora.


[Non-text portions of this message have been removed]


Re: Qt-Resizing window

by Keval Vora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Any Idea?

--
Thanks & Regards,
Keval Vora.


[Non-text portions of this message have been removed]


Re: Qt-Resizing window

by Anirudh Ramachandran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/6/29 Keval Vora <kevalvora@...>:
>
>
> Any Idea?
>

Unable to find a resizing slot in the documentation. I think we will
have to work with the layout only. Sorry for the late reply, was
working on some college-related stuff.

> --
>
> Thanks & Regards,
> Keval Vora.
>
> [Non-text portions of this message have been removed]
>
>



--
Anirudh R
(tarantinofan.wordpress.com)

"There nearly always is method in madness. It's what drives men mad,
being methodical."

Re: Qt-Resizing window

by Anirudh Ramachandran :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/6/30 Anirudh Ramachandran <pitbull.159@...>:
> 2009/6/29 Keval Vora <kevalvora@...>:
>>
>>
>> Any Idea?
>>
>
> Unable to find a resizing slot in the documentation. I think we will
> have to work with the layout only. Sorry for the late reply, was
> working on some college-related stuff.

Write a new slot.
New slot = call QWidget::adjustSize() + call QWidget::repaint()

Fun. :)

By the way, college-related stuff = Context Free Grammars and Natural
Language Constructs applied to classical tamil poetry. Awesome stuff,
especially since I am tamil myself! :)

>
>> --
>>
>> Thanks & Regards,
>> Keval Vora.
>>
>> [Non-text portions of this message have been removed]
>>
>>
>
>
>
> --
> Anirudh R
> (tarantinofan.wordpress.com)
>
> "There nearly always is method in madness. It's what drives men mad,
> being methodical."
>



--
Anirudh R
(tarantinofan.wordpress.com)

"There nearly always is method in madness. It's what drives men mad,
being methodical."

Re: Qt-Resizing window

by Keval Vora :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey thanks, it worked!!!

:)


[Non-text portions of this message have been removed]


Re: Qt-Resizing window

by Saifi Khan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 25 Jun 2009, Keval Vora wrote:

> Hii,
> I was trying to write a code through Qt creator. On a click of a button, a
> label simply disappears. I was able to disappear the label but I could not
> resize the window. Instead, the layouts in the window managed to get the
> button to the center of the window.
> Is there a direct method/slot to resize the window?
>

How about trying to code by referring to the documentation here
http://doc.trolltech.com/index.html

Are you creating the window using 'QWidget' ?

If yes, checkout
http://doc.qtsoftware.com/4.4/qwidget.html

working with Qt Creator is a nice idea when you know Qt !


thanks
Saifi.