Results 1 to 3 of 3

Thread: facing a trouble on QFileDialog

  1. #1
    Join Date
    Sep 2009
    Posts
    54
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question facing a trouble on QFileDialog

    Dear Friends,
    I want to reduce the size of QFileDialog , i tried using setFixedsize(x,y) function but the dialog size is not changing. the code is given below.

    Qt Code:
    1. file->setFixedSize(320,240);
    2. const QString fileName = file->getOpenFileName(this, Open File"),currentPath());
    To copy to clipboard, switch view to plain text mode 

    thanks

    Regards Askar

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: facing a trouble on QFileDialog

    getOpenFileName is a static function. It will call the native dialog. So am afraid you might not be able to resize it. Am not sure though.

  3. #3
    Join Date
    Jun 2009
    Location
    India
    Posts
    143
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Smile Re: facing a trouble on QFileDialog

    Us the below code and try it

    Qt Code:
    1. dlg.setWindowTitle("Open");
    2. dlg.setAcceptMode(QFileDialog::AcceptOpen);
    3.  
    4. dlg.setFileMode(QFileDialog::AnyFile);
    5. dlg.setViewMode(QFileDialog::List);
    6. dlg.setDirectory("/");
    7. dlg.resize(320,240);
    8. dlg.exec();
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to augusbas for this useful post:

    Askar (12th February 2011)

Similar Threads

  1. I am facing a problem please help me !
    By sujan.dasmahapatra in forum General Programming
    Replies: 3
    Last Post: 16th September 2009, 14:12
  2. i am facing a problem with QTextEdit!!!
    By mismael85 in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2008, 18:06
  3. Facing problem with Q3Canvas
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 6th May 2006, 07:00
  4. Facing problem with tool bar icons
    By jnana in forum Qt Programming
    Replies: 4
    Last Post: 20th April 2006, 08:37
  5. Facing problem with qt-4.1 designer
    By jnana in forum Qt Tools
    Replies: 4
    Last Post: 8th March 2006, 18: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
  •  
Qt is a trademark of The Qt Company.