I'm writing a logging application which is using a QListView with custom QStandardItems to display the log data. I have implemented filters in the app that will color the matching rows differently and when changing a filter I have to manipulate every item in the list, which after a while gets very slow. I'm not sure what's causing this yet, but I wonder if it could be that it repaints after every item change. If that is the case, could I somehow tell QT to not repaint until I'm done manipulating all the items?
Thanks for any help!
For helping others, I could add that I fixed this by implementing my own view that handles the paint event itself and only paints the rows currently visible on screen. This makes it extremely fast and no internal QT view seem to be able to do something similar.
Related
It seems that my view-based OutlineView try to re-render text every time user scrolling. I think that was because it tried to save memory by re-using rows that fall outside of visible rectangle, then re-render new data to those old views. How can I disable this? I'm willing to sacrifice memory to archive this so that I can get better scrolling performance. (I have tried with various optimize like layer or so, but no luck).
EDIT: There is another question with same purpose as mine here How to make NSTableView not reuse TableCellViews, but no answer yet :(
I think you are confused -- it doesn't re-render the text. The table only shows views for the visible area (caveat below), and pulls in new views as you scroll -- potentially re-using old views.
You provide the view. Use the delegate method viewForTableColumn:row: and return your own cached view for a given row.
But that isn't going to prevent drawing; the view will likely still get marked dirty and draw.
I don't think you are asking the right question. It sounds like you have a performance problem. To help you with that, we'd have to see samples or instrument traces.
Caveat: Responsive Scrolling will pull in views that are in the non visible area. See the AppKit release notes about this.
corbin
I've been banging my head against the wall (Cocoa) for about a week with this problem and wanted to get some advice if possible.
I'm trying to provide a list of NSTextFields to the user representing a list of features – letting them add additional textfields using an 'Add' button. This is part of a bigger form and the user should just be able to tab through the whole form (including the list)
I implemented the above using an NSCollectionView which pretty much worked except tabbing seemed to intermittently stop working in the NSCollectionView for reasons I can not figure out. You'll be hitting tab, cycling through normally when all of a sudden the collection view is skipped altogether, or sometimes if you're in a specific text field in the collection view hitting tab will just highlight the text but will never jump to the next field without mouse clicking outside the collection view. I was wondering if anyone had experienced this before... or has any advice for debugging something like this? I've attempted logging what the nextResponder is every time a control becomes the responder and there doesn't seem to be any pattern explaining why tabbing just stops working suddenly and then begins again.
There are 3 TabViews with a collection view in each. I have been wondering if that may be causing an issue?
Thanks for any help anyone can provide.
OK, after all this time I may have solved this (Tentatively anyway... I haven't seen any problems on numerous run-throughs and it usually occurs at least once every time before)
Turning on Auto Recalculates View Loop on the Main Window seems to have resolved whatever was happening. I have to admit I don't completely understand why, except that maybe because of the tab views and collections views the key loop needs to be recalculated to keep everything in sync. I'm thinking I need to do more research into exactly how the key loops work...
If I turn the autocorrection ON, the words get autocompleted, as if I write "wor", I get "word" before I finish writing. I don't want this to happen because I might be writing "world" or any word different than the autocompleted one.
I set Correction off in the Interface Builder and this problem is solved.
The problem now is that I still need the suggestions that appear in a little popover below the incomplete words.
This two features might be different but I don't know how to activate the suggestions.
How can I solve this?
This can be solved with the use of tableview. Create a tableview with the width as of the width of the textfield and height as you like. Place it just below the textfield. Make it hidden initially. When the user starts typing, fetch the array of data that resembles to the typed text and if any exists then, unhide the table view. On the subsequent typing keep on reloading the tableview sections with animations. You should be accurate on hiding, unhiding and then reloading the data on the tableview. I have implemented such thing before. It is really easy and once you get started with it you find it easy.
In the UITextView TextViewDidChange I created a thread that changed the cursor position. This, off course happens after the text view changes. The change of the cursor position triggers the autocomplete without letting me even see that there had been a suggestion.
I can make a single row IKImageBrowserView by setting the
[imageBrowser setContentResizingMask:NSViewWidthSizable];
but in this case while i drag an image inside image browser to rearrange it, the drop place highlights with horizontal line(vertical line expected).
how can this be changed?
Many thanks.
There is no defined way to do what you want.
You may be better off writing your own custom view where you can control every detail of how things are drawn. In general, Apple's controls are "as-is" and unless they provide an explicit way to control behavior or mention that you can custom an object in some way, don't count on being able to do it easily (if at all).
I would also suggest heading to http://bugreport.apple.com and making the enhancement request - it would be best if you attached a sample application demonstrating the behavior.
EDIT: You could also try out the NSCollectionView to see if it might work for you.
Is there a way to link two indicators on a LabVIEW front panel, so that they always have the same value? Right now I'm setting both to the same value every time, but it'd be much easier if there were a way to set up one to mirror the other.
You can make the digital display visible. Right-click on the slider and select "Digital Display" from Visible Items.
There are a few ways to achieve this, depending on how you are trying to display the data.
If you are just trying to update a slider and make a textbox indicator display the numeric value then by right clicking on the slider and selecting 'Visiable Items -> Digital Display' you will have a numeric indicator showing the value of the slider. This can then be repositioned as required. You should see if this meets your requirements as other methods will add complexity to your Block Diagram.
An alternate method would be using a network shared variable and binding the data although I think from your question this would be over kill.
You can also create an event structure to look for a value change event for the slider and update the text indicator accordingly. You would have to be careful how you update the slider as just wiring a value to the slider will not trigger an event for use a property node linked to the slider for the property 'value(signalling)'. Again this may be over the top for your application.
Strictly speaking, no, you can't do that automatically. What you can do is set up an Event Structure and use the Value Changed events for each of the two controls to update the other. Just realize that the slider fires value changed events many times while the user is sliding it around, rather than just one event at the end. That may be what you want in this situation, however.
I think this is not easily done, however there are some possibilities (as discussed).
The general question is why?
You have an indicator with the same info at two places. (or are they actual controls?)
If you have two indicators, just place there terminals next to each other, just remember when you alter one of the two (via a local or by ref) to mimic the action for it's twin.
Using a value change event for both controls should work, just remember that you might get race conditions if you don't process the event directly.
Could describe a little bit further why you need two controls for the same action/value?
Ton