QMultilineElement not calling QEntryDidEndEditingElement: on delegate - quickdialog

I'm trying to use QuickDialog (github.com/escoz/QuickDialog) to make a tablew view showing some debug info, like the values of constants etc. Most of the values are long URLs so i can't use a QLabelElement. QMultilineElement seems to be perfect for this but i need to know when the user modify the text of the pushed text view and i can't figure out how to do it.
QMultilineElement has a delegate property but i can't get it to get called. Looking in the code it seems to me that that delegate only works with QLabelElement, is it true? what am i missing?

I believe I ended up implementing this one, no? Can you confirm?

Related

Flexible column layout does not work when Two Way binding

My app has a flexible column layout with the list report displayed initially, and then switch to two columns when I click on an entry in the list report. This works fine so far with one way binding with backend model. But when I switch to two way binding then the click on entry does not show the second column. I am using the following code to switch the layout to two-column.
this.byId("flexibleColumnLayout").setLayout(sLayout);
Inside the setLayout() , I see some code that speaks about two-way binding. I am not an expert though to understand that level.
Anyone has fixed such an encounter? Appreciate your help. Thanks...
this.byId("flexibleColumnLayout").setLayout(sLayout);
This is resovled. The setLayout method is triggering some code where is going through some two way binding check and did try property binding checking against backend model, which is not correct. Instead binding the control to local json model did work. Thank you all!

Accessing Area.Name Throws Error

I'm just trying to find a way to access the name property of an Area element inside Revit Python Shell, tried looking on Jeremy Tammik's amazingly informative blog, tried AUGI, Revit API docs, been looking for 2 days now...
Tried accessing via a bunch of ways, FilteredElementsCollector(doc).OfCategory(BuiltInCategory.OST_Areas), tried by Area class, tried through AreaTag, every single time I get an error under every circumstance and it's driving me nuts, it seems like such a simple issue that I can't seem to grasp!
EDIT: Also tried by element id, through tags, through area schemes, nada, no go...
Can anyone please tell me how to access this property via RPS?
I would say two things:
areaObject.LookupParameter("Name")
areaObject.GetParameters("Name")
...are valid methods. Please notice how I used GetParameters() NOT GetParameter(). There are some drawbacks to using either one of the two. The lookup method will return FIRST parameter that matches the name which in many cases might be a different parameter for different elements. It's not very reliable.
GetParameters() method will return them all if there are multiple so then you have to deal with a List<Parameter> rather than a single object that you can extract your value from.
I would personally recommend to use areaObject.get_Parameter(BuiltInParameter.ROOM_NAME) method to extract a Name value from Area object. The BuiltInParameter always points at the same parameter, and will reliably return just that one parameter. Here's a little more details about these methods:
http://www.revitapidocs.com/2018/4400b9f8-3787-0947-5113-2522ff5e5de2.htm
To answer my own question, I actually never thought of looking through the code of other Revit Python scripts... in this case of PyRevit, which is in my opinion far more eloquently written than RPS, raelly looking forward for their console work to be done!
Basically, I had mistakenly used GetParameter('parameter') instead of LookupParameter('parameter').
As I said, it was something stupidly simple that I just didn't understand.
If anyone has sufficient knowledge to coherently clarify this, please do answer!
Many thanks!
Maybe your issue is the same as this one ? :
https://groups.google.com/forum/#!searchin/RevitPythonShell/name|sort:relevance/revitpythonshell/uaxB1FLXG80/sdJNrTfoPuUJ
Your_Area.Name # throws error
Element.Name.GetValue(Your_Area) # works great

Customizing a jdbcChannelMessageStore in Spring Integration

I'm relatively new with SI (I say "relatively" because I did some work with SI version 0.6 to 1, but I had to stop then and I'm now on it again in 4.2.5) and for now I'm writing some prototypes for POCs. In one of then I configured a channel backed by a jdbcChannelMessageStore which I wanted to customize in a simple way. To change the column MESSAGE_BYTES from bytea to text.
So I changed the schema-postgresql.sql to include that change and hope that I could only rewrite the jdbc statement for the INSERT. However, even if the statement itself is easily changeable, setting the parameters is not, since it is buried inside a lambda inside the jdbcTemplate.update itself inside the addMessageToGroup method. So the only solution would be to override the entire addMessageToGroup method, which seems not a good solution at all, since it contains more logic than the simple jdbc insert.
So what ended up doing was what I commented on my code as // very big hack. I overriden the DefaultLobHandler to actually not use the lob at all but a setString(...) instead.
So, I have a question and a suggestion:
Is there a way customize the JdbcChannelMessageStore to have our own schema structure and/or our own statements, without using things like this "big hack"?
If there is no better way, can I suggest to at least put the prepared statement fields setters on it's own protected (or public) method, instead of a lambda inside the jdbcUpdate?
Thanks in advance.
We should probably make it easier to override that logic, perhaps by delegating to an overridable method.
Contributions are always welcome :).

Why are parameters serialized on ShowViewModel<Type>?

Within Mvvmcross when you want to navigate to a different viewmodel you call
ShowViewModel<T>();
within a viewmodel that derives from MvxViewModel. All that is fine but I'm wondering why it serializes and deserializes when you do the likes of:
ShowViewModel<T>(new Person("firstname", "lastname"));
I'm fine that it does of course, and I can think of a few reasons why it does that but I'd like to have it spelled out here as it may also help others understand what's happening at a lower level within MvvmCross. Thanks in advance.
Because on Windows Phone and Android you can't just pass anything between Pages or Activities. On Windows Phone you have URL's that you can give a Page, which MvvmCross uses by adding your serialized parameters to it. On Android you have Intent's where you can put extra strings, bools etc. So it also serializes it and adds that as an extra thing in the intent.
Not sure how it works on iOS but that is basically the reason as to why. If you have a better way to do this, I suggest you make a pull request :)

How to get data from custom properties in UITestPropertyProvider

According to the code sample on MSDN (http://msdn.microsoft.com/en-us/library/hh552522.aspx) any custom property data that you need to get out of your control should be in a semicolon delimited string in the AccessibleObject's Description property. This does not seem right to me at all. This seems like just a quick and dirty trick to get it working. What is the correct way to get the value of properties from custom controls? And if this actually is how you're supposed to do it, then how are you supposed to set those properties using the SetPropertyValue method? The example in the link above just throws a NotImplementedException in SetPropertyValue.
Since the IAccessible interface has only a limited number of properties the best solution is to cram any extra information into the Description property (that's what they do at the company I work at, and our developers don't work quick and dirty :) ). To modify the return value of this property you have to implement the Iaccessible interface on your control. Or, since you only want to modify the Description property you only need to modify that property and leave the rest to the proxy (I'm not sure how this works exactly but there are tutorials for it on MSDN).
The SetPropertyValue method in the UITestPropertyProvider is for the UItestControls. By overwriting it you can modify the way CUIT interacts with the control during playback. For example, if you overwrite SetPropertyValue for the Text property you can change the way CUIT types strings into the control.

Resources