-
Notifications
You must be signed in to change notification settings - Fork 418
job tab: ui improvement #19
base: master
Are you sure you want to change the base?
Conversation
Could you explain why this looks to you? Previously number fields (counts/bandwidth/time) where nicely aligned to left and stayed there regardless of window size. Now everything is resizing and moving around. If you have nice big monitor and if you maximize window, those three groups of fields will be very apart each from another. I don't see this as improvement. I see you put & shortcuts for some fields. But it seems you skipped Bandwidth and Errors? I actually really like Qt ui files. They allow me to see widget layout without launching application. Previously I worked with company where we made all the GUI with ui files and there were no issues of collaboration and changing it. If your concern is about looking at diff of xml file, then having controls created in C++ code will not be much better. Here's how diff for ui generated header looks like with your change: https://gist.github.com/mmozeiko/93637939b7ab0acdba410e788e018d86 Sure, the first part with field definitions really should not change, but most of the other stuff is mostly valid changes. And for bigger changes the pure C++ diffs (without uic) will anyway be messy - different developers like to structure code differently. Some will create controls at one place and set their properties in different. Some will create control and immediately will set all properties (like uic generated code does). |
Try to increase width of the job window in your implementation. You will see fields: Size, Transferred, bandwidth, Errors, Elapsed, Checks as groped to left side with space at left. In my case it is uniform aligned. I changed your grid layout for the job form to vbox with separate grouping of elements per each line. Regarding & shortcuts, probably it is automatically added by qt designer. I didn't change it manually.
I worked with Qt many years. Mostly with qt3 and a bit with qt4. Not sure that it changed so big in qt5. It is really much clear to work with pure code especially when you have something complex like tables with custom behavior. And you can combine different approaches for different forms. For your example of cpp code:
I have an issue. Not all variables for objects are declared in h-file. There is a simple principle. If you don't want to use an object outside a constructor you doesn't declare variables at h-file. That is most code is concentrated in same place. For qt5 actually consider usage of QML. But in general do it as you wish.
You can specify coding style if you want to organize a process of collaborative development. And next just control it. As you decided to implement GUI for very popular tool you can head the process of further development. Or do it self as you wish. |
Not sure if I understand what is aligned. This is what I see: http://imgur.com/a/9tSTA
This is easy to change. Because these header files are "private" to UI object and never meant to be used elsewhere, then simply #include "ui_job_widget.h" to job_widget.cpp and forward declare Ui::JobWidget class in job_widget.h file, so it member in JobWidget class can be a pointer. I didn't do that, because it is extra typing work. And for this kind of project structuring C++ classes "properly" doesn't matter much. IMHO that matters much more for libraries, not for UI code that is never meant to be reusable.
I actually dislike QML for desktop apps. It requires writing code in different language than C/C++ which is not nice in my opinion. And it will increase app total size, because of more extra dll or other files. This thing about putting wrappers over wrappers never stops... After QML somebody will request to rewrite everything in JS with Electron (or similar). |
I don't like discuss UI because of it is really very subjective. But if you want to discuss more about qt development, coding style, c, c++ programming just email me privately.
It is not nice due to looks very asymmetric. I guess even a central position of the block with all elements looks better because of symmetry. Actually in my case it looks symmetric in any case. You are right it looks not good in case of full screen. But if you extend the job window not so wide it looks good because of strictly aligned both left and right. At the same time if you aligning each line separately instead of common grid for a form you have more flexibility. Good luck! |
Hi, good start!
I changed layouts on the job tab to make it some more readable.
And small recommendation. If you want to continue development and save controllable the process of collaborative development, don't use UI compiler. It is really only for prototyping. In other case each time when somebody changed UI, you will see something like in my patch. That is totally changed instead of several lines of code only. Moreover direct changing of cpp code is more flexible and clear for understanding. If you want to do it, just copy and decorate code from generated ui_something_.h files to your main cpp files.