Results 1 to 9 of 9

Thread: how to resize top level widget in mainwindow .....

  1. #1
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default how to resize top level widget in mainwindow .....

    m_pCameraWidget = new CameraWidget(this); // was declared in main application constructuor // Qwidget class name as m_pCameraWidget i has given.....


    // in camera Qwidget i has given
    void CameraWidget::mouseDoubleClickEvent(QMouseEvent *event)
    {
    if(!isMaximized())
    {
    showMaximized();
    }
    else
    {
    showNormal();
    }

    }

    m_pCameraWidget = new CameraWidget(this); //how to resize camerawidget is the top level widget where (this) is mainwindow

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to resize top level widget in mainwindow .....

    Quote Originally Posted by mouni View Post
    m_pCameraWidget = new CameraWidget(this); //how to resize camerawidget is the top level widget where (this) is mainwindow
    A top level widget, like any other widget, can be resized by calling resize() or setGeometry().

    The rest of the posting looks like you have accidentally copied&pasted content of one of your earlier postings.

    Cheers,
    _

  3. #3
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: how to resize top level widget in mainwindow .....

    i called set geometry it is not resizing...


    when we remove (this) then it is resizing.....


    can anybody tell why it is not resizing


    camerawidget is frameless widget.....

  4. #4
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default How resize frameless widget on mouse double click

    Hi Freinds,

    can any body give some code for mouse double click...

    First when i click mousedouble click it should resize to (800,800)..

    again i mouse doubleclick it should set to (320,240)....

    can any body give some solution with code i am learner i am enable to write code for that...


    plz help me...

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to resize top level widget in mainwindow .....

    Did you add the widget to a layout?

    Cheers,
    _

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How resize frameless widget on mouse double click

    This is extremely borderline to a multi post, please don't do that.

    And you yourself have already posted code that reacts to mouse double click, just call resize instead of what you did in those code snippets.

    Cheers,
    _

  7. #7
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: how to resize top level widget in mainwindow .....

    no i am not added to layout it is seperate widget for that widget i added layout

  8. #8
    Join Date
    Sep 2014
    Posts
    94
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: How resize frameless widget on mouse double click

    gave resize but it is not resizing that widget inherited to mainwindow and widget is frameless widget..... that is seperate widget

  9. #9
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to resize top level widget in mainwindow .....

    You write that "this" is a QMainWindow.

    Where in the main window do you put the child widget?
    The only child widget a developer is supposed to add directly is the central widget, because the main window has a rather complex layout.
    What is the child derived from? Is it a window or an embedded widget?

    There is really no point of spreading bits of information over several threads, this just makes it more complicated to follow.
    I'll merge the threads.

    Cheers,
    _

Similar Threads

  1. resize tableview when resizing mainwindow
    By AlstomATS in forum Newbie
    Replies: 1
    Last Post: 12th September 2013, 09:43
  2. Resize widget inside mainwindow (during runtime)
    By alenn.masic in forum Qt Programming
    Replies: 0
    Last Post: 30th August 2012, 21:50
  3. Replies: 0
    Last Post: 6th November 2011, 09:22
  4. Replies: 0
    Last Post: 18th January 2011, 16:59
  5. MainWindow won't resize, why does this work?
    By weevil in forum Qt Programming
    Replies: 1
    Last Post: 20th June 2010, 07:08

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.