Opening projects and getting started
-
@AnneRanch AnneRanch Suggested using a simple terminal example. I am moving towards the point of thinking that despite my opinion, presumption?, there is no method to utilize drag and drop to create multiple dialogs. If that turns out to be the case I will be rather disappointed in Qt.
I am also confident that I am using Qt Creator 12.0.2 and Qt 6.6.0, that no one else in this conversation is using this version, and this creates a problem. Here are some dialog screen captures and maybe it will lead someone to help me find the right path forward.When creating a project, the above is the first screen. The option of the top left of the left panel, then the top item of the center panel seem to be a clear best choice. From here through to the initial project creation I see no option that I perceive as having a bearing on my core question. So I complete the project creation naming it three_dialog_05, the fifth time I have tried this. After the project has been created, the most appropriate screen capture is below.
This is before writing any of my code. This is where I expect/hope to find the ability to add a new dialog. Note file mainwindow.ui. When opened, the user has the ability to drag and drop controls onto the dialog. My first goal is to find a way to get Qt Creator to create a file named, for example, quadratic.ui. When that file is opened by Qt Creator, it will provide the ability to drag and drop controls onto the new dialog.
With the express purpose of keeping this simple: Is there a way to do this in Qt Creator 12.0.2, or in any version of Qt Creator?
I am torn between: A) writing another post taking one of the paths suggested by other replies and B) stopping here to limit the thread to a single question and if the question is NO, then working one of the other paths.
I am going with simplicity, stopping here, and waiting for, essentially, a Yes or No answer.
To each of you, thank you again for your time and patience. -
@Bryan-Kelly said in Opening projects and getting started:
This is where I expect/hope to find the ability to add a new dialog.
It was actually already explained here.
But I will repeat: go to File/New File or Project..., select Qt on the left side, then select Qt Designer Form, in next step you can select a Dialog as template. Don't know how else to explain this. Maybe you should follow the suggestions? -
@jsulm
As you know, I have already said exactly this (as have others), and quoted exactly where in OP's steps they went wrong and what they should have done. To which OP's reply to me wasThe question has not been answered. I wrote down the steps one line at a time, posted, and that post was essentially ignored.
So quoting from their post counts as ignoring them. Even shown a picture of exactly what it looks like, what the OP has erroneously picked and what they should actually pick. All they have to do is follow exactly their steps where they picked "new C++ class" and change it to "new Qt Designer Form" which is what they want. So it's not clear what we can say any more that the OP will try, instead of keep saying that Creator/Designer does not allow them to design with drag & drop onto a form.
-
@jsulm said in Opening projects and getting started:
@Bryan-Kelly said in Opening projects and getting started:
This is where I expect/hope to find the ability to add a new dialog.
It was actually already explained here.
But I will repeat: go to File/New File or Project..., select Qt on the left side, then select Qt Designer Form, in next step you can select a Dialog as template. Don't know how else to explain this. Maybe you should follow the suggestions?Yes, that worked out well. I have no excuse for not recognizing the right method much earlier in this conversation.
So again, to each respondent, thank you for your time and patience. -
@Bryan-Kelly here is no method to utilize drag and drop to create multiple dialogs.
Excuse my English - but - are you in effect saying DRAG AND DROP TO CREATE / DUPLICATE DIALOG PROJECT?
I am not nitpicking on your statement,
but
there is a difference between that and "drag and drop" objects in SAME dialog.Actually even (opening) projects - plural - is little misleading.
-
@Bryan-Kelly as you are starting with Qt, i would advise you to use qt books.Inside you can better learn qt features.Some are:
9781786467126-MASTERING_QT_5
[Trolltech]Qt4 Examples And Tutorials
c-gui-programming-with-qt-4-2ndedition
AdvancedProgramming wit Qt
Hands-On-GUI-Programming-with-CPP-and-Qt5
Foundations of Qt Development
Qt5 cadaques.Some may be old , but you will learn a lot from them.
-
@AnneRanch The intent was something on the order of: Begin with a just created project, use the defaults. Open mainwindow.ui. This opens a tool dialog of controls to drop on the dialog. Somewhere in that tool dialog is, or more correctly, I suggest there be, a tool called "dialog" Drag and drop this somewhere, maybe outside the currently existing dialog to create a new dialog. Go from there.
Yes, that presents some problems, but, that is the basic concept I was searching for. The provided answer was good and does the job.
I slightly modify the earlier given instructions to:
File -> New File -> Qt Designer Form Class (rather than Qt Designer Form)
This provides not just a dialog but a dialog with an associated class for the stuff to be done within the dialog.@Ronel_qtmaster Thanks for the list of books. I am working on selecting and ordering one. I will probably go Amazon to get a Kindle version, but, will look and try to find a PDF of one rather than Kindle. Kindle is OK but has some drawbacks, the biggest of which is Kindle does not have smooth scrolling. It only moves a complete page at a time which is often quite inconvenient.
-
@Ronel_qtmaster I purchased the Kindle version of Mastering Qt 5. The first goal is a series of Line Edit controls to entering and displaying numbers. A search for qlineedit in the book yields 7 results. All of them are example within lines of code. None of them are explanations on using the tool, QLineEdit.
Searches for text such as
how to use qlineedit for numbers c++
returns some examples, but no discussions on how to use it. To state in other words, a page, or several on the topic of QLineEdit and various ways to use it. Of course, the same is hoped for regarding other tools.An example: I can right click on a line edit tool then click "go to slot" This generates a function names on_le_step_a_returnPressed(). The actual function appears to be returnPressed(). How can I determine or discover all the available functions without having to create and test each one?
Using QLineEdit as an example, are there any web sites or books that list various tools such as this and how to use them?
-
@Bryan-Kelly
I am afraid your questions/requests are just too specific. The books are what they are, and they cover what they cover. I don't think you will find anything which goes into detail on e.g. every widget type, but good luck if you find what you are looking for.That apart, for the case of "how to use qlineedit for numbers" the answer is: don't! Use a dedicated
QSpinBox
for integers andQDoubleSpinBox
for floating point ones. -
@JonB said in Opening projects and getting started:
@Bryan-Kelly
I am afraid your questions/requests are just too specificSeems to me, noted specificity is a major reason forums such as this exist. Sometimes people just cannot find the exact syntax for what is needed, even when the general concept is known.
I now know how to create those dialogs and it is simple and logical.
Thanks for your time and patience.
-
-
@Bryan-Kelly Can I ask why there is not any tutorial online about the relationship between source files and UI files and how to work with them? It seems that it is a particularly critical skill and IMHO it's explained only in bits and pieces online and not well.
-
@Mlibu said in Opening projects and getting started:
Can I ask why there is not any tutorial online about the relationship between source files and UI files
-
@Christian-Ehrlicher Ok it is explained much better in the Qt Widget documentation I guess. I was looking at QML/Qt Design Studio documentation when I had the issue. Thanks for pointing that out. I didn't even know UI files were a thing in Qt Designer. I'll look at the Qt Designer docs too. This probably explains why I was having trouble finding any info. I guess I should be watching Qt Designer tutorials as well.