Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • QMenu on dual screen PC with Qt6.

    Unsolved
    2
    0 Votes
    2 Posts
    549 Views
    Christian EhrlicherC
    Upgrade to a more recent version, see e.g. https://bugreports.qt.io/browse/QTBUG-97533
  • Custom QStyledItemDelegate with a checkBox, that does not center. How to debug?

    Solved
    4
    0 Votes
    4 Posts
    575 Views
    A
    @andi456 Just in case someone has a similar problem. The solution for me was indeed the hint given in the link above. As can be seen from the posted paint method above, I use a function to determine the rectangle of the checkBox, which looks like this QRect CheckBoxZBuchDeckDelegate::getCheckBoxRect(const QStyleOptionViewItem &option) const { QStyleOptionViewItem opt = option; auto widget = opt.widget; auto style = widget->style(); auto checkboxSize = style->subElementRect(QStyle::SE_CheckBoxIndicator, &option, widget).size(); return QStyle::alignedRect(option.direction, Qt::AlignCenter, checkboxSize, option.rect); } So I just used the same function in the eventEditor method copied from the qt-sources of qstyleditemdelegate.cpp after deleting the lines containing const QWidget *widget = QStyledItemDelegatePrivate::widget(option); QStyle *style = widget ? widget->style() : QApplication::style(); I replaced QRect checkRect = style->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, widget); with QRect checkRect = this->getCheckBoxRect(option); et voilà. If a QStyledItemDelegate should answer to an event, the area to be clicked has to be announced to the editorEvent too.
  • Execute a python script stored in qrc file

    Solved
    4
    0 Votes
    4 Posts
    485 Views
    JonBJ
    @Renio Sorry, I don't understand if there is a further question here. This is fine, I wrote in my previous why you get the error trying to execute it and what you need to do at runtime to make it work.
  • QT how to prevent layouts from shrinking when they are empty

    Unsolved
    5
    0 Votes
    5 Posts
    412 Views
    JonBJ
    @lukutis222 As @Christian-Ehrlicher says, put a QLabel or a QWidget in with a minimum size to see what it will look like at design time. Then if necessary start by removing/replacing these widgets with whatever you really want immediately after calling setupUi() at runtime.
  • Using relative path for image:url in stylesheet

    Unsolved
    23
    0 Votes
    23 Posts
    11k Views
    C
    @lukutis222 it seems this has nothing to do with Qt. How are you downloading these images? What's their source?
  • How to resize Horizontal Header to it's name

    Unsolved
    2
    0 Votes
    2 Posts
    160 Views
    Christian EhrlicherC
    Resize the headers to the size returned by e.g. QHeaderView::sizeHint()
  • QTextEdit doesn't display its corner with border-radius

    Unsolved qtextedit border-radius
    11
    0 Votes
    11 Posts
    9k Views
    funwayF
    @Chris-Kawa Wow! Thanks for your detailed reply. I will try it. 🙏
  • What is the purpose of: if (object == header())

    Solved
    3
    0 Votes
    3 Posts
    262 Views
    J
    @mpergand Thank you.
  • 0 Votes
    7 Posts
    457 Views
    M
    @Guy-Gizmo said in Why does trying to create multiple windows when an application starts only create one?: I've reproduced the issue in both Qt 6.2.4 and Qt 5.15.2, both on macOS I'm in Qt 5.15.2 macOs 10.15 and that's not the case for me.
  • Adding Boost to Creator

    Unsolved
    19
    0 Votes
    19 Posts
    4k Views
    A
    @JonB it also fails with other files. As a workaround I finally just moved boost to the Documents folder and it picked it up. It might be due to my system folders being on a separate partition which is standard practice in linux installs.
  • checkable combobox with autocomplete

    Unsolved
    1
    0 Votes
    1 Posts
    466 Views
    No one has replied
  • QMediaPlayer setPosition is not working with Qt6.4

    Unsolved
    2
    0 Votes
    2 Posts
    200 Views
    SGaistS
    Hi and welcome to devnet, Can you try with 6.5 ? It has a backend change that you would have to test anyway.
  • QFile copy multiple files progress bar

    Solved
    12
    0 Votes
    12 Posts
    7k Views
    JonBJ
    @surfzoid No QFile::copy() methods emit signals for progress. You would need to do your own (just two QFiles) and emit a signal as you go. @mrjj wrote this just above.
  • How to config QChart in cmake for using in qml

    Unsolved
    3
    0 Votes
    3 Posts
    544 Views
    JoeCFDJ
    @nasimChildOfDesert do the following to avoid this type of error. target_link_libraries( ${PROJECT_NAME} PRIVATE Qt5::Charts)
  • have "file system " and want "Projects"' peramanently

    Unsolved
    2
    0 Votes
    2 Posts
    178 Views
    JoeCFDJ
    @AnneRanch The selection is saved when qtcreator exits. When you restart qtcreator, the setting should be Projects, not File System. If you possibly have system time issue as in your previous post, syn your machine first.
  • How to paint color on gray image !

    Solved
    5
    0 Votes
    5 Posts
    760 Views
    DQUY05D
    Hi, I converted to RGB and it worked Thanks ! [image: 29a6fdaa-52b5-48d9-bdce-ba9f193944f1.png]
  • QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError'

    Unsolved
    2
    0 Votes
    2 Posts
    601 Views
    Pl45m4P
    @Dummie1138 said in QObject::connect: Cannot queue arguments of type 'QSerialPort::SerialPortError': Sadly I have yet to determine which exact line of code is giving this message. Most likely your connect statement. what does it mean that QSerialPort::SerialPortError can't be queued? In order to send signals using QSerialPort::SerialPortError as argument in your thread, you need to register it in your class. // before the first connect with SerialPort qRegisterMetaType<QSerialPort::SerialPortError>("YourThreadCLass"); is this a problem that actually matters? You cant include your type in your signal otherwise. what is qRegisterMetaType()? Therefore, read what QMetaType is. https://doc.qt.io/qt-6/qmetatype.html#details what does it mean to register QSerialPort::SerialPortError using qRegisterMetaType()? Your type <T>, whatever it might be, is a recognised MetaObject and can be used in further queued connections. A Signal & Slot connection across threads is always a queued connection, or should be. Unspecified in your statement, it will pick the right one (Direct- vs. QueuedConnection) for you. https://doc.qt.io/qt-6/qmetatype.html#qRegisterMetaType-2
  • QTextEdit questions

    Unsolved
    3
    0 Votes
    3 Posts
    285 Views
    PerdrixP
    @JonB Thanks for the pointer Here's what I did for the spacing etc. // // Before any messages are written to the log, reduce the line spacing a bit // and reduce the font size by one // QTextBlockFormat bf = messageLog->textCursor().blockFormat(); bf.setLineHeight(85, QTextBlockFormat::ProportionalHeight); messageLog->textCursor().setBlockFormat(bf); QFont font{ messageLog->currentFont() }; font.setPointSize(font.pointSize() - 1); font.setWeight(QFont::Medium); messageLog->setFont(font); and for appending: messageLog->moveCursor(QTextCursor::End); messageLog->insertPlainText(message);
  • Errors spotted in debug log (qt 6.4.0)

    Unsolved
    2
    0 Votes
    2 Posts
    153 Views
    JonBJ
    @Perdrix It's not uncommon for Windows to throw errors such as this which can be harmlessly ignored. Impossible to known whether it matters or not, though if you application works that is a hint. Otherwise you would have to track down what exactly it is looking for from where, and carefully check all DLL versions.
  • QTablewidget

    Moved Unsolved
    7
    0 Votes
    7 Posts
    486 Views
    JonBJ
    @fadelsew @JonB said in QTablewidget: "No return", what does that mean? Empty?? You do not tell us whether your qDebug() << nom << description << couleur << date << heure << musique; is hit, we cannot guess?