I have screen 1 on which there is a SUBMIT button. On click of the submit button I want to load another screen 2. the UI of screen 2 is developed using only Qt C++. there is no QML document related to that.
On the click of the submit button I have called a function void DoSubmit(). In this function I have made a page object.
Page * PageObj = new Page();
In this PageObj I have added containers and other controls and constructed my UI for scene 2, now I try to set this page as my current scene using the following command:
Application :: instance()->setScene( PageObj );
by doing so my app getting crashed but when I remove the statement containing Application :: instance()->setScene( PageObj ) it does not crash.
What is the problem in this I am not able to figure out. Please help..
The scene should not be used for adding a page, just the first one. You would better use a navigationPane or a sheet.
See the doc:
https://developer.blackberry.com/cascades/documentation/ui/navigation/index.html
Related
Issue is related to not getting back the focus to the progress application after closing the dialog screen using .cls programs and last accessed application is sitting on top. As I have tried all the option like , getting the frame handle, processid of application and browser handle for make the progress app on top after closing the child window.
I have tried the below methods for this issue:
Senerio 1
Used handle of the selected program and apply entry to window.
Steps used to achive this senerio as follows:
1.) Define CheckMainFrame as PUBLIC STATIC PROPERTY for get and set in TabFolder.cls.
2.) Setting the program handle in oplauncher.p after calling the selected program .
FolderForm:CheckMainFrame = hLaunchProc.
3.) Getting the handle in method CheckWindowClose after closing the dialog and apply entry to window container.
Senerio 2
Used handle of the viewer and apply entry to browser.
Steps used to achive this senerio as follows:
1.) Define CheckBrowser as PUBLIC STATIC PROPERTY for get and set in TabFolder.cls.
2.) Setting the browser handle in CreateRenderedBrowsers where its looping throught the folder pages and when its find
the browser and getting the bowser handle.
TabFolderForm:CheckBrowser = hColumn.
3.) Getting the browser handle in method CheckWindowClose after closing the dialog and apply entry to browser.
Senerio 3
Used viewer widget handle and applying entry to first field, cursor is getting the focus.
Steps used to achive this senerio as follows:
1.) Define CheckViewer as PUBLIC STATIC PROPERTY for get and set in TabFolder.cls.
2.) Setting the viewer handle in CreateRenderedBrowsers where its looping through the folder pages for viewer
widgets and when its find viewer and getting the first widget handle of viewer and setting the handle to
public property of viewer.
TabFolderForm:CheckViewer = hViewerWidget.
3.) Getting the Viewer handle in method CheckWindowClose after closing the dialog and apply entry to Viewer.
Senerio 4
Used process id of the application and apply back focus to the application.
Steps used to achive this senerio as follows:
1.) Defined a method GetCurrentProcessId in Win32.cls program to ge the process id of application .
2.) Windows.API.Win32:GetCurrentProcessId(OUTPUT ProcessId).
Getting the processid in method CheckWindowClose after closing the dialog and called the method
THIS-OBJECT:MouseClick(ProcessId).
Forcing Mouse click events as some example below:
Windows.API.Win32:PostMessage(hWidget,
Windows.API.WinUser:WM_SETFOCUS,
0,
0) .
Windows.API.Win32:PostMessage(hWidget,
Windows.API.WinUser:WM_SETCURSOR,
0,
0) .
Windows.API.Win32:PostMessage(hWidget,
.Windows.API.WinUser:WM_MDIRESTORE,
0,
0) .
Can anyone suggest me on this?
I use Qt 5.5.0 and Qt Creator 3.4.2 on Mac-book, I want to open second qml on button click, I want to develop application in which login page come and after login control move to next page.
I try suggestion of stackoverflow, but still I face problem to open next qml on button click.
I tried
button2.onClicked:{
var component = Qt.createComponent("test.qml")
var window = component.createObject(root)
window.show()
}
How can I create a new window from within QML?
In upper case error come related to root, ReferenceError: root is not defined. I gave root id in test.qml file.
I also tried many more example to solve to develop functionality. Please give brief idea or code to develop this functionality.
The code below works, Take note of the property status and the function errorString() – they will give you information in debugging (.e.g. "file not found" errors, components not ready, etc).
See these pages for background:
Dynamic QML Object Creation from JavaScript
Component QML Type
Window QML Type
function createWindows() {
var component = Qt.createComponent("Child.qml");
console.log("Component Status:", component.status, component.errorString());
var window = component.createObject(root, {"x": 100, "y": 300});
window.show();
}
For this type of ui I'd use [StackView][1] component that allows also animations between transitions. Other solution is to use a Loader component.
I am trying to figure out how to open a pop up window in my Air application, in a secondary Window, instead of the main application window.
I am using the ReusableFX components, which include a custom DataGrid with filtering and other capabilities. The filtering feature displays a pop up window via PopUpManager when you click on the top of a column in the grid.
PopUpManager.addPopUp(this, FlexGlobals.topLevelApplication as DisplayObject);
The problem is that the pop up window opens in the main application - I am assuming because of the 'topLevelApplication' reference.
So, I need a way to open this window in the current Air "s:Window".
I am assuming I need a way to walk up : this.parent.parent or this.owner.owner - though I have tried that and it did not seem to work (it said null reference).
OR, is there a way to get the current top most window / component (NOT the main application / window)?
Update:
I decided to create a new project for the component, and add in the Air libraries. Now I am able to access the "NativeApplication.nativeApplication.activeWindow" call. That gives me the correct Air window. However, it does not seem to be working:
PopUpManager.addPopUp(this, NativeApplication.nativeApplication.activeWindow as DisplayObject);
My popup does not appear. I am assuming because "activeWindow" is not actually a DisplayObject? (so how do I get the DisplayObject if that's the case?)
Update:
Could it be that I am a victim of this adobe bug? (found here originally)
Well, I came up with some changes that seem to work, though there is probably a much cleaner way to do this - I was just not able to figure a way to get a reference to the current air application window except this way (this is using the ReuableFX custom flex component by the way):
First, in my custom DataGridColumn component, I added a public property
public var pApp:Object;
Next, I modified the DropDownFilterHeaderRenderer (extends HBox , implements IListItemRenderer), showFilterDropDown method and right before it calls dropDown.startEdit(column); , added:
column.pApp = parentApplication;
Finally, I modified DropDownFilterEditor (which extends FilterEditorBase), the method startEdit(column:MDataGridColumn) (the previous PopUpManager was calling FlexGlobals.topLevelApplication, which is not the correct window when opening a s:Window in an Air native application:
var editorInstance:Object = _editor.parent;
var columnInstance:Object = editorInstance.column;
var parAppInstance:Object = columnInstance.pApp;
PopUpManager.addPopUp(this, parAppInstance as DisplayObject);
I have a three pages form in which I need to collect data.
While transferring from one page to another I would like to display ajax window which will say, for example, "saving your data", and while that is shown on the screen I would like to run a code in the background?
Try this way.
While saving data call the ajax model popup on the click event and initialize the thread in the init event of popup window and once the work is done, close the popup window.
Model Popup will also disable the other control on the page using background css.
public void SimpleWork()
{
//Do something
}
Now you use either this method
ThreadStart operation = new ThreadStart(SimpleWork);
Thread theThread = new Thread(Operation);
theThread.Start();
or
ThreadPool.QueueUserWorkItem(delegate{SimpleWork();});
If you find it useful, Mark it as your answer else let me know..
I would like to add custom right clicks to a number of spark list controls.
I have tried the following as an item renderer. (as per the flex 4 cook book).
Full Render code here http://pastebin.com/Kx8tJ1cY
When I right click on the Spark List I simply get the Adobe Default Context menu.
This is the same default behaviour I had before I added any code to this.
Could anyone tell me how to add right clicks to List Items in Flex 4.
Please and Thank you.
I found the problem/solution. You cant use context menus if there are Vboxes or Tab Navigators. Which is insane because it means I cant do relative layout properly or decent variable width design.
Quoted from: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html
For example, if a DataGrid control is a child of a TabNavigator or VBox container, the DataGrid control cannot have its own context menu.
Christopher Huyler posted something similar (source code available here). From the article:
Start out by grabbing the Javascript code from Google's code repository.
Step 1 – Setup custom context menu code
Create a new Flex project in Flex Builder. Copy rightclick.js and swfobject.js into the html-template folder of your project. From here, I had to make several changes…
I modified the RightClick.init() function to accept an object and container value as input. This allows me to pass in the name of the application as the object instead of having it be called the same thing every time.
I included rightclick.js and swfobject.js in the header of index.template.html.
I added a new div to the body called “flashcontent”.
I added an onload handler to the body tag to initialize RightClick
I replaced AC_FL_RunContent(…) with new SWFObject(…) making sure to maintain all template variables.
After making these changes, I verified that no right-click context menu appears in my application.
Step 2 – Listen for the rightClick event
Next I added a few lines to the main mxml file of my application to listen for the ExternalInterface event that will be dispatched when I right-click my appliction.
private function handleCreationComplete():void
{
ExternalInterface.addCallback("rightClick", handleRightClick);
}
private function handleRightClick():void
{
Alert.show("Right Click Success!");
}
Step 3 – Dispatch an event to the correct object
Getting the event to the main application is easy, but we actually want the appropriate child object to be notified when the right-click event occurs. Since I am not using any double-click events in my application I decided I would treat every right-click event like a double-click event. Users without a two button mouse (aka Mac users) can simply double-click to get the same menu while users with a two button mouse just have to right-click. Here is how I make sure the event is dispatched to the appropriate object.
private function handleRightClick():void
{
var objects:Array = systemManager.getObjectsUnderPoint(
new Point(mouseX,mouseY));
if (objects.length>0)
{
var object:Object = objects[objects.length-1];
var relatedObject:InteractiveObject;
if (object is InteractiveObject)
relatedObject = object as InteractiveObject;
else if (object.parent && object.parent is InteractiveObject)
relatedObject = object.parent;
var event:MouseEvent = new MouseEvent(
MouseEvent.DOUBLE_CLICK,true,false,mouseX,mouseY,
relatedObject);
object.dispatchEvent(event);
}
}
I hope this helps!