Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Custom TextArea with visible text outside. How?
Qt 6.11 is out! See what's new in the release blog

Custom TextArea with visible text outside. How?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 66 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bogong
    wrote last edited by bogong
    #1

    Hello all!

    Need to create custom QML TextArea component. Something like this:

    Screenshot 2026-04-23 at 06.57.08.png

    The requirements for this component is:

    • the text outside of TextArea need to be visible, already tried 'clip' with 'false' value, it's not working.
    • cursor need to be at one place positioned relatively to the TextArea itself, need to be illusion that text is around cursor
    • scrollbar customised and positioned differently

    Tried to use TextArea inside of ScrollView:

    ScrollView {
                width: parent.width - 50
                height: 50
                clip: false;
                TextArea {
                    placeholderText: "Enter your message here..."
                    wrapMode: TextArea.Wrap;
                    clip: false;
                }
            }
    
    Column {
    
            anchors.fill: parent
            clip: false
    
            ScrollView {
    
                width: parent.width
                height: 200;
                clip: false; 
    
                TextArea {
    
                    id: oTextArea
                    text: "Text...Text...Text...Text...Text...Text..." 
                    wrapMode: TextArea.Wrap
                    clip: false
                }
            }
        }
    

    Different types of wrap mode and false value for clipping in different components.

    Tried to use TextFiled:

    TextField {
    
    	id: oRoot;
    	wrapMode: TextArea.WrapAtWordBoundaryOrAnywhere;
    	clip: false;
    }
    

    Nothing is affecting clipping, everything is by component border. Technically need to make clipping by 'with' within wrapping by word and make visible by 'hight'.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved