How can I change the background here (black) to another color? I was playing around with an app called Honk, and they've set different backgrounds in some of their sections. I saw something on SO that said it could be done with window.backgroundColor = .magenta but I have no idea where to put that. I assumed it would either be inside the init() or as a property on the highest-level view of my app ie NavigationView, but no luck so far.
Here's a screenshot from Honk for reference:
And another:
I'm working on a Qt class project. We're supposed to develop an application like Microsoft Paint. Now I don't know how to enlarge a selected part of an image. Actually I don't even know how to "select" an area. You know, just like that on the desktop of Windows, you press the left button of the mouse and than move it, a dashed-line rectangle will show up. I hope to move or zoom in/out this particular area.
Any help will be appreciated, thanks!
It could be done by using mouse events. Here's example that might be useful to you:https://doc.qt.io/qt-5/qtwidgets-widgets-scribble-example.html
I want to use a light theme in WebStorm 2017.1 but for some reason the editor tabs are always dark.
I can change the font colour but that also changes it in the project tree view which has a white background.
The theme under Appearance is set to IntelliJ and the editor theme is set to default but I have tried it with many combinations.
Is this a bug or is there a setting I haven't found yet?
The issue was caused by the Material Theme plugin, disabled it and everything looks fine.
Thanks to #LazyOne for pointing me in the right direction.
Is there a color picker dialog for Qt like the following?
Also it needs to have a OnColorChanged signal which is called when ever the selected color changes. I want to give a live preview when they are changing the colors, that is why.
Using google I could only find this one that was a triangle in side of a circle and personally I think it looks ugly.
QColorDialog does exactly what you want.
(It is easy to find when you Ctrl-F through the list of Qt classes for "color")
Qt has now a "normal" color picker: http://doc.qt.io/qt-5/qcolordialog.html#details
I'm trying to implement some drag and drop functionality for a material system being developed at my work. Part of this system includes a 'Material Library' which acts as a repository, divided into groups, of saved materials on the user's hard drive.
As part of some UI polish, I was hoping to implement a 'highlight' type feature. When dragging and dropping, windows that you can legally drop a material onto will very subtly change color to improve feedback to the user that this is a valid action.
I am changing the bar with 'Basic Materials' (Just a CWnd with a CStatic) from having a medium gray background when unhighlighed to a blue background when hovered over. It all works well, the OnDragEnter and OnDragExit messages seem robust and set a flag indicating the highlight status. Then in OnCtrlColor I do this:
if (!m_bHighlighted) {
pDC->FillSolidRect(0, 0, m_SizeX, kGroupHeaderHeight, kBackgroundColour);
}
else {
pDC->FillSolidRect(0, 0, m_SizeX, kGroupHeaderHeight, kHighlightedBackgroundColour);
}
However, as you can see in the screenshot, the painting 'glitches' below the dragged object, leaving the original gray in place. It looks really ugly and basically spoils the whole effect.
Is there any way I can get around this?
Remote debugging is a godsend for debugging visual issues. It's a pain to set up, but having a VM ready for remote debugging will pay off for sure.
What I like to do is set a ton of breakpoints in my paint handling, as well as in the framework paint code itself. This allows you to effectively "freeze frame" the painting without borking it up by flipping into devenv. This way you can get the true picture of who's painting in what order, and where you've got the chance to break in a fill that rect the way you need to.
It almost looks like the CStatic doesn't know that it needs to repaint itself, so the background color of the draggable object is left behind. Maybe try to invalidate the CStatic, and see if that helps at all?
Thanks for the answers guys, ajryan, you seem to always come up with help for my questions so extra thanks.
Thankfully this time the answer was fairly straightforward....
ImageList_DragShowNolock(FALSE);
m_pDragDropTargetWnd->SendMessage(WM_USER_DRAG_DROP_OBJECT_DRAG_ENTER, (WPARAM)pDragDropObject, (LPARAM)(&dragDropPoint));
ImageList_DragShowNolock(TRUE);
This turns off the drawing of the dragged image, then sends a message to the window being entered to repaint in a highlighted state, then finally redraws the drag image over the top. Seems to have done the trick.