Skip to content
  • 0 Votes
    2 Posts
    217 Views
    A

    Hi,

    Please provide the following information:

    Qt kit you are using. Qt Creator version. OS, and if Linux, what desktop environment?

    I tested that stylesheet on Fedora KDE spin, using Qt 5.15.2/6.2.4/6.6.1, Qt Creator 12, and this MRE:

    int main(int argc, char *argv[]) { QApplication a(argc, argv); QTabWidget t; t.setStyleSheet(R"(QTabWidget::pane { border: 3px solid rgb(68, 76, 94); } /*======TAB*========*/ QTabBar::tab { /*color: rgb(68, 76, 94);*/ border: 2px solid rgb(68, 76, 94); } QTabWidget::tab-bar:top { top: 3px; } QTabWidget::tab-bar:bottom { bottom: 2px; } QTabWidget::tab-bar:left { right: 2px; } QTabWidget::tab-bar:right { left: 2px; } QTabBar::tab:left:last, QTabBar::tab:right:last, QTabBar::tab:left:only-one, QTabBar::tab:right:only-one { margin-bottom: 0px; } QTabBar::tab:first { border-top-left-radius: 10px; border-top-right-radius: 10px; } QTabBar::tab:last { border-top-left-radius: 10px; border-top-right-radius: 10px; } QTabBar::tab:middle { border-top-left-radius: 10px; border-top-right-radius: 10px; } QTabBar::tab:top, QTabBar::tab:bottom { min-width: 8ex; margin-right: -1px; padding: 5px 10px 5px 10px; } QTabBar::tab:top:last, QTabBar::tab:bottom:last, QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one { margin-right: 0; } QTabBar::tab:left, QTabBar::tab:right { min-height: 8ex; margin-bottom: -1px; padding: 10px 5px 10px 5px; } /*TAB:SELECTED*/ QTabBar::tab:selected { background: white; color: rgb(68, 76, 94); border-color: rgb(68, 76, 94); border-bottom-color: transparent; margin-top: 0; } QTabBar::tab:top:selected { border-bottom-color: none; } QTabBar::tab:bottom:selected { border-top-color: none; } QTabBar::tab:left:selected { border-left-color: none; } QTabBar::tab:right:selected { border-right-color: none; } /*TAB !SELECTED*/ QTabBar::tab:!selected { color: white; background-color: rgb(68, 76, 94); border-color: rgb(68, 76, 94); border-width: 3px; } QTabBar::tab:top:!selected { margin-top: 4px; } QTabBar::tab:bottom:!selected { margin-bottom: 3px; } QTabBar::tab:left:!selected { margin-right: 3px; } QTabBar::tab:right:!selected { margin-left: 3px; })"); t.addTab(new QWidget, "Variable fisicas"); t.addTab(new QWidget, "Variable fisiologicas"); t.addTab(new QWidget, "Unidad de Control de Agua"); t.show(); return a.exec(); }

    and I get this:

    QTabWidgetStyleSheetIsNormal.gif

    Which looks normal.

    I also tried it on in Qt Designer, just slapped a QTabWidget on a QMainWindow and applied the stylesheet on it, and got this:

    QTabWidgetStyleSheetIsNormalInQtDesigner.gif

    I also tried to apply the stylesheet on the main window, and the QApplication just to be sure, but same result.

  • 0 Votes
    1 Posts
    126 Views
    No one has replied
  • Checkbox Dimension

    Unsolved Qt Design Studio
    2
    0 Votes
    2 Posts
    450 Views
    T

    The size of the CheckBox is on controlled by the style/theme. See: https://doc.qt.io/qt-6/qtquickcontrols2-styles.html

  • 0 Votes
    4 Posts
    614 Views
    mrjjM

    @Dariusz said in QtCreator - some basics questions...:

    maybe how to change initial type of file from QWidget to QDialog/etc/etc?

    If you mean how to change the .h, cpp and UI file to be other type ?

    You will have to change in 3 places

    .h

    class MainWindow : public QMainWindow <<< change here

    .cpp
    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent) <<<< change here to new type

    .ui
    This you have to do outside creator, and its best if you close it.
    Open the ui file in other editor. ( its text)
    alt text

  • 0 Votes
    3 Posts
    803 Views
    P

    @Bonnie said in UI Stretch with QtCreator:

    Because the three layout widgets are not added to any layout. They are child widgets of centralWidget, but they are not added to its layout.
    A widget will only be resized and moved to fit the window when it is added to a layout whose parent widget is either the window or also added to an layout whose.....

    Thanks for help me, that works