Skip to content
QtWS25 Call for Papers
  • 0 Votes
    2 Posts
    149 Views
    Abderrahmene_RayeneA

    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
    2 Posts
    188 Views
    Pl45m4P

    @giorgik63 said in How to read selected value in widget properties in Qt Designer?:

    value selected in a list of elements shown in a property of a custom widget placed in Qt Designer

    Can you explain or show what list you mean?

    Edit:

    Seems to be related to this topic and will probably get answered there.

    https://forum.qt.io/topic/144783/how-to-manage-choice-item-property-my-plugin-in-qt-6-5
  • 0 Votes
    1 Posts
    98 Views
    No one has replied
  • 0 Votes
    4 Posts
    224 Views
    D

    Hey @mrjj
    Digging out this topic... as I figure better to stick it in the same tree...

    Anyway, any idea how to make QScrollArea behave correctly too? Making it container does not let me drag widgets on it :/

  • 0 Votes
    5 Posts
    256 Views
    Fire CubeF

    Many Thanks
    That worked great.

  • 0 Votes
    3 Posts
    313 Views
    L

    thank you sir for your help

  • 0 Votes
    2 Posts
    330 Views
    M

    Hi,

    It's possible with dynamic properties, but as you want to pass an object, it's a little bit tricky:

    In the designer, you create a property named "argument" ( + sign on the right panel) and set groupBox_4 as value for this property.

    Then by code you can retreave that object:

    QString name=ui->listWidget->property("argument").toString(); QGroupBox* box=findChild<QGroupBox*>(name); if(box) { // do what you want width the groupbox }

    From inside LoggerList, you have to start the search from the window :
    QGroupBox* box=window()->findChild<QGroupBox*>(name);

  • 0 Votes
    11 Posts
    1k Views
    P

    Thank you it's worked, it seems that my other Frames didn't contain anything so that's why the StackWidgets covered all the window..

    Thank you @Pl45m4

  • 0 Votes
    1 Posts
    258 Views
    No one has replied
  • 0 Votes
    4 Posts
    304 Views
    mrjjM

    Hi
    On the bright side, when you do declare forward signals, you are doing it just right as
    accessing widgets left and right produces hard to maintain code that breaks easily.

    So by being "forced" to surface the external needed data via signals, you define an interface that will hold, even
    if you refactor the internal widgets. The rest of the app will remain unaffected. \o/

  • 0 Votes
    2 Posts
    197 Views
    JKSHJ

    Hi, and welcome!

    @Akash-Shanmugaraj said in Application Output not Visible in Qt Design Studio:

    I accidentally clicked some button which disabled the Application Output (for designing app) completely.

    Your Application Output pane is right there in the middle of your screenshot. It's the other panes that have been hidden.

    You can bring them back by clicking View > Views > Form Editor, for example.

  • 0 Votes
    3 Posts
    1k Views
    A

    Thank you for the answer.
    Setting a child did enable the layout selection. I don't understand the logic behind that at all but ok.

    QcmEntryGuess are QWidget I've created on the side. They're only a QLabel nested in two layout 12d3bbf3-2642-4ef6-90a4-71ae4535d2d8-image.png

    Althought my QGridLayout is still only consisted of one row. I'm probably missunderstanding one of its property
    a3d87a05-d1dc-40b4-a478-a67c0a2a0256-image.png

  • 0 Votes
    4 Posts
    394 Views
    C

    Achei o problema,.

    acidentalmente dupliquei a linha QApplication a(argc, argv);

  • 0 Votes
    4 Posts
    533 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
    2 Posts
    478 Views
    Christian EhrlicherC

    Maybe a dependency is missing so the dll can not be loaded -> use Dependency Walker to see what dependencies you're missing.

  • 0 Votes
    3 Posts
    398 Views
    Q

    @qt_emp I found it I think. When I turned off auto indent it stopped doing this.

  • 0 Votes
    2 Posts
    2k Views
    I

    @anp405, my first guess would be that by setting PYTHONPATH you are losing the location of PyQt5 package. This depends on your Python and environment setup, but if there is some PYTHONPATH existing, you are overriding it completely instead of complementing. You can verify this by opening a new command line session, setting PYTHONPATH to wherever your code sets it, then running Python interpreter and trying to import PyQt5.

    Another guess would be that your child process uses different Python environment (e.g. built-in system Python 2), which does not have PyQt5 installed in its site-packages.

  • 0 Votes
    7 Posts
    2k Views
    Pablo J. RoginaP

    @DSpider great! please don't forget to mark your post as solved. Thanks.

  • 0 Votes
    2 Posts
    965 Views
    S

    I fixed the issue by dropping the source string from the .metainfo files.

    For anyone that cares I was following these instructions: http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html and on step 5 I picked a random metainfo file when I searched the Qt folder for .metainfo, not the one they specifically chose (qtcharts.metainfo vs qtquickcontrols2.metainfo)

    The qtcharts one was probably for some other type of module use where specifying the source does something I don't need, the qtquickcontrols2 ended up having the syntax I really wanted in the end. Eventually I found this example and found out dropping the source worked: https://forum.qt.io/topic/56207/how-to-load-custom-qml-controls-into-the-qml-designer

  • 0 Votes
    4 Posts
    2k Views
    A

    @Valveware said in Promoting to custom widget in QtDesigner '*.hpp' no such file or directory [cmake]:

    file(GLOB_RECURSE QT_MOC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} FOLLOW_SYMLINKS include/dashboard/*.hpp)

    Ok that looks like it would indeed moc your cameraframe.hpp.. So that's probably not the issue.

    Can you share the build log from gcc? And also the ui_main_window.h file as well as ui_cameraframe.h?