Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • How to move from one Text Edit to another Text Edit by pressing the enter button.

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    Ramkumar MohanR
    @JonB Now , code working fine sir , Thank you.
  • Discord widget using Qt

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    Y
    SGaist said in Discord widget using Qt: It's a JavaScript based widget so you need a browser widget. On desktop it usually means QtWebEngine (QtWebView uses QtWebEngine on platforms without system provided webview) so no, static build is not an option as web engine does not build statically (nothing to do with Qt). @SGaist I'm building my qt app with the static source, so it's not possible to use the webenginewidgets module?
  • 0 Votes
    3 Posts
    311 Views
    J
    Thanks @JonB, that was a helpful hint. The foreign executable runs not properly. No problem with my code and other executables.
  • How to add css stylesheet to a QWebEngineView?

    Solved
    2
    0 Votes
    2 Posts
    595 Views
    Y
    Fixed it. The correct include is: #include <QtWebEngineCore/qwebenginescriptcollection.h>
  • 0 Votes
    8 Posts
    1k Views
    P
    @JonB Thanks! Changes made to my local code!
  • QMediaPlayer cmake not found in Qt 6

    Solved
    6
    0 Votes
    6 Posts
    950 Views
    SGaistS
    You can mark the thread as solved yourself :-) You can use the "Topic Tools" button or the three dotted menu beside the answer you deem correct.
  • Load file locally

    Unsolved
    8
    0 Votes
    8 Posts
    724 Views
    JonBJ
    @n34rt So you want to use a resource via a .qrc for release, but not during development? Then use code to read from file at development runtime time. And/or maybe per @ChrisW67 change your makefile to omit test.png as a dependency requiring running rcc while developing and get right at release time. But don't make a mistake!
  • Prevent user from typing invalid values in QLineEdit

    Unsolved
    6
    0 Votes
    6 Posts
    712 Views
    JonBJ
    @wakiki Fair enough. I think you will find the validator prevents the user from typing some things --- for example invalid characters or a string which is too long --- but it won't for example prevent things being typed which could be changed or adjusted to be right. I'm not sure what the rules are. It will just return Intermediate for the verification.
  • 0 Votes
    6 Posts
    1k Views
    JonBJ
    @Turbotroop OK, so: Is the code pasted now currently what you have, exactly? What error do you currently have? Have you acted on the previous comments? For example: although it won't generate a compilation error, it does not make any sense to set up all these boxes or arrays in the main window destructor, does it? Why not in, say, the constructor instead?
  • Form renders slowly

    Unsolved
    4
    0 Votes
    4 Posts
    464 Views
    JonBJ
    @karpouzi Agreed/understood. So presumably that is not relevant, and the issue to do with displaying any text, like perhaps starting up/finding fonts (e.g. try with a label instead of a push button)? And (assuming it is a big lag) since nobody else has reported it and plenty use Qt 5.15 one can only guess it is something to do with your machine, but I don't know what....
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • fatal error: QColor: No such file or directory

    Solved
    33
    0 Votes
    33 Posts
    6k Views
    SPlattenS
    @jsulm , I've moved on now, by ditching the header and reference to QColor.
  • NVD3DREL: GR-805 : DX9 Overlay is DISABLED Error

    Unsolved
    7
    2 Votes
    7 Posts
    2k Views
    JonBJ
    @karpouzi Maybe https://stackoverflow.com/questions/69573327/qt-creator-display-in-application-output-nvd3drel-gr-805-dx9-overlay-is-disa ?
  • QtTest - Share your workflow

    Unsolved testing qttest unit-testing
    5
    0 Votes
    5 Posts
    862 Views
    U
    @SGaist Thank you for taking the time. Now, I am happy that I've more or less applied the architecture and workflow suggested by the man himself already. The example you used toward the end is exactly my case, which leads me to ask for tips here. I will be checking the source tree for more specific cases and will be making modifications accordingly.
  • Trying to insert tr() returned string in Qhash

    Unsolved
    9
    0 Votes
    9 Posts
    611 Views
    A
    @J-Hilk thank you its working
  • This topic is deleted!

    Unsolved
    10
    0 Votes
    10 Posts
    16 Views
  • QProcess wont run python with full runtime

    Unsolved
    10
    0 Votes
    10 Posts
    895 Views
    T
    @JonB Perfect, thank you! I will look into that, this was a lot of progress for today, the python program seems to get stuck at some point thats why I was wondering what happened. Thanks again. It certainly is strange becouse when i run it manually no problem arises, and now we know for sure its running but when run by a process it gets stuck. UPDATE: Code wasn't getting stuck, it was a human error on my side, as it most often is, thank you for your patience.
  • 0 Votes
    1 Posts
    138 Views
    No one has replied
  • hide cell from tablewidget

    Unsolved
    6
    0 Votes
    6 Posts
    643 Views
    JonBJ
    @Nevez said in hide cell from tablewidget: because if I try to add widgets the process will become very heavy and take long time. Indeed! I also added a button to the cells with the paint function using qstyleditemdelegate. But this overlapped with the text. QStyledItemDelegate::paint() says Whenever possible, use the option while painting. Especially its rect variable to decide where to draw So on entry option.rect states the whole cell's rectangle to draw into. If you put something like a button into that area you need to change the rectangle to exclude the area it occupies so that what you pass onto the default painter method for the text is only passed the remaining unoccupied area.
  • QScrollArea scrollbar not working as expected

    Unsolved
    9
    0 Votes
    9 Posts
    396 Views
    L
    After some experimentation, I think I got it to work using layouts: [image: fc07db6c-0a5c-45dd-93fe-a2a3d7483b96.png] All I did was create QVBoxLayout and put scrollareawidgetcontents in the layout. The rest is the same except that I no longer need to set widget geometry since it is being placed in a layout. command_local->scrollAreaWidgetContents = new QWidget(); // create scroll area contents widget for the qscrollarea command_local->scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents")); command_local->commands_layout = new QVBoxLayout(command_local->scrollAreaWidgetContents); for(int i=0; i < command_local->command_list_s.count(); i ++){ command_local->command_list_s[i].Command_checkbox = new QCheckBox(command_local->command_list_s[i].name, command_local->scrollAreaWidgetContents); command_local->commands_layout->addWidget(command_local->command_list_s[i].Command_checkbox); } command_local->start_test_button = new QPushButton(command_local->scrollAreaWidgetContents); command_local->start_test_button->setObjectName(QString::fromUtf8("start_test_button")); command_local->start_test_button->setText(QCoreApplication::translate("Widget", "Start test", nullptr)); command_local->commands_layout->addWidget(command_local->start_test_button); connect(command_local->start_test_button, &QPushButton::clicked, this, &MainWindow::Start_test); command_local->test_status = new QLineEdit(command_local->scrollAreaWidgetContents); command_local->test_status->setObjectName(QString::fromUtf8("test_status")); command_local->test_status->setText(QCoreApplication::translate("Widget", "IDLE", nullptr)); command_local->commands_layout->addWidget(command_local->test_status); command_local->cmd_selected_test = new QLineEdit(command_local->scrollAreaWidgetContents); command_local->cmd_selected_test->setObjectName(QString::fromUtf8("selected_test")); command_local->cmd_selected_test->setText(QCoreApplication::translate("Widget",action->text().toStdString().c_str(), nullptr)); command_local->commands_layout->addWidget(command_local->cmd_selected_test); ui->Testing_scroll_area->setWidget(command_local->scrollAreaWidgetContents);