This question already has an answer here:
Showing and hiding multiple windows in PyQt5
(1 answer)
Closed 2 years ago.
I'm trying to create a simple app which consist of two windows. The first one is a Login Page and the second is a Registration page. The dynamics are as follows:
The first window is the Login window with two buttons; Login Button and Register Button.
If the login button is clicked, it starts a session if the credentials are correct.
Clicking the second button should close this window and open a new registration window.
The registration window has two buttons as well, the first simply confirm the registration, the second is to cancel the registration.
This cancel button is supposed to close the current window and open the Login window.
Steps 1 through 4 work perfectly, but in step 5 it keeps does not close the current window and simply opens a new Login windows.
Please write a basic code as an example of how to close the window using PyQT5. I don't want you to write all code but just a generic one. I just want to have an idea how it works and use it in my own code.
One way to approach this problem will be to implement a separate controller class. This class will control all the windows you want to show or hide.
This link will take you to a similar question which has the code you want.
GitHub link to code
Source: stackoverflow
Related
I am looking to save all of the info and restore on button click for my application using QSettings. I used code from How to save selected Items to Qsettings from QListWidget, QTableWidget
The code from the accepted answer is edited to work for QLineEdit/QComboBox/QRadioButton/QCheckBox/QListView/QTableView
My application is being saved on exit, and restored when clicking main windows toolbar button.
My issue is that code works perfectly if the tabs are static, however when adding dynamic tabs it creates the following issues;
On startup it has only one main tab, so it needs to create the
number of tabs as it had when it saved the settings - possibly just
get the count of tabs and in the restore method, programatically add
number of tabs
If you add the same number of tabs as it had when you exited, it
copies the widgets info from the active tab when it was exited
My issue with #1 is that I do not know how I can call my addNewTab() method to programatically add the tab after I get the tab count from QSetting file.
My general question is, how can I implement the desired QSettings code to work for dynamically created tabs?
Working Example:
https://github.com/David52920/QSettings.git
Test_MDI.py is the main file
my original question posted
Simulate Double Click Event in IE EXCEL , VBA interaction
.
You said,
this is a deadlocks for me because 1) i trigger the prompt from excel
to retrieve data from server 2) the server is stop responding until
prompt is being dismissed 3) all codes coded to handle prompt not
being processed because excel still waiting for the #1 to complete
I made a tests with some suggestions in older threads, but nothing worked.
References of those older threads.
(1) Disable Alert message of a webpage using VBA code (Refer the second answer)
(2) vba to dismiss an IE8 or IE9 "message from webpage" popup window
The thing is that, VBA code execution get stops when IE display the Alert() message. As code execution is already stopped we are not able to handle the Alert() prompt using code. So user need to close the Alert() prompt manually which resumes the code execution.
For simplicity in testing, if you just try to create an IE object and display the prompt and put some other lines of code after the prompt than you will notice that execution of code get stopped when prompt get displayed and until you close the prompt manually further lines of code will not get execute.
I agree with the suggestion given by the Zhi Lv - MSFT in your referenced thread for using the Selenium Web driver.
It can be the easiest solution for this issue.
References:
(1) Selenium Web Driver
(2) Selenium handle alerts prompts confirmation popups
my extension close when link in the extension is clicked
How to keep extension pop up to remain open when new tab is clicked
In general, that's not possible as stated in Chrome Extensions FAQ:
Can extensions keep popups open after the user clicks away from them?
No, popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away.
However, if you inspect the popup, it will stay open as long as you don't close the Developer Tools window.
For end users, the only thing you could do is use a tab instead of a popup if that works better for your use case, or just inject your code into a specific tab to show your interface on top of/next to a page, as some extensions like Siteimprove do.
We have an application in Clarion 6 which does not have any mdi windows in it anywhere. These have all been removed and made non-mdi. When this one window is open and other windows are opened off of it (say from a button click), the first window will 'pop out' in front of the other windows when the items are refreshed based on a timer.
How can this be stopped? We do not want this window to get the focus and cover other windows automatically this way. However, the display data does need to refresh every so often.
I am new to Android/Java and am trying to learn in order to create an app. I have done a lot of programming in Microsoft Access Visual Basic, but this is the first that I am doing in Java.
My (very basic) question is how to open a new screen from another?
All of the examples that I have found online either did not work when I tried them or crashed when I tried to customize them to open my own screen.
Also, all of the examples have so much extraneous stuff in them that I cannot figure out which parts are essential to just opening the next screen and what parts are doing other things.
In VB, to open one screen from another (using a button), you create a screen (form) and then add the following code to the onclick event of the button docmd.openform("form1"). It is that simple.
What is the Android/Java version of this command?
What I am looking for is a barebones piece of code that opens another screen when a button is clicked on the first screen. The second screen would have nothing on it except a text field that says "this is the second screen." No buttons, returns, etc.
I know how to create the screens as layout.xml files. I just can't figure out how to display that second (or subsequent) screen.
You can launch a new activity from your current activity through an intent like this:
startActivity( new Intent(this, YourActivity.class) );