Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • 0 Votes
    6 Posts
    977 Views
    NarutoblazeN
    @Pl45m4 @mpergand thanks for you time it worked perfectly for me
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Native QColorDialog, Issue

    Unsolved
    1
    0 Votes
    1 Posts
    372 Views
    No one has replied
  • Problem with QTranslator (by GNU gettext user)

    Unsolved
    2
    0 Votes
    2 Posts
    354 Views
    B
    X-Post at StackOverflow
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • Dock Settings.

    Solved
    3
    0 Votes
    3 Posts
    304 Views
    Z
    @SGaist very good memory
  • can not quit the child event loop!

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    J
    @jsulm Thank you so much, you helped me a lot! As you said, the slot to quit loop is called before loop.exec(), so there is never a chance to quit loop.
  • How to extract non {"key":"value"} JSON ?

    Solved json qjsondocument qjsonvalue qbytearray
    5
    0 Votes
    5 Posts
    728 Views
    Paul ColbyP
    HI @R-P-H , Besides converting the QByteArray to a QString, how would I extract the value if I added {} to the QByteArray ... As long as the QByteArray contains a valid JSON value, you can either wrap it in [ and ] to make it a JSON array, or { "key": and } to make it a JSON object. If wrapping in an array, you would then fetch the first array item to get the original JSON value. Of if wrapping in an object, fetch the value corresponding to the key you used in the wrapper. Here's a complete example: const QByteArray json{ "\"My Value\" "}; qDebug().noquote() << "input " << json; qDebug().noquote() << "parse-as-is " << QJsonDocument::fromJson(json); // Will fail. const QJsonDocument arrayDoc = QJsonDocument::fromJson("[" + json + "]"); qDebug().noquote() << "wrapped-in-array " << arrayDoc; qDebug().noquote() << "unwrapped-array " << arrayDoc.array().at(0); const QJsonDocument objectDoc = QJsonDocument::fromJson("{ \"value\": " + json + "}"); qDebug().noquote() << "wrapped-in-object " << objectDoc; qDebug().noquote() << "unwrapped-object " << objectDoc.object().value(QStringLiteral("value")); Which outputs: input "My Value" parse-as-is QJsonDocument() wrapped-in-array QJsonDocument(["My Value"]) unwrapped-array QJsonValue(string, My Value) wrapped-in-object QJsonDocument({"value":"My Value"}) unwrapped-object QJsonValue(string, My Value) Cheers.
  • How to go from animated intro to main menu

    Unsolved
    3
    0 Votes
    3 Posts
    222 Views
    Christian EhrlicherC
    @JonB said in How to go from animated intro to main menu: Did you delete that? Yes, it was deleted by him.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    10 Views
  • JWT - Post login request via JSON using Qt

    Solved json access token qnetwork api post
    6
    0 Votes
    6 Posts
    2k Views
    R
    After playing around using postman I found the issue. When sending a Bearer: "" or Bearer: "xxxxxx" token, the server returns "Authentication Required". But when sending no Bearer token or an empty Bearer: it works fine. So when logging in; no token must be supplied else it tries to authenticate against that token instead of correctly generating a new one provided you submitted valid credentials in the JSON body. Seems a bit odd to me, but ok.
  • 0 Votes
    5 Posts
    1k Views
    Seb TurS
    @Seb-Tur I found it ! In qtcretor when you hit a button to restore the default mainwidow size the section with geometry disappears and causes this bug. [image: 1bdaca87-be88-47bd-a79a-67d9d2964af9.png] When the geometry is specified (as below) all works fine. The misleading part is that when you restore mainwindow default size it automatically is filled with the total width/height coming from the internal widgets/layouts The workarond is to increase the Width and Height in the rows below at least by 1 pixel and the section is restored. ui content after restoring size to defaults <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="enabled"> <bool>true</bool> </property> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="windowTitle"> proper ui content: <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="enabled"> <bool>true</bool> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1711</width> <height>1111</height> </rect> </property> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property>
  • Get x y z coordinates form Q3dScatter graph on mouse click..

    Unsolved
    1
    0 Votes
    1 Posts
    210 Views
    No one has replied
  • How to design a beatiful filedialog object?

    Unsolved
    5
    0 Votes
    5 Posts
    482 Views
    JonBJ
    @nicker-player So how to choose the files and the paths at the same time I already said: @JonB said in How to design a beatiful filedialog object?: you cannot choose a file here, only a directory/folder @nicker-player said in How to design a beatiful filedialog object?: And the dialog looks normally and not ugly. You read what @jsulm wrote. Why do you not act on it rather than ignoring it?
  • vs2015 build qt source got error

    Unsolved
    3
    0 Votes
    3 Posts
    230 Views
    Z
    @jsulm OK, Thanks!
  • Why this program crashed?

    Solved
    5
    0 Votes
    5 Posts
    704 Views
    J
    @ChrisW67 Thank you.The problem was resolved after I used QApplication instead of QCoreApplication.
  • How to output Debug to Status Bar?

    Unsolved
    28
    0 Votes
    28 Posts
    4k Views
    M
    Great Pl45m4, it works. Thank you everyone for your input.
  • Qt CMake Project can not build

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    SGaistS
    @ZeusFa what is in Build Environment ?
  • Could not load the Qt platform plugin "xcb" in "" even though it was found.

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    @BasterCz hi, Which display manager are you using ? Are you sure you have an Xorg session and not Wayland ?
  • custom QLayout undeclared identifier 'margin()'

    Unsolved
    3
    0 Votes
    3 Posts
    339 Views
    SGaistS
    Hi, You are trying to use code that was done with an older version of Qt. The margin method was already obsoleted with Qt 5 and was removed with Qt 6. You should use contentsMargins.