Fullscreen borderless QDialog in Qt on Symbian - qt

Is there a way to show QDialog in Qt on Symbian without a border?
I show the dialog by this way:
QDialog dialog;
dialog.setWindowState(Qt::WindowFullScreen);
dialog.exec();
But there's an awful border at the screen, that's what I want to hide.
I've tried to use Qt::Splashscreen, but then there's a qdialog with transparent background, that doesn't achieve my goal.
Qt::FramelessWindowHint doesn't change something also (borders shows again).

You can call the setWindowOpacity after setting the SplahScreen flag in order to make it completely opaque.
dialog->setWindowOpacity(1.0);

Related

Qt, QWidget, QTabWidget, QTabBar: How to move the text to the bottom of icon?

By default, the text is always on the right-side of the tab icon...
What should I do to move the text to the bottom of it ?
And is there an option to do icon/text alignment ??
(I'm designing the GUI base on Qt Creator Designer.
I'm trying with Qt stylesheet but I can't. I have not yet modify the code that generated by Qt Designer.)
Thank you very much!
A tricky way:
Since we can set QToolButton to be icon above text, just create a group of QToolButtons, listed horizontally or vertically, each button needs to be checkable. Add them to a QButtonGroup.
Then hide the TabBar of QTabWidget(out of parent widget or under ToolButtons), place the TabWidget under the listed ToolButtons.
Finally, connect the QButtonGroup buttonClicked signal to the TabWidget's setCurrentIndex signal.
Notice, when you add a button to QButtonGroup, you will have to assign the ID from 0 manually.

How to Apply Glow Effect to QLabel Text in Qt?

I need to apply Glow effect to QLabel. Text in Black color and glow effect in white(Stroke Effect). I tried in Google but no luck.
If any one knows how apply Glow effect to QLabel then please tell me How to do that.
Yes you can set it on a QLabel:
http://qt-project.org/doc/qt-5/qwidget.html#setGraphicsEffect
You can set a QGraphicsEffect on a widget, as long as you don't mind it not working on a Mac.
label = new QLabel("hello text"));
QGraphicsDropShadowEffect * dse = new QGraphicsDropShadowEffect();
dse->setBlurRadius(10);
label->setGraphicsEffect(dse);
Hope that helps.
I think you're going to be slightly disappointed. To apply an effect, you'll need to use a QGraphicsItem. QLabel isn't. You'll need to use a QGraphicsTextItem inside a QGraphicsScene instead. That probably means you'll need to rebuild your UI if it's already implemented using QWidgets.

Qt Window with transparent background image

I placed background image like this:
setWindowFlags(Qt::FramelessWindowHint);
QPixmap slika("some_image.png");
QPalette paleta;
paleta.setBrush(this->backgroundRole(), QBrush(slika));
this->setPalette(paleta);
If I make this picture transparent, when application loads, it will only blink and disappear. But if I make this image with no transparency, then everything is ok. Why Qt refuses to use transparent image?
I don't know what is your use case for this, but you can also try using setStyleSheet method to make background transparent.
setStyleSheet("background:transparent;");
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(Qt::FramelessWindowHint);
Hope this helps.

transparent QLabel with a pixmap

I have a QLabel, and I put an image on it using setpixmap(). That image has alpha channel.
The QLabel is on a QWidget which has a border-image specified by an image (so that the image is rescaled to fill the QWidget).
On the transparent parts of the QLabel, the result is not the image specified on the QWidget, but a gray color characteristic of "no color" Widget.
My question is how do I make this in such a way that the transparent part of the QLabel shows the border-image of the QWidget?
I've tried canceling autofillbackground, changing the background color of the QLabel to white transparent, but none helped.
You need to set the Widget Attributes and Window Flags appropriately:
Using QWidget::setAttribute() and Qt::WidgetAttribute...
Qt::WA_TranslucentBackground needs to be set to true.
Along with learning the Window Flags Example should help a lot.
If you are just looking for a single widget that paints a frameless image...
Here is a perfect example:
QSplashScreen Replacement

How to remove the window border (containing minimize, maximize and close buttons) from a Qt widget?

I would like to animate a widget (QPushButon) to move across my application screen. For that I create a new button and using the QPropertyAnimation class and the property "geometry" of the button, I move it from top to down. The problem is that the button comes with the close, minimize, maximize buttons, etc. I don't want them to be there, nor the border that comes with the widget. What should I do ?
You want to use the function QWidget::setWindowFlags( Qt::WindowFlags ).
If you want to remove the maximize/minimize/close buttons, this should work for you:
setWindowFlags( Qt::CustomizeWindowHint );
Qt::CustomizeWindowHint turns off all the default window hints, like the maximize, minimize, close buttons, and the title bar.
Here's a list of all Qt::WindowFlags.

Resources