Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • How to create a Checkerboard Pattern in Qt Designer

    Solved
    3
    0 Votes
    3 Posts
    217 Views
    L
    Thank you so much, I'll try your method
  • How to overlap an image with a label

    Unsolved
    7
    0 Votes
    7 Posts
    624 Views
    F
    @Pl45m4 I used labels with fixed coordinates and its worked, what do you mean by anchor lock? Its an expression? I’m not native speaker. Im really getting trouble to adjust the labels coordinates and sizes. Im trying to make simple rule of three based on size proportions of the screen
  • Unable to launch macOS app in sandbox

    Solved
    4
    0 Votes
    4 Posts
    297 Views
    SGaistS
    Glad you found out ! Which libraries were missing ?
  • QScrollArea: Area is not updated while an arrow key is held pressed

    Solved
    5
    0 Votes
    5 Posts
    262 Views
    T
    It seems it's an environment issue not related to the Qt code. On Ubuntu 22.04 under Virtual Box => the issue appears On RedHat 8.9 under a container with Ubuntu 22.04 => the issue does not appear. Thanks Let's mark this issue as solved.
  • C1001: Internal compiler error

    Unsolved
    6
    0 Votes
    6 Posts
    772 Views
    K
    Yes, it was really a bad idea to use the "latest" build tools. I have moved back to (v14.39-17.9) [image: bfbe1195-eedf-4288-bbb9-409690e1eee1.png].
  • VS 2022: How to ensure qsb gets ran?

    Unsolved
    1
    0 Votes
    1 Posts
    105 Views
    No one has replied
  • Feasibility of Embedding Jupyter-like Python Console in Qt using C++

    Unsolved
    8
    0 Votes
    8 Posts
    677 Views
    SGaistS
    You might want to check the Serial port terminal example. Depending on what you want to achieve Kate's terminal(article discussing having it on Windows as well) using Konsole might be another possibility. But all in all, you really need to define what you want to do as depending on that you will either ensure your user has python installed or you'll have python built into your application.
  • Help needed to connect slots and signals across qtplugins in my application

    Unsolved
    3
    0 Votes
    3 Posts
    197 Views
    Pl45m4P
    @krisby Hi and welcome, I was wondering if there were any good tutorials that show how to connect to a signal emitted from one plugin in another plugin. why do you need a tutorial to write a single line connect statement? You connect in the same way as you would connect other QObjects. I know how to do this in a normal application but not through an application that uses plugins. At some point you have to load your plugin with your app... then you have both plugins available and then you can connect them. Anyway, the idea of connecting two plugins with each other, seems like bad design. They should be connected to your main app and not with each other. On load, connect the plugin with some signal in your main app. Maybe there are even better or cleaner ways. Check out the DocumentViewer Example and how it's done there. (There is a ViewerFactory which loads different ViewerPlugins... and they also have signals connected) https://doc.qt.io/qt-6/qtdoc-demos-documentviewer-example.html
  • 0 Votes
    3 Posts
    343 Views
    SeDiS
    Thanks! With upgrading to Qt 6.7.2 the warning vanished.
  • How to have a QMenu with a single item

    Unsolved qmenu qmenubar
    2
    0 Votes
    2 Posts
    245 Views
    SGaistS
    Hi, Which version of Qt ? On which OS ? What is the text that is supposed to be shown ? Please provide a minimal compilable example that shows the issue.
  • How to detect if "Enter Key" has been hit when a QlistWidget item is selected.

    Unsolved
    11
    0 Votes
    11 Posts
    665 Views
    ademmlerA
    Ok Gentlemen, I have tested some things and ran into a couple of issues (Crashes of the application). The only approach wich works a expected and without crashing is this: void JobBrowser::keyPressEvent(QKeyEvent* event) { // if (event->key() != Qt::Key_Enter) // { // JobBrowser::keyPressEvent(event); // return; // } if (ui->listWidget_Jobs->count() == 0 && event->key() == Qt::Key_Enter) { getMatchingFiles(ui->lineEdit_searchPhrase->text()); } else if(ui->listWidget_Jobs->count() != 0 && event->key() == Qt::Key_Enter) { QListWidgetItem *item = ui->listWidget_Jobs->currentItem(); if (item->isSelected()) { QString filePath = jobBrowserFolder.absoluteFilePath(item->text()); emit signalSendFilePath(filePath); } } else if (event->key() == Qt::Key_F17) { ui->checkBox_Front->toggle(); } else if(event->key() == Qt::Key_F18) { ui->checkBox_Back->toggle(); } else { event->accept(); } } But now I am confused, because it only works if I deactivate the part where I pass the standard event. What is my logical or technical problem here.
  • how to add description properties

    Unsolved
    8
    0 Votes
    8 Posts
    454 Views
    B
    @Bonnie thank you for providing the documentation
  • Why setStylesheet isn't working for my widget?

    Solved
    2
    0 Votes
    2 Posts
    141 Views
    Pl45m4P
    @Kirill-Gusarev said in Why setStylesheet isn't working for my widget?: But nothing is painted over. Why? You need to implement the paintEvent handler in your custom widget class, as described here in the QWidget section https://doc.qt.io/qt-6/stylesheet-reference.html and then add this code: QStyleOption opt; opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); Otherwise it can't process the StyleSheet.
  • Lost My Qt Widgets StyleSheets

    Solved
    25
    0 Votes
    25 Posts
    4k Views
    Christian EhrlicherC
    @Hardy91 Simply don't modify ui elements from outside the main (ui) thread...
  • Drawing composed widget

    Solved qpainter qwidget qpainterpath
    5
    0 Votes
    5 Posts
    666 Views
    Pl45m4P
    Solved. For further readers: I've added a check to the child widget whether a user interaction happens within its drawn borders (a closed QPainterPath). If so, I consume the event and continue from there, if not, I ignore the event and pass it to the parent widget, i.e. the actual MyWidget, so that the overlaying child widget has some transparency for my defined events (some key and mouse interaction). Pretty easy if I think about it now. The idea of having some kind of a donut shaped widget (yellow part in my sketch), which does not occupy the center of its parent widget was stuck in my head way too long :))
  • QTcpSocket read packet

    Solved
    2
    0 Votes
    2 Posts
    142 Views
    JonBJ
    @Redman You should not be talking about (or creating variables) for "packets", "payloads" or "datagrams" here. All you know is that QTcpSocket::readyRead signal will fire when 1 or more data bytes arrive at socket. That's it! It could be any number from 1 to the total number of data bytes (as returned by readAll() or bytesAvailable()) sent from the other side. And consequently it could be emitted any number of times with varying numbers of bytes. You should make no assumptions about how many will be available each time. If you need to "collect" a number of bytes to constitute some "message" your code expects to parse it is your job to buffer all the bytes received and work from that.
  • Change Link colors in QT Assistant with a Dark Stylesheet

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    Z
    How to change the interface style of my Qt Assistant to the style of the help document in Qt Creator [image: d4e6c1ec-aa6e-48d7-bbc0-f183c9f1b98e.png] [image: da57b080-0489-410f-bd88-b3d8fe1e87e6.png]
  • Dump QImage raw pixel data into `std::vector<char>`

    Solved qimage vector
    48
    0 Votes
    48 Posts
    29k Views
    H
    Hi I've done something recently I've needed so my approach was: total_len = qimg.width() * qimg.height(); std::vector<unsigned int> data; data.reserve(total_len); for(int i=0; i < qimg.height(); i++) for(int j=0; j < qimg.width(); j++){ data.push_back(qimg.pixel(j, i)); } I needed it as an rgb pixels in order to do some image manipulations, but I believe you can also take the uchar data.
  • Replace placeholder in ODT file with data from QT

    Solved
    8
    0 Votes
    8 Posts
    457 Views
    T
    Hello all Thanks a lot. I will try to use HTML to PDF.
  • 0 Votes
    3 Posts
    408 Views
    L
    @SGaist , thanks a lot. app=QtWidgets.QApplication(sys.argv) app.setStyle('windowsvista') The revised code(above) is working venv67 as well. Some clients are expecting Win10 and Win11, so this is a big help.