Results 1 to 4 of 4

Thread: Integration of a QTextEdit

  1. #1
    Join Date
    Apr 2009
    Posts
    87

    Integration of a QTextEdit

    I am trying to include QTextEdit widget in main... I am able to do so (with a code given below), I want you to insert or help me put my QTextEdit:
    Code:
    # include <QApplication> 
      # include <QtGui> "Fe.h" 
      # include "Fe.h" 
    
      int main (int argc, char * argv []) 
      ( 
          QApplication app (argc, argv); 
    
          Fe window; 
          window. show (); 
    
          return app. exec (); 
      ) 
    
    
    
    Fe.h 
      # ifndef HEADER_FE
      # define HEADER_FE
    
      # include <QtGui> 
    
      Fe class: public QMainWindow 
      ( 
    	  public: 
    		  Fe(); 
    
    	  private: 
    
      ); 
    
    
      # endif 
    
    
    
    Fe.cpp 
    
    Code: C + +  1 
      2 
      3 
      4 
      5 
      6 	  # include "Fe.h" 
    
      Fe: Fe () 
      ( 
    
      )

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Integration of a QTextEdit

    As you are inside the class uses the this pointer
    Code:
    # include "Fee.h" 
    
      Fe: Fe () 
      ( 
          QTextEdit * textarea = new QTextEdit (this); 
    
          QVBoxLayout * layout = new QVBoxLayout; 
          layout -> addWidget (textarea); 
          setLayout (layout); 
      )

  3. #3
    Join Date
    Jan 2009
    Posts
    199

    Re: Integration of a QTextEdit

    The QTextEdit class provides a widget that is used to edit and display both plain and rich text. Example : QTextEdit ( const QString & text, const QString & context = QString::null, QWidget * parent = 0, const char * name = 0 ), QTextEdit ( QWidget * parent = 0, const char * name = 0 ).

  4. #4
    Join Date
    Dec 2008
    Posts
    177

    Re: Integration of a QTextEdit

    It is a QMainWindow, so no layout, but a central widget.
    Code:
    # include "Fe.h" 
    
      Fe: Fe () 
      ( 
          QTextEdit * textarea = new QTextEdit (this); 
          setCentralWidget (textarea); 
      )

Similar Threads

  1. Change the background color of QTextEdit
    By Gomeler in forum Software Development
    Replies: 3
    Last Post: 27-11-2009, 01:13 PM
  2. Center the text in a QTextEdit
    By Zool in forum Software Development
    Replies: 3
    Last Post: 14-11-2009, 01:32 PM
  3. Integration Win SP2 impossible
    By Volodymyra in forum Operating Systems
    Replies: 2
    Last Post: 21-01-2009, 10:53 PM

Tags for this Thread

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
  •  
Page generated in 1,716,348,844.10355 seconds with 17 queries