Results 1 to 4 of 4

Thread: Scrollbars are broken for textedit when resized....stumped

  1. #1
    Join Date
    Feb 2021
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Exclamation Scrollbars are broken for textedit when resized....stumped

    I am trying to create a program that uses textedit to append text when certain commands are written....I would like for the textedit to scroll to the bottom upon executing the command. However, it cuts off text upon doing so.

    I have searched google high and low and not one solution has been found.....

    My project is here: https://github.com/voncloft/VPacman

    the following code breaks the scrollbars:

    Qt Code:
    1. void MainWindow::resizeEvent(QResizeEvent*)
    2. {
    3. ui->plainTextEdit->setGeometry(MainWindow::width()-300,0,280,40);
    4. ui->textEdit->resize(MainWindow::width()-30,MainWindow::height()-30);
    5. ui->listWidget->resize(MainWindow::width()-30,300);
    6. updateGeometry();
    7. }
    To copy to clipboard, switch view to plain text mode 

    I need to be able to resize the entire "application" and have the "pieces" move and resize as needed if I disable the resize for ui->textedit it works just fine but I can't dynamically increase or decrease its size....which is what I need.

    Any ideas?

    Thanks.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    474
    Thanks
    10
    Thanked 62 Times in 60 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbars are broken for textedit when resized....stumped

    Hi, it looks like you don't use layouts. Is there a reason why? They would take care of resizing your widgets.

    Ginsengelf

  3. #3
    Join Date
    Feb 2021
    Posts
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Scrollbars are broken for textedit when resized....stumped

    Quote Originally Posted by Ginsengelf View Post
    Hi, it looks like you don't use layouts. Is there a reason why? They would take care of resizing your widgets.

    Ginsengelf
    I am new to this didnt't even know it was an option.


    Added after 23 minutes:


    Quote Originally Posted by voncloft View Post
    I am new to this didnt't even know it was an option.
    Any particular one I should use I see 4 of them Vertical, Horizontal, Grid, and form
    Last edited by voncloft; 24th February 2021 at 10:01.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,014
    Thanks
    280
    Thanked 816 Times in 805 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Scrollbars are broken for textedit when resized....stumped

    Any particular one I should use I see 4 of them Vertical, Horizontal, Grid, and form
    Post a screenshot of your application. That would help with deciding on a recommendation.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 0
    Last Post: 3rd November 2016, 23:27
  2. Connect two different textedit scrollbars
    By MrAnderson1983 in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2014, 10:19
  3. Linker errors migrating from QT4 to QT5 - Am stumped please help
    By #undef _sense_of_humor in forum Newbie
    Replies: 3
    Last Post: 4th April 2014, 01:19
  4. Qt Designer Stumped by Grid stretch setup.
    By winkle98 in forum Qt Tools
    Replies: 0
    Last Post: 9th February 2012, 01:00
  5. Cant get qmysql to work, im stumped..
    By tgreaves in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2009, 19:48

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.