×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    11

    How to add the data from the bottom right of QTextEdit?.

    Hi,

    I added a QTextEdit widget in read only mode as shown below, if i set the alignemt right able to add the data from the right, i tried modifying that to Qt::AlignBottom which was not working as expected. Please provide me the solution how to add the data from bottom right of QTextEdit and append the data from bottom?. means i need to scroll the data from bottom up.

    log = new QTextEdit();
    log->setReadOnly(true);
    log->setAlignment(Qt::AlignRight);
    log->setText("check");

    Thanks
    Madhu.

  2. #2
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: How to add the data from the bottom right of QTextEdit?.

    Hi,

    As you can see from documentation of QTextEdit (http://doc.trolltech.com/4.5/qtexted...l#setAlignment) bottom alignment for this widget is not
    supported.

    As you are already working with read only text, could you try to work with QLabel?
    E.g.
    QLabel *label = new QLabel(this);
    label->setFrameStyle(QFrame::Panel | QFrame::Sunken);
    label->setText("first line\nsecond line");
    label->setAlignment(Qt::AlignBottom | Qt::AlignRight);

    Cheers,
    FB

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    11

    Re: How to add the data from the bottom right of QTextEdit?.

    Hi FB,

    But QLabel doesn't have the method append(), i want to append the lines to QTextEdit from bottom to top. Please let me know any other widget is having both the features append and alignment to bottom right?.

    Thanks
    Madhu.

  4. #4
    Nokia Developer Champion
    Join Date
    Sep 2007
    Location
    Bhavnagar
    Posts
    928

    Re: How to add the data from the bottom right of QTextEdit?.

    Hi Dileeh,

    I think you can use a combiation of a Qstring and a label. As you told in your last post you need append functionality you can use string and than later on you can display it on label.

    Hope this helps you.

    Regards.
    Jajal Mehul

  5. #5
    Registered User
    Join Date
    Jan 2009
    Location
    ભારત->ગુજરાત->ભાવનગર
    Posts
    279

    Post Re: How to add the data from the bottom right of QTextEdit?.

    Hi Dileeh,

    I think the the james1980 is right but if you want to try something apart of this,then you can go for QLineEdit here also you can set the alingment to right and can add the data from rightside of QLineEdit.

    Hope this helps you

    Regards
    Viral Parmar

Similar Threads

  1. Replies: 9
    Last Post: 2010-06-10, 12:39
  2. help~~~about the CMdaAudioInputStream
    By Dragon_L in forum Symbian Media (Closed)
    Replies: 14
    Last Post: 2008-11-05, 06:11
  3. Replies: 3
    Last Post: 2008-09-09, 04:53
  4. Replies: 1
    Last Post: 2007-04-17, 10:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •