Results 1 to 3 of 3

Thread: Set QPlaiTextEdit as central widget in QT Designer

  1. #1

    Default Set QPlaiTextEdit as central widget in QT Designer

    Hi all

    Just finished to search into the forum for similar problem but not found satisfying reply. I need to create a SDI like application. I'm creating the main window using QT Designer but I still didin't find a way for set a QPlainTextEdit control as central widget. For similar request someone suggested to drop the text widget over central widget, set the central widget layout vertical or horizontal mode and set text widget as expanding. This work but not complitely. I mean, using this way the text widget is automatically centered and resized based to the main window size but doesn't fill all the central widget area. Borders still appears around the text widget and doesn't look like a real SDI application where the text control fill all the entire area of the central window part.

    Someone have a solution for this problem?

    Thank you

  2. #2
    Join Date
    Nov 2006
    Location
    indonesia
    Posts
    55
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Set QPlaiTextEdit as central widget in QT Designer

    Hi,
    You can set contents margin layout with 0 like this :
    Qt Code:
    1. centralwidget = new QWidget(MainWindow);
    2. gridLayout->setSpacing(0);
    3. gridLayout->setContentsMargins(0, 0, 0, 0);
    To copy to clipboard, switch view to plain text mode 

    And set QPlainTextEdit frameShape to QFrame::NoFrame.
    Qt Code:
    1. plainTextEdit->setFrameShape(QFrame::NoFrame);
    2. plainTextEdit->setLineWidth(0);
    To copy to clipboard, switch view to plain text mode 

    Are this metod solve your problem?
    Thank you.

    Best regards,

    Toto

  3. #3

    Default Re: Set QPlaiTextEdit as central widget in QT Designer

    Hi Toto

    Thank you very much for your suggestion.

    Basically the problem was not in QT Designer but in my mind since I'm an idiot and I should to check better the available widgets properties before annoy other users in the forum.

    I didn't use your coding solution since, thanks to your input, I found the layour margins properties in QT Designed that allow me to set the text control inside central widget to fill the entire area of the window (setting all the left, right, top and bottom margin values of central widget as zero).

    Thank you very much again for your help

Similar Threads

  1. Central Widget Max Height
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2011, 18:26
  2. Replies: 8
    Last Post: 28th June 2011, 14:57
  3. Qt Designer About central widget in Qt Designer
    By lrjdragon in forum Qt Tools
    Replies: 2
    Last Post: 3rd April 2010, 16:11
  4. QDockWidgets without central widget
    By JoeMerchant in forum Qt Programming
    Replies: 17
    Last Post: 8th August 2007, 14:52
  5. Replacing Central Widget in Designer
    By Max Yaffe in forum Qt Tools
    Replies: 2
    Last Post: 11th July 2007, 11:41

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.