Create a matrix from a .csv file
-
@mrjj thanks also for comments, so i can better follow the flow. but sorry i have to include QPainter somewhere? yes solved!
@AliM93
Yep, need includes.I hope comments are enough to understand it.
its just calculating how big each box should when we have max_x and max_y and some area ( the widgets area)Shall we try to add it and UI and see something?
I want to show you a Creator feature called Promotion that makes it easy to use such custom control.(note i bumped your upvotes so you should be able to post faster now)
-
@AliM93
Yep, need includes.I hope comments are enough to understand it.
its just calculating how big each box should when we have max_x and max_y and some area ( the widgets area)Shall we try to add it and UI and see something?
I want to show you a Creator feature called Promotion that makes it easy to use such custom control.(note i bumped your upvotes so you should be able to post faster now)
-
@mrjj sure! the only thing is, as you can image from my images, i'm working into a bigger file, and when i run the app i have also a main_window.ui. so i have to link all the things to that. is it possilbe, isn'it it?
@AliM93
yes, i though we add it to your main ui to see its working ?Its same project still, correct ?
-
@AliM93
yes, i though we add it to your main ui to see its working ?Its same project still, correct ?
-
Yes you can add to a dialog the same way as to any other UI :)
To use your custom widget.
Go to your main window ui file and open it
place a normal Qwidget on the form
RIGHt click it
and choose promote toThen in the new window , fillin the class name
nake SURE to spell it as shown in file!
MatrixWidget for "class name"
Case matters!now press ADD
then Press Promote.When you run the app, our custom widget will be shown instead of the plain one we added.
-
wrote on 31 May 2020, 00:51 last edited by
my main_window is still polupated
-
wrote on 31 May 2020, 00:52 last edited by AliM93This post is deleted!
-
add to the dialog then :)
Its 100% the same way.
Dont matter which UI.So lets just use the dialog.
-
wrote on 31 May 2020, 00:54 last edited by AliM93
ok, so what i have to do? Add a normal QWidget to may main_window
-
open UI file for dialog and promote it as shown.
This Creator feature will then allow us to use our new custom widget without adding it from code. -
@AliM93 said in Create a matrix from a .csv file:
Add a normal QWidget to may main_window
No, not if you want to use the dialog.
-
wrote on 31 May 2020, 00:56 last edited by
yes but which dialog i have to open? i don't have in this file.. can i add?
-
@AliM93
Ohh, you dont have dialog yet ?
Lets add new blank one.
Sec. shots. -
-
Again, select the File New as when we made the widget.
Choose Designer Form class
Then choose a dialog
Give it a good name
Press NExt, NExt
Now you have this and you add a QWidget to it and promote it.
-
@AliM93
yes in left side Widget.
-
wrote on 31 May 2020, 01:08 last edited byThis post is deleted!
-
58/140