Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QPushButton in a Widget

    Solved
    4
    0 Votes
    4 Posts
    325 Views
    V
    @Christian-Ehrlicher Thanks a lot for pointing out the bug! It seems to be working now :)
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Gtk RecentManager equivalent for Qt

    Unsolved
    2
    0 Votes
    2 Posts
    146 Views
    Pl45m4P
    @gozag AFAIK not as ready to use class. The recent file list in QtCreator is made using QSettings and a list of paths/names.
  • QCanBusFrame::TimeStamp is time since Windows has started?

    Unsolved
    3
    1 Votes
    3 Posts
    448 Views
    J
    I am using PEAKcanUSB I "solved" this issue by using the function "GetTickCount from sysinfoapi.h This returns ms since system start. To convert a QCanBusFrame timestamp into QDateTime, I use QDateTime::currentDateTime.toMsecSinceEpoch and subtract "GetTickCount()" Now I have the offset between QDateTime and Timestamp This works quite well, but not always. If I use my computer in energy-saving mode and dock it to my docking station, this time sometimes adds a strange offset of 3 seconds. When I reboot my computer, this offset is gone. If anyone knows, which windows functions PEAK System uses to obtain the current timestamp to put into the Canbusframes, this would be great. I would like to obtain the "ms since system start" the same way, PEAK does. I hope to get rid of this sterange offset by that.
  • slot is called increasingly in a local function

    Unsolved
    5
    0 Votes
    5 Posts
    309 Views
    Q
    @J-Hilk thank you
  • How to show a Dialog from loop - wait - return to caller

    Solved
    9
    0 Votes
    9 Posts
    517 Views
    ademmlerA
    @JonB You are right - I use mColorList->exec() now! But I took the chance, which @Pl45m4PI gave me, to check the syntax of the connect statement also.
  • The problem of mouse event penetration

    Unsolved
    2
    0 Votes
    2 Posts
    157 Views
    JonBJ
    @ZeusFa void QGraphicsItem::setAcceptedMouseButtons(Qt::MouseButtons buttons): To disable mouse events for an item (i.e., make it transparent for mouse events), call setAcceptedMouseButtons(Qt::NoButton).
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    28 Views
    No one has replied
  • QObject-derived class address

    Solved
    5
    0 Votes
    5 Posts
    466 Views
    J
    @ChrisW67 That's exactly what I'm using the QObject address for. It's only to allocate parameters to that given object during the logging process, the longevity of the address is not a concern, I'm literally using it as unique uint64_t ID.
  • Why does it show me this warning?

    Unsolved
    4
    0 Votes
    4 Posts
    276 Views
    J.HilkJ
    @Lincoln you're supposed to use this arg overload https://doc.qt.io/qt-6/qstring.html#arg-14 which is one call, currently you're calling arg(arg) and on the temporary you call again arg(arg) with the 2nd argument ui->lblState->setText(QString("<span style='color:%1;'>" "<strong>User: %2" "</strong></span>").arg(color, userName)); Assuming color and userName are QStrings or implicitly converted. Also use QStringLiteral here instead of QString, its "cleaner"
  • 0 Votes
    2 Posts
    197 Views
    Christian EhrlicherC
    @Tater said in QTreeview DecorationRole changes on click but only after the mouse moves out of the row. Why?: Why does it wait for the mouse to be out of the row/column? How can I fix this? Because you most likley doing something wrong (e.g. do not tell the view that something changed) but as you don't show code we can't say anything.
  • I want to find the more suitable solution for drawing a timeline than qml canvas

    Unsolved
    1
    0 Votes
    1 Posts
    235 Views
    No one has replied
  • (not a) bug in QDate::weekNbr()?

    Solved
    3
    0 Votes
    3 Posts
    311 Views
    mzimmersM
    @Christian-Ehrlicher ah, yes. So, I guess I'll need to modify my routine to accept a start-of-week argument. Of course, this means I'll have to refine my calendar display as well. Thanks for pointing this out.
  • 0 Votes
    3 Posts
    1k Views
    J
    @Jammin44fm May I ask how you were able to port from QtScript to QuickJS? Are you still able to expose complete control of your application via scripting?
  • 0 Votes
    3 Posts
    2k Views
    timob256T
    @timob256 Perhaps it was necessary to connect #include <QtNetwork> previously, the header was without #include <QtNetwork> now it looks like this #include <QMainWindow> #include "qcustomplot.h" #include <QtNetwork> #include <QHostInfo> #include <QNetworkInterface> #include <QUdpSocket> #include <QAbstractSocket> #include <QHostAddress> #include <QTime> #include <QTimer> #include <QVector> #include <QtMath> However, he does not transmit much data yet ж_ж
  • QTreeWidget

    Solved
    2
    0 Votes
    2 Posts
    179 Views
    D
    @dan1973 Hai, ui->treeWidget->setSelectionMode(QAbstractItemView::MultiSelection); was the solution.:)
  • Print available modules with all versions.

    Unsolved
    1
    0 Votes
    1 Posts
    125 Views
    No one has replied
  • How to get the target window of QTouchEvent

    Solved
    12
    0 Votes
    12 Posts
    767 Views
    W
    I found QMutableEventPoint::window(const QEventPoint &) can solve my problem.
  • How to deal with "&" for shortcuts in translatable strings?

    Unsolved
    7
    0 Votes
    7 Posts
    423 Views
    B
    Thanks for your feedback. I think I will add this men labels with & in it to the translation glossary (using Weblate) and add comments to it for the translators. Not all of them know what an & does.
  • Window top edge, unable to control it

    Unsolved
    4
    0 Votes
    4 Posts
    454 Views
    Xena_oX
    there probably a solution on this code however this code works only with Qt5 so it needs to be adjusted for Qt6. Also its kinda gas station for such simple thing. if i can avoid to do this all, that would great.