Results 1 to 4 of 4

Thread: Expanding lineEdit in QHBoxLayout is not working properly in qt plugins

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Expanding lineEdit in QHBoxLayout is not working properly in qt plugins

    HI,
    I've created a qt plugin with comboBox and lineEdit and put them in QHBoxLayout in Qt5. when i set sizepolicy of lineEdit to expanding, it doesn't works properly. actually it expands itself a little:
    Untitled-4.png

    my code in plugin constructor is something like below:
    Qt Code:
    1. comboBox = new QComboBox;
    2. lineEditValue = new QLineEdit;
    3.  
    4. horizontalLayout = new QHBoxLayout(this);
    5. horizontalLayout->setMargin(1);
    6.  
    7. comboBox->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Fixed);
    8. lineEditValue->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
    9.  
    10. horizontalLayout->addWidget(lineEditValue,0,Qt::AlignLeft);
    11. horizontalLayout->addWidget(comboBox,0,Qt::AlignRight);
    12.  
    13. this->setLayout(horizontalLayout);
    To copy to clipboard, switch view to plain text mode 
    what i am missing?
    Last edited by alizadeh91; 27th January 2013 at 16:10.

Similar Threads

  1. virtual keyboard and lineedit are not working together
    By kinjalp in forum Qt Programming
    Replies: 0
    Last Post: 23rd February 2012, 12:37
  2. QToolbar expanding sizePolicy not working properly
    By sfcheng77 in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2011, 23:50
  3. memcpy not working properly
    By sattu in forum Qt Programming
    Replies: 3
    Last Post: 26th October 2010, 23:33
  4. Connection not properly done.... lineEdit
    By hipogrito in forum Newbie
    Replies: 4
    Last Post: 2nd April 2007, 21:53
  5. Replies: 1
    Last Post: 28th February 2007, 08:34

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.