Results 1 to 2 of 2

Thread: Resizing any kind of widget runtime

  1. #1
    Join Date
    Dec 2008
    Location
    PUNE (INDIA)
    Posts
    49
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Resizing any kind of widget runtime

    Hi I am vajindar laddad Beginner to Qt.
    Can we resize each type(kind) of a widget at runtime by stretching it using mouse , Not when the window is resized ?
    For Example-
    1) Suppose i have a pushButton can i resize it at run time using mouse ?
    2) can i resize QLineEdit at runtime using mouse?
    Thanks & Regards ,

    Vajindar Laddad .
    Trainee Developer.
    (INDIA).
    91+9325014248

  2. #2
    Join Date
    Oct 2008
    Location
    Brazil, Sao Paulo - SP
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Resizing any kind of widget runtime

    Each single component of Qt can be resized at runtime.

    One could easily implement QWidget's mousePressEvent() and mouseMoveEvent() event handlers to provide this kind of functionality on EVERY Qt Component. Other approach would be of using event filters (a smarter and scalable approach, IMHO).

    Things you should note is that if you would have a QPushButton that way, how would you differ from a click and an attempt to resize it? Other thing, when your widgets are organized under Layouts, you should be aware that some layout configurations wouldn't permit the widget resize.

    Best Regards,
    Angelo Suzuki

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Resizing back the widget
    By gruszczy in forum Qt Programming
    Replies: 6
    Last Post: 23rd November 2008, 10:14
  3. resizing events of a custom widget in a layout
    By Rooster in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2008, 10:52
  4. Replies: 5
    Last Post: 21st February 2007, 22:11
  5. Widget resizing problem
    By fwohlfert in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2006, 08:16

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.