How would you build a windowless application with C++/Qt5? - c++

How would you build a windowless application with C++/Qt5? Do I have to use QDialog or QWidget?
For example, Launchy has no window border and the background around the text box is transparent.

I think that's what you're looking for :
http://qt-project.org/doc/qt-4.8/widgets-shapedclock.html
This is a tutorial on how to make a shaped and borderless window with Qt.
It's for Qt4.8 though, i think it should work on Qt5.
EDIT : Found the Qt5.0 version : http://qt-project.org/doc/qt-5.0/qtwidgets/widgets-shapedclock.html

Use a QWidget with Qt::SplashScreen or Qt::FramelessWindowHint. Check all the other window flags.

Related

How to draw a caret/arrow bottom of a QDialog on qt5

I want to draw a caret / arrow top or bottom of a qt window. I cannot find any document regarding to this.
How can I accomplish this task with qt5? I've searched all possible words but can't find anything.
Can this be applied to QDialog or qml needed? My first choice is QDialog since I have a webengine and other qwidgets already in a QDialog.
I'm using C++.
Here is what I mean:
Most window-managers don't support non-rectangular windows directly, which means that if you want to do something like this you'll need to fake it by making the window large enough to include both its normal content and the desired caret-shape inside the window-area, and making the window transparent at the top.
To do that, call setAttribute(Qt::WA_TranslucentBackground) and setAttribute(Qt::WA_FramelessWindowHint) on your dialog, and override paintEvent(QPaintEvent *) to paint the dialog's background only for the parts of the dialog you want to be non-transparent.

QT window within window?

I'm setting up a small code editor using QT and following this example. However, i'm curious on how to create windows within windows or widgets within widgets. I'm trying to achieve something similar to these:
http://i.stack.imgur.com/Vn8Ut.png
http://www.hanselman.com/blog/content/binary/Windows-Live-Writer/Download-Visual-Studio-2013-while-your-f_1431E/image_4eb5427c-1ae7-4464-9c26-2282fe8d06c3.png
Is there an example of overlaying widgets like this?
Any alternative soloution for QMessagebox for IOS development (QWidget application only)?
I gave an example of getting another QWidget to be embedded and painted on top of another one. Let me know if you have any questions about how it was done.
The PopUp flag and Qt::Tool options are also relevant.
Be sure to check out: the ToolTip property of a QWidget and the WhatsThis property of QWidget.
http://qt-project.org/doc/qt-5/qwidget.html#toolTip-prop
http://qt-project.org/doc/qt-5/qwidget.html#whatsThis-prop
There are also other ways to make borderless, focusless windows that hover and disappear quickly on command. The Window Flags and Widget Attributes in Qt are very powerful when you are looking to modify Qt Widgets.
When you parent a Widget to another widget, it will draw itself on top of the other. Then you just need to resize and position it properly.
Also subclassing existing widgets can give you more options.
Draw text on scrollbar
Also common Qt::Tools that you will find are QDockWidgets. They are awesome!
Hope that helps.
Take a look at Qt Namespace especially Qt::WA_LayoutOnEntireRect and Qt::WA_StyleSheet. Pass it as a widget attrybutes. The second option looks promising but you have to create style sheet for QWidget.

QT: Frameless window not animating

i need some help for my current project named "RibbonUI".
As the project name suggest, i want to implement the MS RibbonUI like in Office 2013 in QT - most stuff is working nice but i need to know something about the Qt::FramelessWindowHint.
I have subclassed the QMainWindow and added the enum value Qt::FramelessWindowHint to override the default window decoration. The buttons are implemented fine - i can minimize, maximize and close my frameless window, but the window is not animated when minimizing/maximizing/restore the window from the taskbar.
Do i have to implement the animation by myself or can i use a window manager hint or something else?
Here is a screenshot from my current work:

Splitter in Qt5 is invisible

I have been creating a small frame window with a splitter object, using the Qt Designer. What is strange though is, that the splitter is working, so when I move the mouse where it should be, the cursor switches it's shape and I can drag the splitter, but the splitter bar itself is invisible.
Is this a bug from Qt5? I'm using Qt 5.2.1 OpenSource with MingW on Windows 7.
(source: picr.de)
Update
I created now a bugreport for this issue
I have also invisible splitter (Using Qt 5.3).
But I am using some complex style sheet which colors it in a way I need and it is visible that way:
QSplitter::handle {
background-color: #333;
}
Please check the docs how to apply style sheet.

Transparent window in Qt

How can I create a transparent window in Qt for Linux. I tried the following, but it doesn't work:
myWidget::myWidget(QWidget *parent) : QWidget(parent, Qt::FramelessWindowHint) {
setWindowOpacity(0.4);
}
"Note that under X11 you need to have
a composite manager running, and the
X11 specific _NET_WM_WINDOW_OPACITY
atom needs to be supported by the
window manager you are using."
https://doc.qt.io/qt-5/qwidget.html#windowOpacity-prop
What window manager are you using?
http://en.wikipedia.org/wiki/Compositing_window_manager#List_of_compositing_window_managers
Does your server support the "Composite extension"?
http://en.wikipedia.org/wiki/Composite_(graphics)
Does your card support it?
Try to use QGraphicsOpacityEffect and QWidget::setGraphicsEffect
I had a similar issue but on windows, not sure if it will help in Linux
Instead of Qt::FramelessWindowHint use Qt::SplashScreen. I can have a frameless and transparent window on top of my other widgets.