ok, so my problem is basically the same as in this post:
How to make Window full screen in VisualStudio SkeletonBasics-D2D 2013
However i am not allowed to comment as my account is too new here. I tried asking in a Answer, which, although i apologized for doing so, instantly deleted.
As i have no other means of getting into contact with the answerer of that post, i now try to ask this question aswell.
What exactly do i have to do to achieve the conversion of the Dialogproc into a Window, as described in the other question?
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I started making GUI Apps with Qt 5.7 around 2 weeks ago.
Until today I have made a BlackJack game, a basic mini encryption program and 1-2 more programs. Now, I could find any help on how to make an application that actually acts like a Setup Wizard- by that I mean, for example by clicking on next, a label or any elements are gone and new one appera like a progress bar and below the contents that are copied. How is that actually done?
Is it something like on_pushButton_clicked() and afterwards the usless elements are hidden like ui->pushButton->hide(); and others show up, or is it literally made by practically "rebuilding" the window with other elements and functionalities?
Edit: Mike's comment revealing the existence of QWizard and QWizardPage makes my answer quite redundant, unless you have requirements exceeding the abilities of those widgets - or simply want to implement everything yourself - which the OP has replied that they do want to try. For everyone else, you might only need to read on if you need - or want! - to do all the heavy lifting.
One way to do that is, as you pondered, to destroy the old contents (child widgets) of the window after each page, then repopulate it for the next.
But that's far from ideal IMO: it's wasteful, and it would require you to repeatedly destroy/rebuild things, with all the jumping around that entails, to support Back/Next/Jump to Page # buttons and all routes between different pages. That's more programming and more use of resources to keep unnecessarily tearing down and rebuilding stuff.
Your other idea about hiding is better, and I know exactly the container for this job! With this, you can build everything in advance and won't need to repeatedly remove/add children to change pages (as you would e.g. if you used a QGridLayout).
Give your window a single child of the container class QStackedWidget. This container takes multiple child widgets but shows only one at a time. So:
Add to it a child container for each page of your wizard.
Populate each child with required widgets for that page.
Connect buttons, etc in each page to signals to do required actions...
...especially your Back/Next (and Jump, or whatever) buttons. Set these up so that they change the active child of the QStackedWidget by using the Slot setCurrentIndex().
This way, you build the entire stack of all pages, ready to go, before ever showing the window. Then, when ready, you just show it, and everything is present and ready. Your signals, all properly connected, will take care of everything else: changing between pages, validating input, revealing labels or opening dialogs warning about missing information, etc.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
As some suggested, I'm trying to minimize the question and get out of the web. That web example was not exactly what I wanted. I simply wanted to make a macro. Like if a condition is true open date settings and change the date to December 2000. If false, open time settings. How can I program to do this? Do I need to execute some commands in command prompt window to do it? If yes what are they? Actually, I want to make a macro that will do a lot of work in just on click.
as far as I know, eveything we do in computer or windows just executes a series of commands depending on the input of mouse and keyboard. So, I want to know if it is possible to know what commands are being executed in background. Actually, I want to make a macro in my program. As for example, a program that will go to google, search for a word and download the first imahe that comes from the search. If, it is possible to know then how.
[I could have searched in google. but I just couldn't guess what keywords to use in the search. so, I posted here. I am sorry if it has already been dicussed]
These click-related commands are really related to the GUI system. These 'commands' figure out what type of click, where on the screen it occurred, etc. After all that, some function to do the work will start executing, which is completely unique to the program, rather than the GUI.
Program that leverage other programs do not got through the GUI, and therefore can skip all of that. They instead use API's to directly access the functionality that is accessed by the sequence of events triggered by a mouse click.
The web is not my area of focus, so I do not have a reliable suggestion for how you would accomplish this, but the takeaway is this: Don't strive to understand the underlying technology by tracing mouse clicks. The GUI is an abstraction from what is really going on "under the hood," and is rarely an effective segue into the underlying mechanisms of a program.
Searching for "image search API" would be a good place to start.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm looking for some guide for Microsoft Visual Studio 2010, but I can't find nothing useful.
I'm coding in c++.
What I need is to create a button (in the dialog box) that, when I click on it, gives me the possibility to choose a file from my pc.
After that, I only need to charge in memory (like in a string variable nameFile) the name of this file.
Do anyone know how to do this operation?
And second problem, do you guys know any youtube guide or similar to customize the interface??
Like to put one picture on the background of the application, or change button style etc.
I used Eclipse before, coding in Java and It was totally different.
Thank you all!!
Here is an MFC tutorial for adding a button to a dialog and what has to be done to "wire it up" so that clicking the button invokes an event handler for the BN_CLICKED event.
Inside the BN_CLICKED event handler (that is, the function that is called when you click the button), you'll want to launch the dialog that lets you selecte the file. #Jongware suggested this link, which has a couple of approaches.
Once the file has been selected and the dialog disappears, you'll have access to the string containing the selected file. How you do this will depend on which approach you take in the preceding step. Once you have the string, you can use the appropriate File Management functions to slice-and-dice the file name as necessary.
That's far short of the actual code you'll need to write, I know, but it should give you enough of a start to get going. HTH.
I have a project using Qt 4.7. I need to display the contents of a webpage produced by performing a search on a website. The site has a box to type text into and an "ok" push button. When the ok button is pushed, it searches the site and goes to another page with the results. It's worth noting that these are NOT webpages made through Qt - they're just normal pages on a website. My Qt code so far is a simple UI with a QLineEdit and QPushButton. When the button is pushed, it needs to run the search on the site as if the user had typed the QLineEdit text into the search bar and clicked the ok button.
I know we're generally supposed to show sample code of what we've tried, but I honestly don't even know where to start with this, or if it's even possible. I've worked extensively with C++ but only a few months with Qt, and I've never had to write something like this. I've written code to write/parse HTML, but never to interact with a webpage that already exists. Can anyone please help? I'm really lost here. Thanks.
Edit: While looking for answers elsewhere online and seeing some of the similar-sounding questions people ask, I feel I should clarify: I absolutely am NOT in any way planning the use this for any sort of malware. It seems like a lot of similar questions get shot down over that, and I can assure everyone this project has no malicious intent whatsoever.
Try this:
void on_nameOfPushButton_pressed()
{
nameOfWebView->load(QUrl(QString("http://<website-url>.com/<search-url>?q="+
QUrl::toPercentEncoding(nameOfLineEdit->text()));
}
I apologize for asking a question of this caliber. I am at my wits end and have spent to much time trying to figure out how to get the side bar I closed back. I closed the "management" (the box with all the headers and .cpp's) and "messages" (where the compiler errors are displayed) box after I created a project. Now I can't get them back. When I close and reopen the management box is back, but the compiler box is not. I looked through the tabs for a while and will continue to investigate, but I think this is a really simple problem I have made extremely hard.
-With thanks and regret.
Right-click on one of the tabs that are showing up in the "Logs & others" pane. Then you should be able to re-enable other tabs in the "Toggle..." menu.
If you don't see any tabs, just right-click in the pane.