wmcnicho / QCP_SP2015

A quantum computing emulator made by undergraduates at University of Edinburgh
0 stars 0 forks source link

Updating the Gui from your code #8

Open wmcnicho opened 9 years ago

wmcnicho commented 9 years ago

Hey all. In order to mediate the communication between the Gui and the model code I've implemented a very basic M-V-VM design. In essence QViewModel is a class with static methods that you can call from anywhere to request an update to be made to the view.

If you want to see the full list of changes you can make you can check out QViewModel.java. Note that not all of the methods are implemented yet. Also if you want to request something that you would like to change feel free to post about it below.

Here's an example of how to print to the console.

QViewModel.printToConsole("The probability of state " + (i+1) + " is: " + prob);

If you want to read more about M-V-VM you can check it out here. It's particularly important for large application development.

http://en.wikipedia.org/wiki/Model_View_ViewModel