Results 1 to 6 of 6

Thread: extended dialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Posts
    13
    Thanks
    1
    Platforms
    Unix/X11

    Default Re: extended dialog

    ohh thanks I copied from book and made that mistake thanks a lot.. nd plz tell me one more thing
    If I include following line in program then the program is finished unexpectedly:
    layout()->setSizeConstraint(QLayout::SetFixedSize);
    Otherwise it is workin fine ...plz tell..

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: extended dialog

    If you fix the wrong quotes in main.cpp and sortdialog.cpp your program still does not compile. You need to implement SortDialog::setColumnRange() (it's in the book).

    Your program crashes at that line because layout() returns 0. You need to apply a layout to the dialog in Designer.
    Last edited by ChrisW67; 31st July 2012 at 01:31.

  3. #3
    Join Date
    Jul 2012
    Posts
    13
    Thanks
    1
    Platforms
    Unix/X11

    Default Re: extended dialog

    Oh I did implement setColumnRange() in my code ... bt I think forgot in the code that I have attached here...and as far as problem with layout()->setSizeConstraint(QLayout::SetFixedSize); is concerned i think forgot to rename the layout in Qt designer....I ll see that thanks...
    Last edited by arjita; 31st July 2012 at 07:59.

  4. #4
    Join Date
    Jul 2012
    Posts
    13
    Thanks
    1
    Platforms
    Unix/X11

    Default Re: extended dialog

    Now my code is working fine with no error but the dialog box doesn't hold resize property... here I am giving the snapshots of what is being displayed..
    Screenshot.jpg
    after I click more button following is diaplyed..
    Screenshot-1.jpg

    and my code...
    Qt Code:
    1. #include <QtGui>
    2. #include "sortdialog.h"
    3. SortDialog::SortDialog(QWidget *parent)
    4. : QDialog(parent)
    5. {
    6. setupUi(this);
    7. secondaryGroupBox->hide();
    8. tertiaryGroupBox->hide();
    9. formlayout->layout()->setSizeConstraint(QLayout::SetFixedSize);
    10. setColumnRange('A', 'Z');
    11. }
    12. void SortDialog::setColumnRange(QChar first, QChar last)
    13. {
    14. primaryColumnCombo->clear();
    15. secondaryColumnCombo->clear();
    16. tertiaryColumnCombo->clear();
    17. secondaryColumnCombo->addItem(tr("None"));
    18. tertiaryColumnCombo->addItem(tr("None"));
    19. primaryColumnCombo->setMinimumSize(secondaryColumnCombo->sizeHint());
    20. QChar ch = first;
    21. while (ch <= last) {
    22. primaryColumnCombo->addItem(QString(ch));
    23. secondaryColumnCombo->addItem(QString(ch));
    24. tertiaryColumnCombo->addItem(QString(ch));
    25. ch = ch.unicode() + 1;
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 
    in above code formlayout is the grid layout of the form..
    I also changed my ui file as attached...
    sortdialog.ui
    Plz someone tel me what should I do to have resizable property...

Similar Threads

  1. Replies: 6
    Last Post: 17th January 2010, 11:47
  2. How to use qtopiadesktop in qt-extended-4.4.2?
    By jevonwang in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 11th May 2009, 07:21
  3. Extended Tooltip
    By aamer4yu in forum Qt Programming
    Replies: 12
    Last Post: 26th July 2008, 11:18
  4. Anthias : An extended terminal
    By ePharaoh in forum Qt-based Software
    Replies: 5
    Last Post: 9th January 2008, 15:55
  5. extended selection in q3listview
    By sreedhar in forum Qt Programming
    Replies: 7
    Last Post: 13th November 2006, 09:03

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.