I am most familiar with the gdb command line and greatly prefer it to qtcreator's GUI debugger. The qtcreator documentation (https://doc.qt.io/qtcreator/creator-debug-mode.html#directly-interacting-with-native-debuggers) says this:
"In Qt Creator, you can use the left pane of the Debugger Log view for that purpose. When you press Ctrl+Enter, the contents of the line under the text cursor are sent directly to the native debugger. Alternatively, you can use the line edit at the bottom of the view."
But when I look at the left pane of the "Debugger log view" I do not see a "line edit" at the bottom. I also don't understand what they mean by the "contents of the line under the text cursor". Please see attached image. Can anyone help?
I am running QT Creator 4.8.1
I don't see Debugger Log in your screenshot. I get it from Window menu, Views submenu, which has checkable item Debugger Log.
Tested under Windows, Qt Creator 4.9.0, MinGW Qt toolchain, a simple test project runing in Debug mode.
Here is a screenshot showing where to find it, and a little bit of what it should look like after doing print argc when stopped at first line of main:
Related
I could successfully compiled and run a program which has its icon in a system tray.
There is a good example explaining it here:
https://doc.qt.io/qt-5/qtwidgets-desktop-systray-example.html
Now is my problem: When I run my program, its icon is still visible also in the task bar.
How to get rid of this icon from the task bar?
Why it is important to me? My program will be an alarm-clock, so it should be visible on the Desktop, but it should not be occupying place on the task bar. This is why I decided to place it in the system tray. So, how to get rid of it from the task bar?
In the example you need to just uncheck the corresponding checkbox, which set the visible property to true or false:
Line in the example where the checkbox connects to the property:
connect(showIconCheckBox, &QAbstractButton::toggled,
trayIcon, &QSystemTrayIcon::setVisible);
Then you can close the window. The application will be still running because of the line
QApplication::setQuitOnLastWindowClosed(false);
Here is an answer
The information in the Task Bar about a particular running program is independent on the system tray information. So to make the program info (and its icon) 'not present' in the task bar - we have to work in a different place: We need to change the attribute of a main window of the program. In this case it was enough to add - the following line in a constructor of the program window:
setWindowFlags(Qt::Tool);
The tool dialog is a kind of window which information is not "placed" in a task Bar.
So now it works as I planed.
Right now I have a small tool app that runs in the icon tray. When I click on the icon, the app goes into "windowstayontophint" mode. I added a Combo Box on this window. But when I click elsewhere on desktop, and then click the combo box, the drop down window goes to the back of the window. This seems to be a known bug as reported here:
https://bugreports.qt.io/browse/QTBUG-61804
Is there a workaround for this? I am using Qt 5.9.1.
EDIT: Add some code:
This in MainWindow constructor:
Qt::WindowFlags flags = this->windowFlags();
this->setWindowFlags(flags|Qt::WindowStaysOnTopHint);
Then I put a QComboBox in the mainwindow with preloaded items. First time click, the dropdown appears on top as normal. Then I click onn desktop and then back on the mainwindow and combobox. And drop down becomes at the back of mainwindow. CLick on the link above to see what I mean. The bug report also provide screenshot of what is happening.
Nobody want to put an answer, so I answer this myself.
ANSWER: Update to latest Qt.
It did not work for me because I was having trouble updating (noob here). What basically happened was that Selecting "Update" option on Maintenance Tool does not update SDK from 5.9.1 to 5.10.1. It only update certain things like Qt Creator.
I needed to choose "Add or remove Components" and then adding Qt 5.10.1, but only check the MinGW 32bit only. (Uncheck all others otherwise you need them (like android or other)).
Even after that, you also need to manually download CMake (get it from cmake.com) and set it in "Manage Kits" in Qt Creator.
While debugging in Qt Creator (ver 3.4.2), if I hit the escape key (which I tend to do often to declutter my work space), then all of the debugger views including the debugger toolbar become hidden (as expected), but later I can't get them back. If I go under Qt Creator's main menu->Window, then Views is disabled.
Here's an example of a basic window before I click the escape key. Notice I have all of the debugging views showing (i.e. Breakpoints, Stack, Locals and Expressions, etc...)
Here's an example of my window after I've clicked the escape key. Notice how all of the debugging windows are hidden (as expected). My question is, now how do I get the windows back? You can see how the "Views" submenu under the "Window" menu is disabled.
Is there some sort of "Show Debugger Toolbar" keyboard shortcut? Or is there another menu somewhere to get this back? Any help would be much appreciated.
Under the Window menu, enable Show Mode Selector. This will show a strip down the left of your window where you should see a Debug tab you can click on to put Qt Creator back in Debug mode.
Currently, my Xcode4 does not stop at NSAssert failure. How can I make it stop at NSAssert failure again?
Go to the XCode 4 breakpoint navigator.
Click the + button and choose "Add Symbolic Breakpoint"
Set Symbol: to "-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]"
Click "Done"
Now you will stop in the debugger as soon as NSAssert fires. In my testing, it goes to the nearest source code and doesn't just show you the assembly where you set the breakpoint.
More Generically, you could do this:
Go to the breakpoint navigator.
Click the + button and choose "Add Exception Breakpoint"
Set Exception: to "Objective-C"
Set Break: to "On Throw"
Click "Done"
This may be more or less useful depending on your code.
See also the XCode 4 documentation result for "Adding an Exception Breakpoint"
Assertions are automatically disabled, by default, in a Release build. If you want assertions to work, do a Debug build, or turn off the Other C Flags build setting where assertions are turned off in the Release build.
When I use the 'Jump To ...' context menu CodeRush drops a marker before jumping, so that I can navigate back.
When I CTRL-F in Visual Studio it doesn't.
How can I configure CodeRush to add this handy little navigation aide.
Ok simple enough
Create a new Shortcut using instructions found here
Specify Ctrl+F as the Key
Specify MarkerDrop as the Command
Then check the "after executing this command, pass shortcut to IDE for default handling" checkbox.
Ctrl+F should now drop a marker whenever it launches the Find Dialog.
More detail and bonus Marker tips are available here