I'm creating a gui in Qt Creator in ubuntu, and I have a big rectangular button that I'm trying to turn into a circle or oval. It won't let me edit the code in edit mode, I can only change how it looks in design mode I think, which isn't helping me. How do I do this?
The look of buttons (and other widgets) is controlled by "style sheets".
I don't have Qt creator in front of me at the moment, but if you select the button in the designer and look at the properties there is something there that opens a dialog that let's you enter "css" to control the look of the button.
After looking at QtCreator, the property to edit is called "styleSheet".
Example:
QPushButton {
border-color: rgb(66, 69, 183);
border-width: 3px;
border-style: solid;
border-radius: 40px;
margin:30px;
padding:30px;
}
Gives
Related
Hopefully someone can help me here.
I'm working in Oracle Apex and have a side navigation menu which expands and shrinks. In both versions there is a visible web browser vertical scroll bar.
Is it possible to hide this but still maintain the scroll feature?
For example this sample application I found online (https://apex.oracle.com/pls/apex/f?p=42599:1::::::) contains the same functionality but without the scrollbar present. Looks a lot cleaner and doesn't get in the way of text / icons etc.
Here is a picture to show both systems.
Thank you
If you want this behaviour throuhought the application, define the below CSS code either on the page 0 or in a global CSS file.
/* Hide scrollbar for Chrome, Safari and Opera*/
.t-TreeNav::-webkit-scrollbar {
display: none;
}
/*Hide scrollbar for IE, Edge and Firefox */
.t-TreeNav {
-ms-overflow-style: none; /*IE and Edge*/
scrollbar-width: none; /*Firefox */
}
I have some views that I have built that are fairly basic, and I am trying to make them very aesthetically pleasing.
All has gone well except I cannot control the padding on the bottom pager.
I want there to be some space after the last entry and before the table.
Any help would be greatly appreciated.
Add this to your XPage's css
.xspDataTable {
margin-bottom: 20px !important;
}
Recently I came to SO in this question asking how could I get my hands on a QComboBox' QScrollBar in order to change its thickness. After reading the replies, I tried Marco A. solution for my Qt Embedded application and it didn't worked. Then, for test, I changed the compilation environment to Desktop and the fix worked!
So essentially my problem is that when I try to change a QComboBox's QScrollBar width in Qt for Embedded Linux (ARM), nothing happens, but if I compile the exact same code for Qt for Desktop, it works. The following is the code I'm using for tests:
QAbstractItemView* poView = ui->comboBox->view();
QScrollBar* poBar = poView->verticalScrollBar();
poBar->setStyleSheet("width: 50px;");
and there is another code that does the same, but shows the same problem:
ui->comboBox->setStyleSheet("QScrollBar:vertical { width: 50px; }");
With comboBox being declared in the ui form in Qt Designer (inside Qt Creator).
Qt versions are the same for Desktop and Qt for Embedded Linux (4.8.5). Another thing I found strange (but should have nothing to do with it) is that compiling the same code again for Desktop shows a QComboBox with a Windows XP style, while for Embedded the Plastique style is used (I notice that quite clearly due to Plastique showing three instead of two buttons to scroll the scroll bar).
So what could be happening? How may I solve this problem?
I noticed the same symptoms. In Qt a lot of the drawing, I understand, has been delegated to the styles, and the Plastique style seems to have a bug in that it doesn't seem to draw a vertical scroll bar in the right coordinates if it doesn't have the default size. So if you do this:
QScrollBar:vertical
{
min-width: 35px;
width: 35px;
}
you end up with the symptoms you described. But, AFAICS there's something wrong with the handling of margins as well! If you play around with the margins, e.g. like this:
QScrollBar:vertical
{
min-width: 35px;
width: 35px;
margin-right: 35px;
}
you should be able to work around the bug.
Worked for me at least.
poBar->setMinimumWidth(50);
poBar->setMaximumWidth(50);
I tried it with PyQt5, QT5 in Python3-syntax, it customizes the width of the Scrollbar on Linux (Ubuntu 14.04) as well as on windows7
I have created a QTextBrowser and I wanted to know how i would set the background colour of the whole widget.
I have tried QTextBrowser.setBackground(QtGui.QBrush(QtCore.Qt.blue, QtCore.Qt.SolidPattern)) with no luck.
In this case I suggest you to use stylesheet:
If in QDesigner, right click on the control, click "Set Stylesheet" and write
background-color: blue;
If you want to do it by code, just use
YourControlTextBrowser.setStyleSheet("background-color: blue;")
I'm using CKEditor 4 inline. Is it possible to change the toolbar location e.g. 50px over the editor div?
Thank you!
If you want to keep this "floating toolbar" behaviour, then you can move it around using these settings.
But if you want to keep toolbar in one place, then check this plugin: http://ckeditor.com/addon/sharedspace
There's a sample, but you need to build a CKEditor package with this plugin and then you'll be able to check it.
You can simply give margin-top: -50px; to the toolbar element if you want to place it 50px over the editor div.
Thanks to Harish, I've found a way to make it work for CKEditor 5: Inline Editor. This is how to move the toolbar relatively from its current position.
.ck.ck-toolbar-container {
margin-top: -24px;
margin-left: 48px;
}