According to this SO post the special signal to catch the situation where the user types more characters into QLineEdit than the max length limit was added in 5.12.
However, is there a way to catch this situation in Qt 5.{0-11} and perform some action - namely inform the user about it?
Related
I'm testing a menu item for non-existence (which is relevant as I want to check whether a condition is correctly met which hides the item). Therefore, I call SWTBotRootMenu#contextMenu(String text) throws WidgetNotFoundException in org.junit.jupiter.api.Assertions.assertThrows.
However, having a number of these tests makes running the tests really slow, as the WidgetNotFoundException is thrown only after a 5s timeout it seems.
Is there a way to set the timeout to a shorter value? Or avoid the wait altogether in a different way?
If you just want to check menu for missing item you can get content SWTBotRootMenu#contextMenu() of whole menu and perform basic check if tested item is present or not.
SWTBotRootMenu context = menu.contextMenu();
assertFalse(context.menuItems().contains(text));
I want the user to notice that the report he's currently using is deprecated and replaced by another one. Therefore I'll need to have a popup like an info message on program start.
But when I try to run my code like this:
INITIALIZATION.
MESSAGE i355(zz).
The message only appears in the status bar.
This approach would look okay from user side:
INITIALIZATION.
DATA: w_mes TYPE string.
MESSAGE i355(zz) INTO w_mes.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
textline1 = w_mes.
But in fact it's very messy.
Is there a smoother way to display an info message on program start?
According to the behavior matrix of the MESSAGE statement in Dialog Processing, that is not possible. You might want to move the statement to a different section, e. g. START-OF-SELECTION.
You could use DISPLAY LIKE for a message that is originally of type E to achieve what you want but then the users will not be able to execute this deprecated version at all.
INITIALIZATION.
MESSAGE e184(sabapdocu) WITH 'Sorry, Batory!' DISPLAY LIKE 'I'.
Such a message will be displayed as a popup.
One can imagine that this is not allowed to preserve both the ability to call report programs using SUBMIT from all contexts(i.e. batch, rfc, update) and to allow external subroutine calls(PERFORM ABC IN PROGRAM XYZ).
In instances where this sort of thing is required, perhaps it is best to configure a transaction code(using SE93) to call the program in some way such that the message is displayed.
Here's a quick example using a local class:
CLASS lcl_selcr_mess DEFINITION.
PUBLIC SECTION.
METHODS
start. "#EC CALLED
ENDCLASS.
CLASS lcl_selcr_mess IMPLEMENTATION.
METHOD start.
MESSAGE i001(00) WITH 'Deprecated...' DISPLAY LIKE 'I'.
CALL SELECTION-SCREEN 1000.
ENDMETHOD.
ENDCLASS.
If you feel this approach is obtrusive, I suspect this can also be done by creating a "dummy" screen which only displays the message, then passes flow to the selection screen. Create a dialog transaction to call the dummy screen.
I have a form that is supposed to create an entity of type Load, but for some reason, doesn't seem to be actually passing or seeing any of the data related to associations of the entity (load.user, load.client, etc). This all used to work fine but stopped working at some point during a bunch of refactoring (that didn't change any of the fields in any of the models). Now all of the forms in my website have broken the same way and I have no clue where to even look to start fixing it.
From the view, I submit the form for a new Load, printing out the data everywhere I can along the way. Printing out the data being sent to the server before it's sent shows all the data is there like it should be. Printing out Form.form(Load.class).bindFromRequest() in the controller shows the form's data contains everything needed, for example, the value user.id=1 is in the data. However, there is also a validation error saying that the user is missing. How can this be?
Form(of=class models.Load, data={ a bunch of stuff, user.id=1, a bunch more stuff}, value=None, errors={=[ValidationError(,Logged in user is missing or invalid.,[])]})
The validation error is being generated by public String validate() in the Load class, which is simply checking if(user==null) and returning that string if it is. I should note that every form that submits multiple entities (for example, submitting a Dock and then also the Dock's Location) only saves the main entity (in this example, the Dock) and ignores all others (the Dock's Location is never saved, even though Dock cascades in the model to also save the Location). All of our form fields are labelled correctly, this code did used to work at some point before it mysteriously stopped working!
So why did all of my forms suddenly stop correctly dealing with anything but the main model for the form? It is as if they cannot even "see" the data contained in bindFromRequest(). If I print out a variable in the validation method of Load, such as this.status, it prints the correct thing. But if I try to print something like this.user.id or this.client.id I get a null pointer error. Where is the code in Play that actually interprets the data (user.id=1) and turns it into the User associated with the Load, and how could it be breaking?
Edit: Also, yes, I did try "play clean", it was the first thing I tried since usually it fixes weird errors like these! But this time, no dice.
Edit2: I'm including the html from the form, in case it is helpful.
<input type="text" id="user_id" name="user.id" value="1" class="idfield">
Edit3: The only change I made during the refactoring that might have influenced this is that I had to make some setter methods like Load.setBroker() because the ones that are supposedly generated by Play didn't work. For example, load.broker=aBroker would not have set the Load's Broker before, so I had to make a public void setBroker(Broker broker) method in Load. Does Play use the auto-generated setters to bind the data? Could overwriting them cause problems?
Whoops, I figured it out. It was the setters I had written. Some of them were set to private purely by mistake, and apparently this was preventing Play from setting the values when binding the data. Changed them all to public and the mystery error vanished.
So I have been pulling my hair out all day at this, and I am out of patience.
Basically I have a pygtk program that is built from glade. At the bottom of the main window, there is a status bar that I use to display usage errors, and status messages about the connected hardware and they use the functions below. So all of the calls to displayError come from within my object based on user interaction, and they all seem to work. In testing I tried making calls to displayCurrent and it works as well. The problem comes when the hardware process tries to use displayCurrent. The way the system works is that one of the members of my main window class is an interface object to the hardware. This has a separate process, using multiprocessing.Process, which sends a signal every time it gets data with the data being the message to output. Does anyone have any ideas? I'll be happy to explain anything in more depth if needed, it's just a LOT of code to post to get all the details.
def displayCurrent(self, message):
print message
if self.lastMess:
self.statusBar.remove(self.normalID, self.lastMess)
self.lastMess = self.statusBar.push(self.normalID, message)
def displayError(self, message, timeout = 5):
"""
Function that takes an error message and raises it to the user via the statusbar
timeout seconds later.
"""
print message
mess = self.statusBar.push(self.urgentID, message)
# clear statusbar
gobject.timeout_add_seconds(timeout, self.clearStatus, self.urgentID, mess)
def clearStatus(self, cID, mID):
#time.sleep(timeout)
self.statusBar.remove(cID, mID)
#print self.statusBar.remove_all(self.urgentID)
print 'popped'
return False
Post the whole code.
In general, this won't work if you are in a separate process. GTK (and everything else) has been forked. You need to use some form of interprocess communication. Multiprocessing module handles it for you. There are also hacks you can do in GTK such as using a window title (like Vim) or perhaps a plug and socket to communicate; don't be tempted by these.
I have a question about the BPMN notation. Does anybody know if interrupting/non-interrumpting events can be for throwing and catching. The specification (v2.0) doesn't define this explicitly (or maybe I missed it) but it seems it only defines the icon for catching the event.
Maybe I am misunderstanding the use that events attached to the border of an activity have.
If I had to take a guess I would say that it is only catching since events attached to the border of an activity are catching things that happen inside subprocesses or activities. Things that happen outside the scope of the activity or subprocess do not influence what can happen inside it.
Thanks for your help.
interrupting (int) /non-interrumpting (n-int) are only catching events. they can be used in sub-processes and as boundary events.
the diffrence between int and n-int as a boundary event is:
- [int] when fired the action is blocked
- [n-int] the event is fired but the action still goes on.
here you can see a simple doc with all the grammar. if you look on the right side you can see that no trowing can be (n-int).
if you think about that, trowing event does not have to wait for do their action, so n-int or int does not make any sense.