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 change property value to my custom widget ?

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    JonBJ
    @giorgik63 said in How to change property value to my custom widget ?: It compiles just fine for me. Really? Let's look at QImageSvg::ledShape QLedNew::shape() const { return shape; } No type QImageSvg::ledShape has been defined. This defines a method in the QLedNew class. No such class has been declared. The method QImageSvg::shape(), declared in the header file for class QImageSvg, has not been defined anywhere. In its body there is no such variable as shape for the return statement. If this is really the code you have, with other stuff to make it compile, perhaps it has some relationship to your problem....
  • qmake not finding right mkspec

    Unsolved
    2
    0 Votes
    2 Posts
    546 Views
    sierdzioS
    @ocgltd said in qmake not finding right mkspec: Why is the spec folder not found? Have you run install target after compiling Qt?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • QPaintEvent ignore automatic clipping

    Unsolved qpaintevent
    3
    0 Votes
    3 Posts
    456 Views
    SGaistS
    Hi, Do you mean draw on a different widget ? If so, you can't. What you can do is use a larger widget so you have a larger surface to use.
  • 0 Votes
    11 Posts
    2k Views
    T
    I searched this a bit more. First of all the behavior might be depending on OS. (Noticed some differences on Unix vs Windows) Secondly, I created a timer that every 2 seconds prints out qApp->focusObject(). It looks like after a QEvent::ApplicationStateChange and a QEvent::WindowDeactivate that all the widgets receive afterwards, the qApp->focusObject() is always nullptr. And after nullptr Qt selects the widget on MainWindow that was the last widget to have focus, and gives focus there. So I feel that subwindows are ignored somehow... I am leaving this open for a bit, in case someone has a good solution to track if a subwindow had focus, it should regain it after application re activation.
  • MaintenanceTool free space problem

    Locked Unsolved
    3
    0 Votes
    3 Posts
    313 Views
    Christian EhrlicherC
    Dupe of https://forum.qt.io/topic/144850/
  • QTableView sections move problem

    Unsolved qtableview qtableview c++ qtablemodel qheaderview
    1
    0 Votes
    1 Posts
    365 Views
    No one has replied
  • 无法解析的外部符号 QChar

    Unsolved
    3
    0 Votes
    3 Posts
    342 Views
    SGaistS
    Using Google translate: 话题转移到相应的国际部分。其他子论坛请使用英语,因为它是论坛的官方语言。
  • Deploy Qt opencv how do it

    Unsolved
    20
    0 Votes
    20 Posts
    3k Views
    A
    @Abderrahmene_Rayene thank you so much, i am continue to try
  • Sync GUIs between network

    Unsolved
    7
    0 Votes
    7 Posts
    505 Views
    JonBJ
    @Abderrahmene_Rayene For just the data in editable widgets, this should be doable via some model and then that could potentially be synced I guess. That might be supported by your QtDataSync link, it mentions "Qt "model" class (QAbstractListModel) to view store data in item views".
  • How to create a barchart using QChartview

    Unsolved
    2
    0 Votes
    2 Posts
    283 Views
    JonBJ
    @LT-K101 I have never used QtCharts but take a look at how it's done in https://doc.qt.io/qt-6/qtcharts-barchart-example.html. You have one QBarSet with multiple items in it. That causes your "separate groups". You want multiple QBarSets (one for each printer) each with just one item/value (printer[1]) in it. That will "group" them together.
  • QTextEdit list marker style affected by block style

    Unsolved
    5
    0 Votes
    5 Posts
    356 Views
    JonBJ
    @clarify Well, originally you said the 1. took on whatever style of the text following it, now you talk about it failing to indent correctly. I was just trying to confirm that whatever style you say it takes --- and you don't say what that is or show the output so it's hard for someone else to judge --- was not somehow around the 1.. If I am not mistaken, this show two ordered lists, the first being alphabetical with just one item and the second being default (numerical?) with two items.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • No backend for low level audio found

    Unsolved
    1
    0 Votes
    1 Posts
    392 Views
    No one has replied
  • Blank camera output in qml

    Unsolved
    2
    0 Votes
    2 Posts
    215 Views
    W
    @wiadro this might have something to do with it? [image: ceb3e469-c0cd-401a-9e10-b65f8114855c.png]
  • operator[]:"index out of range"

    Unsolved
    19
    0 Votes
    19 Posts
    3k Views
    jeremy_kJ
    @JonB said in operator[]:"index out of range": @jeremy_k As @Christian-Ehrlicher writes. Passing a local/auto variable to a lambda as a reference is not in itself any problem. Loads of lambdas may be written which use this, e.g. (I haven't looked) perhaps some of the std:: container algorithms may use reference parameters. The potential problem arises when it is a slot for a signal, because that continues to use the lambda after the function which does the connect() exits. Then a reference parameter to a variable local to the function would indeed be a problem, as @Christian-Ehrlicher's code shows. However, in this particular case the OP is doing it from main(), so that will not be a problem here. Yes, I did understand. It appears to be my point that was misunderstood. The code, abbreviated, was: int main() { qreal val=0; QTimer timer1; QObject::connect(&timer1,&QTimer::timeout,[&] () { val = val + 10; }); timer1.start(100); } Given: Connections are broken when the object that emits the signal is destroyed. timer1 has the same automatic block scope as val. val is declared before timer1, and will therefore be destructed after it. There is no evidence of a move operation to alter the lifetime of timer1. We can determine that the reference to val does not dangle prior to timer1 being destroyed, breaking the connection. The situation would be the same in any function, or for any code block. main() does not alter the situation.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    15 Views
    No one has replied
  • Couldn't found ui_(project).h

    Solved
    3
    0 Votes
    3 Posts
    250 Views
    M
    @Chris-Kawa ㅆhanks i solved it. :) Thanks so much..
  • how to use qInstallMessageHandler to ignore specific debug messages?

    Solved
    4
    0 Votes
    4 Posts
    668 Views
    Chris KawaC
    @Ylvy You can't use qDebug inside the handler. That's recursive. qInstallMessageHandler returns a previous handler (or the default one if you didn't set any yet). If you want to just filter out everything but debug you can store the old handler and call it from yours, e.g. // put it somewhere accessible to your handler QtMessageHandler defaultHandler {}; // install new and get the old one defaultHandler = qInstallMessageHandler(myMessageHandler); and in your handler: void myMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) { if (type == QtDebugMsg) defaultHandler(type, context, message); }
  • CSS class selector not working with container widgets

    Unsolved css stackedwidget stylesheet
    4
    0 Votes
    4 Posts
    912 Views
    A
    @JonB Thats fine, at least I don't have to unpolish first. Although I still think there is a bug because you don't have to polish the QComboBox's ItemView when it is not inside a QTabWidget or QStackedWidget.