Design tips on writing on translator like application using Qt?
-
Hi,
I'm trying to write an application that looks almost similar to Google Translator.
I'm a bit new to Qt and not sure how to approach the solution -- whether to use Model/View or not.My application is simple,
- In a new Qt window, gives/load a directory. Reading this database means calling another API.
- User has two options to translate on the window: from A to B or B to A.
There will be a pushbutton and some text boxes to enter. To display the result, I want to use a single row table. - Note: I won't be having a pre-compiled database after loading a directory.
- Searching the directory happens on the fly -- like taking the input (A or B) can calling other API (which I don't own). I just display what the API returns.
- This is not performance optimal. So, I'm planning to implement a hashMap within Qt code, to store all the searches. A repeated search will be faster. Once the window is closed, I'll clear map.
Any design ideas?
I'm especially confused if I should use Model/View design pattern here? -
Hi and welcome to devnet,
I don't see any use of model in what you suggest here.
You basically call an API on press of a button, so I do not see the need of model view. You might want to consider doing some caching to avoid spamming the API with request already done though.