Results 1 to 4 of 4

Thread: QTextEdit with own wflags

  1. #1
    Join Date
    Jan 2006
    Location
    Poland/Poznań
    Posts
    14
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default QTextEdit with own wflags

    How can i create a new QTextEdit (as a new window - not child) with some extra wflags?
    The constructor doesn't allow for this - it looks like this:
    Qt Code:
    1. QTextEdit::QTextEdit( QWidget *parent, const char *name ) : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase )
    To copy to clipboard, switch view to plain text mode 
    I could use QWidget::setWFlags, but it doesn't work:
    Qt Code:
    1. class AAA : public QTextEdit
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. AAA::AAA(QWidget * parent) : QTextEdit(parent, "")
    7. {
    8. setWFlags(WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop | WDestructiveClose);
    9.  
    10. setText("aaa");
    11. show();
    12. }
    13. };
    14.  
    15. AAA *a;
    16. a = new AAA(0);
    To copy to clipboard, switch view to plain text mode 
    Qt creates normal window

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit with own wflags

    You could create QVBox with customized flags and QTextEdit inside it.

  3. #3
    Join Date
    Jan 2006
    Location
    Poland/Poznań
    Posts
    14
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QTextEdit with own wflags

    Yes, but i think it's a little bit stupid to create a new widget with QTextEdit inside, while QTextEdit is also a widget (and can be displayed as a new window as well).

    Why QTextEdit's constructor doesn't allow to specify own wflags?
    Last edited by Pan Wojtas; 28th January 2006 at 21:18.

  4. #4
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit with own wflags

    You can use reparent() to change the flags. That should work.

Similar Threads

  1. QTextEdit Performance handling large paragraphs
    By netuno in forum Qt Programming
    Replies: 14
    Last Post: 1st September 2010, 22:58
  2. Drawing on QTextEdit
    By jgrauman in forum Qt Programming
    Replies: 3
    Last Post: 7th February 2009, 09:40
  3. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  4. QTextEdit, sizeHint, QWidget
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 3rd February 2007, 08:25
  5. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.