Results 1 to 12 of 12

Thread: Window doesn't expand to show all elements of QHBoxLayout

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    3

    Default Re: Window doesn't expand to show all elements of QHBoxLayout

    Quote Originally Posted by marcel View Post
    Weird.
    Maybe if you can provide a compilable example it would be easier to spot the problem.

    There's no need for minimum size. Setting the fixed size should have done it.

    Regards
    Sorry marcel, but the game and the GUI are pretty entwined.
    I'm releasing this under the GPL anyways (I'm just a hobbyst ) so I'm happy to just post the sources.

    The files that are problems here are uiSettings.[hpp, cpp] uiMain.[hpp, cpp] and main.cpp.
    Attached Files Attached Files
    Last edited by Jessehk; 2nd August 2007 at 19:28.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Window doesn't expand to show all elements of QHBoxLayout

    OK.
    I have to download boost first.

    Shouldn't take more than 30-45 minutes with the whole testing.

    regards

  3. #3
    Join Date
    Jul 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    3

    Default Re: Window doesn't expand to show all elements of QHBoxLayout

    Quote Originally Posted by marcel View Post
    OK.
    I have to download boost first.

    Shouldn't take more than 30-45 minutes with the whole testing.

    regards
    Oy .

    This is highly appreciated.

    EDIT: Take all the time you need. I'm in no hurry.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Window doesn't expand to show all elements of QHBoxLayout

    OK.
    There was a problem in UISettings. You did not have a layout for the holder widget( the container of the group box ).

    Here's the fixed version:

    Qt Code:
    1. //This file is part of QtTicTac.
    2. //
    3. // QTicTac is free software; you can redistribute it and/or modify
    4. // it under the terms of the GNU General Public License as published by
    5. // the Free Software Foundation; either version 3 of the License, or
    6. // (at your option) any later version.
    7. //
    8. // QTicTac is distributed in the hope that it will be useful,
    9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
    10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    11. // GNU General Public License for more details.
    12. //
    13. // You should have received a copy of the GNU General Public License
    14. // along with this program. If not, see <http://www.gnu.org/licenses/>.
    15. //
    16. // Copyright 2007 Jesse E. H-K
    17.  
    18. #include <QApplication>
    19.  
    20. #include "uiSettings.hpp"
    21.  
    22. namespace ttt {
    23. UISettings::UISettings( QWidget *parent ) :
    24. QWidget ( parent ),
    25. settingsGroup_( new QGroupBox( this ) ),
    26. startb_( new QPushButton( tr( "&Start Game" ), settingsGroup_ ) ),
    27. quitb_( new QPushButton( tr( "&Quit" ), settingsGroup_ ) ) {
    28.  
    29. QVBoxLayout *topLayout = new QVBoxLayout(this);
    30. QVBoxLayout *vbox_ = new QVBoxLayout();
    31. vbox_->addWidget( startb_ );
    32. vbox_->addWidget( quitb_ );
    33.  
    34. settingsGroup_->setLayout( vbox_ );
    35. topLayout->addWidget( settingsGroup_ );
    36. topLayout->addItem(new QSpacerItem(1,1, QSizePolicy::Fixed, QSizePolicy::Expanding ));
    37. connect( quitb_, SIGNAL( clicked() ), qApp, SLOT( quit() ) );
    38.  
    39. }
    40. }
    To copy to clipboard, switch view to plain text mode 

    I also set a fixed size for the dialog, since the table does have a fixed size.(i did not attach that )

    Regards

    Regards

  5. The following user says thank you to marcel for this useful post:

    Jessehk (2nd August 2007)

  6. #5
    Join Date
    Jul 2007
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    3

    Default Re: Window doesn't expand to show all elements of QHBoxLayout

    That's fantastic! Thanks so much.

  7. #6
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Window doesn't expand to show all elements of QHBoxLayout

    You're welcome.

    Regards

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
  •  
Qt is a trademark of The Qt Company.