Problem with TextArea with scrolling

Hi all

In my application I use qml custom page (simple text editor) that have only one line with 5 buttons, second row have a textField and the rest of the screen is TextArea, nested/arranged in containers bit. Content of the text box is filled by reading text file:

I use

QTextStream in(&file);
while (!in.atEnd()) {
textHolder->setText(in.readAll().toUtf8());

But, sometimes, text is passed in a single line in the text box, even if the file contains more lines, spaces etc. I used the same code for plain program Qt and the content of the file is displayed as shown in the text file.

Following problem, after the filling of the text box visible set with input from the keyboard, the TextArea scrools automatically, but up to a certain number of lines of text (10 +-) and it borders them. I cannot scrool it up nor down. With the help of resetText() resets the content of the static text, but does not return to the top. Tried to use the ScrollView, but without success. It's preety * beep * useless.

In addition, when the virtual keyboard appears, top of TextArea overlaps the textlabel. Had no idea how to solve this problem.

I did the same thing in Qt for the PB and it works without problem, but stunts gives me headaches

Here is my qml file

import bb.cascades 1.0
import Dialog.FileBrowse 1.0
import Dialog.FileSave 1.0

Page {
   content:
   Container {
        layout: StackLayout {
        }

    //main container
    Container {
            layout: StackLayout {
                layoutDirection: LayoutDirection.LeftToRight
                bottomPadding: 5.0
                leftPadding: 5.0
                rightPadding: 5.0
                topPadding: 5.0
            }
          //  scrollMode: ScrollMode.None
            Button {
                objectName: "open"
                text: "Open"
                onClicked: {
                    filebrowseDialog.show();
                }
                attachedObjects: [
                    FileBrowseDialog {
                        id: filebrowseDialog
                        objectName: "fb"
                        multiselect: false
                        filters: [
                            "*.doc",
                            "*.txt",
                            "*.html",
                            "*.htm",
                            "*.dat",
                            "*.php",
                            "*.*"
                        ]
                        onSelectionCompleted: {
                            if (filebrowseDialog.filepaths.length > 0) {
                                labelID.text = filebrowseDialog.filepaths[0];
                                cs.on_openButton_clicked(filebrowseDialog.filepaths[0]);
                            } else {
                                labelID.text = "Nothing selected";

                            }
                        }
                        onSelectionCancelled: {
                           // labelID.text = "File open cancelled";

                           //simulator test, comment it out for release!!!
                           labelID.text = "no REAL file selected";
                           cs.on_openButton_clicked("test.txt");
                        }
                    }
                ]
            }
            Button {
                objectName: "close"
                text: "Clear"

            }
            Button {
                objectName: "save"
                text: "Save"

            }

            Button {
                objectName: "saveAs"
                text: "Save As.."
                attachedObjects: [
                                    FileSaveDialog {
                                        id: filesavedialog
                                        objectName: "fs"
                                       // filesave_filename: "test.txt"

                                        onSelectionCompleted: {
                                            labelID.text = "Saved to: " + filesavedialog.filepaths[0];
                                            cs.on_saveAsButton_clicked(filesavedialog.filepaths[0]);
                                    }
                                    }
                                ]
                                onClicked: {
                                    filesavedialog.show();
                                }
            }
            Button {
                objectName: "exit"
                text: "Exit"
            }
        }
        Container {
            leftMargin: 0.0
            layout: StackLayout {
                leftPadding: 5.0
                rightPadding: 5.0
                bottomPadding: 5.0
            }
            Label {
                id: labelID
                objectName: "documentName"
                text: ""
                layoutProperties: StackLayoutProperties {
                    verticalAlignment: VerticalAlignment.Center
                    horizontalAlignment: HorizontalAlignment.Center
                }
            }
            ScrollView { id: scrollableTextHolder scrollViewProperties.scrollMode: ScrollMode.Vertical Container { TextArea { objectName: "contentHolder" inputMode: TextAreaInputMode.Text preferredWidth: 1270.0 minWidth: 1270.0 maxWidth: 1270.0 preferredHeight: 590.0 minHeight: 590.0 //maxHeight: 2048.0 } } }
        }
    }
}

Sorry for the late reply, I've corrected the problem last night. Read the file with this

QTextStream in(&file);
textHolder->setText(in.readAll());

or this

QString line = "";
QChar theChar;
while (!in.atEnd()) {
in.operator >>(theChar);
qDebug() << "text redden(QChar): " << theChar << endl;
qDebug() << "character is(category): " << theChar.category() << endl;
line.append(theChar);
}
textHolder->setText(line);

Returns the integer values of whitespace and newline characters are OK. Problem saving the contents of the file.

Somehow QTextStream recognizes the line break characters and spaces like [QChar:eparator_Space7Unicode Zs class name] and [QChar:ther_Control10Unicode name of the class Cc] that are correct but refuses to write them to the file.

I used this to solve my problem.

QTextStream out(&file);
            for(int i=0;itext().length();++i){
                                    qDebug() << "text to be written: " << QChar(textHolder->text().at(i)) << endl;
                                    qDebug() << "character is(category): " << textHolder->text().at(i).category() << endl;
                                    if(textHolder->text().at(i).category() == 10){
                                    out << "\n";
                                    }
                                    else{
                                        out << textHolder->text().at(i);
                                    }
                                }
            out.flush();

Tags: BlackBerry Developers

Similar Questions

  • M45 S351 problems with scrolling using the touchpad

    I have some problems with scrolling with the touchpad. In some applications, like Mozilla Thunderbird, the touchpad scrolling does not at all! If I contact the right side of the touchpad by finger in Thunderbird, I see the label of Scroll on the screen, but no scrolling occurs. What is the problem? In Opera, I need to click on the browser page to 'activate' the touchpad scrolling and it also irritates cause in IE I do not have such problems: I have lunch just Explorer and scrolling of the works from the beginning... How to solve this problem?

    [Edited by: admin on August 29, 2006 06:52]

    Fix for that is unknown to me, but it turns out that the unit has been tested only with Microsoft products (Designed for Microsoft WXP label applied on the device) and not with other third-party software of the part. This function is not only an example. There are many of them. Please don t see this as a problem.

    On this path, I will not say that you MUST use just preinstalled stuff but there are many things that you have to live with.

    Perhaps someone else knows more about it.

    Good bye

  • Satellite L500-1ZP - problems with scrolling

    My Satellite L500-1ZP has problems with scrolling via mouse, touchpad or up/down keys...; the window keep turning towards the start window and the content in the lower part can be kept still. The scroll in the pane bar right guard stutter and go back to the basic position.
    Very annoying.

    Does anyone have an idea for a viable solution?

    A little more info about your latest activities can be very useful.
    I can't imagine you have this problem all the time and I would like to know since when you have this strange problem.

    If you have installed something that can have a negative influence on the scrolling feature?
    Have you tried to roll back the BONES to the bygone era?
    Have you tried to do something to make it work again?

  • I have a problem with scrolling and typing on the computer.

    Original title: I have problems with scrolling and typinging after a minute or so without the computer trying to go in the background, any help would be great because I will to throw the mouse across the screen very soon

    as noted above, totally tired, I must right click of mouse to wake up on this page, I did it while typing grrrr big time. Help pleeeease

    Hello

    Thanks for posting your question in the Microsoft community.

    I see that you have a hard time to work with the mouse.

    1. What is the brand and model of the mouse?
    2. The problem occurs on any program or when you perform a task in a particular program?

    Try these steps and see if that solves the problem of performance of your mouse.

    Method 1:

    You can check that the mouse buttons are set correct.

    Refer to the section "Change how the mouse buttons works", from following link to learn more about the same:

    Change the settings of the mouse

    http://Windows.Microsoft.com/en-us/Windows7/change-mouse-settings

    Method 2:

    You can uninstall and reinstall the drivers for the mouse on your computer, to do so follow the steps mentioned below.

    a. click Start, click Control Panel , and then click Device Manager. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    b. in the Device Manager, look for the device under the mouse and other pointing devicesand then double-click the device name.
    c. click on the Driver tab, and then click uninstall the driver.

    d. restart the computer and it will automatically re - install the drivers of.

    Note:

    You can also update mouse drivers by visiting the manufacturer's Web site.

    See this link for more information:

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

    Let us know if you need help on this question or any question about Windows.

  • Problems with scrolling after update

    IM currently using the BlueJ ide and after updating to the new system / update (macOS Sierra) there is significant lag / jitter when scrolling. This problem only occurs when you use the scrolling with two fingers with the touch pad. When I use a mouse / or click the scroll bar on the side, it seems to go well. Not sure if there is a problem with BlueJ or the new OS. Would be very interested for some suggestions on how to fix this very annoying problem. (Using a Macbook pro 13, 2015).

    Thanks a lot to all the answers

    The obvious question would be if you see the problem of scrolling in Mac OS standard applications such as Mail, Notes and Safari.

    If this isn't the case, it is likely BlueJ.

  • Problem with scrolling

    When scrolling on a Web site, the site seems broken and the text is unreadable and the photo is broken. When I start in safe mode, it is fine. What is the problem? I am using Windows XP 32-bit.
    Screenshot: http://i.imgur.com/OpBH4co.png

    Hello Triasadi, this may be a problem with hardware acceleration - try updating your graphic driveror in case this does not solve the problem, or there is no new version available at the time, disable hardware acceleration in firefox > options > advanced > General.

  • I have a problem with scrolling of mouse working on its own.

    Original title: in Windows 7, how can I stop popups, scrolling & other activities when I do click on the mouse.

    I recently moved from XP if it is not a problem.

    (1) while I read a website or a Word doc & move the cursor out of the way, it opens up the popups for no matter what cursor passes over, distract from what I'm trying to do.

    (2) in Word, when I try to highlight something to change or clear, somehow the cursor goes into scrolling on its own & does not allow me to highlight what I want.

    Basically, I would turn the mouse in what it was on XP because the "intuitive" nonsense is not help. If I want to see the popup, I can always right click. I have need it automatically sends me garbage.

    Y at - it a setting that I have not been able to find? I was well as the mouse settings and tried various combinations, but this feels like a more basic configuration question. If so, how should I do?

    Thank you

    Earl

    Thanks for your help with this.

    For some reason, the mouse was activating stuff (pop ups, etc.) when I checked precisely not to do.

    I tried what you suggested. What seems to have worked replaces the mouse. I had an arrangement to use a single set of keyboard/monitor/mouse with 3 computers, requiring the use of a mouse with the old pins instead of USB. I'm trying to do with 2 units of mouse and it seems fine. Don't know why, but I'm satisfied.

    Thanks again,

    Earl

  • Problems with scrolling Parallax and anchors

    I think Parallax scrolling is also amazing... and I want to congratulate the team of muse for a courageous solution we designers. I have a quick question though... anchor links to smooth scrolling between the sections of my site does not work. When I put and get an overview of the site in the browser (chrome) it will allow me to click but it will no the case... and if I scroll quickly once I clicked it jitters just at the same place. suggesting to me that he recorded the action (click), but not with the intention I reproduce by it. Thanks for your help

    PS Si is in the wrong section please let me know... I am new to the forum.

    Best regards

    I realized that the problem I had... Thank you very much. Let me explain with the help of others. Do not put the anchor in a part of the "Composition". What I done inadvertently because I got a lot of layers. If you put it in one smooth scrolling will not work. This is perhaps true for grouped objects. I'll also post the site to show that I finally got it to work. Thank you Zak and all parties who showed kindness to answer me.

    Best regards

    http://www.raiora.com/index.html

  • problem with scroll - the touchpad on my laptop does not work as it should.

    When I open anthing the page down to the bottom and I can't scroll to the top. I have to press the up button the page upward and sometimes that doesn't work. What ca I do t get it working again? The touchpad on my laptop does not work as it should. I should be able to press on and get my finger upwards or downwards and have the page up or dwn and this isn't. Please can you help me with this?

    In Winupdate settings provide "recommended updates" is disabled. (Allow the important updates)

    Go to your laptop manufacturers site, reinstall the touchpad drivers and graphics drivers

  • Problem with scrolling background...

    I have an item with a picture as fill and I want the image to scroll more slowly than the rest of the page, but gets to stay focused no matter how big the browser window. If I pin the image to the top of the browser, it centered, but the movement of scrolling does not work. I am eager as possible?

    Hello

    With the available options, you can either the object on the page that would set the pin position, but scrolling will not work or apply scrolling on object without right/left movement that would stick the object on the page that scrolls the other page elements.

    Thank you

    Sanjit

  • Anyone having problems with scroll wheel zoom since the 12.1 update?

    Zoom in or out in the composition with my scroll wheel window is suddenly a very inconsistent process. I'm used to be able to scroll or back to a simple 'tick' of my scroll wheel. Now, it seems that sometimes one must a huge burst of scroll wheel to zoom in at all, and then of course it is difficult zoom with precision. Single ticks no longer seem to have any effect.

    AE 12.1

    Mac OS X 10.8.5

    This bug has been fixed in update after effects CC (12,2), which was released yesterday.

    Let us know how it works for you when you tried with the updated version.

  • Help: Problem with scrolling my html and objects they keep practicing on my main menu

    Basically whenever I have put an html element in my site of Muse or any other object that I encounter a problem when scrolling downwards beyond this object in the preview. I have a menu bar horizontally located on the top of my site and whenever I scroll html elements and objects

    cut through my menu. Is it possible to fix this? -J' tried pinning of items but may not know. Any help would be greatly appreciated.

    Thank you

    So, you have a Menu pin in the master page but are bunk by page objects when you scroll down? If this is the case, select the Menu in the Master, right-click on it and move to master in the foreground.

    Thank you

    Vinayak

  • Problem with scrolling of streaming images

    Okay, so I have a horizontal scrolling of the image which consists of several thumbnails.  When you move your mouse to the left it goes left, move to the right and he goes right.  You get the story.

    Here, the problem is somewhere by the continuous loop.  I have properly in loop.  There are masks on each thumbnail.

    I have two instances of the same movieclip that contains thumbnails right next to the other.  This allows the loop.

    When two instances of thumbnails are both on the screen at the same time, some of them lose their masks while they are on the scene.  Why is this?

    you use actionscript to assign masks?

  • problems with scroller

    Hello

    I'm bulding bulder Flash 4, a request

    My problem is that the application is too big (height wise) to shown regularly and don't need a scroller.

    I managed to place the cutting wheel, the only problem is that even if I have a scroller, I can't scroll to the bottom of the page.

    (I can't yet see the down arrow button on the wheel...)

    someone knows why?

    Flex (flash builder) 4

    AS3

    Thank you and Bravo,

    Sagi.

    Hello

    Possibly, you have the apps of the minwidth/minheight value. delete the minwidth and minheight properties and see if that solves the problem.

    David.

  • Satellite A350/07F - problem with scrolling of the docs

    Hello

    I have a question about the use of my Touch Pad of Toshiba Satellite A350/07F - laptop HNX.

    It turns out that after some time the search will stop automatically and then I have to restart my laptop so he could start again. It also stops to scroll down if I keep my cell blocked for an hour or two. No idea how to change the settigs so that this does not happen.

    Thank you guys.

    AFAIK for scrolling on touchpad it will be activated virtual bar on the right side of the touchpad.
    Try to check this in mice advanced settings where you can set all this. Disable this option and try to activate again.

    On my Satellite A300, it works fine.

  • Need help on Synaptics touchpad. Problem with scroll at startup

    I have HP DV6 7040tx. After updating the driver the latest Synaptics v.11, the zoom feature scrolling in and out does not work on startup whenever I need to open the application of synaptics and then press ok. all alone, the touchpad feature works such as scrolling. But first the functions of the touchpad works at startup without opening the application from the control panel in the start menu... Help me please so that the functionality of the touchpad works at startup...

    The synaptics software is supposed to load on start automatically, you don't have it disabled?

Maybe you are looking for

  • I rented a movie from iTunes since my apple tv.  I can watch this movie rented on my iMac?

    I rented a movie from iTunes since my apple TV.  I can watch this movie rented on my iMac?

  • Shared in Teststand variable: error-17500

    Hello I'm trying to deploy a shared library that contains shared variables that I use inside step (screws). But I have error-17500 poping up-to the top whenever I'm trying to deploy it (see attached photo). It says that I need the module "the remote

  • Pavilion dv7 &amp; new discs Blu - ray plays not

    My laptop is a little older than a year.  A few months ago I bought my first Blu - ray (copyright 2009) movie and it plays well with HP MediaSmart.  A few days ago, I bought my second movie Blu - ray (copyright 2011/2012) and it won't play at all.  "

  • cannot accept any update

    Description of the problem: whenever I update recently, I no longer can I open a session to the Explorer. I have hidden all the update after having traveled back in time, i.e. the restore point. I can't access to Itunes, or create an account with Sky

  • Lightroom Mobile (Android) - cannot copy and paste settings

    I recently started using Lightroom Mobile on my Android phone, and I find it very useful.I found the menu that appears if you press on a picture - it was 'copy settings... ". "and"Paste Settings... ". "as an option, but these are still grayed out.How