Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Embed QDialog as QWidget

    Solved
    6
    0 Votes
    6 Posts
    689 Views
    jsulmJ
    @Andy314 said in Embed QDialog as QWidget: For my project its a little more compilcated, because my dialogs have not the QDialog as direct parent They don't have to. You can put any QWidget into a QDialog. QDialog is a QWidget, so you can add layouts and widgets to it.
  • cannot get QDataStream::setVersion to work

    Unsolved
    3
    0 Votes
    3 Posts
    343 Views
    JonBJ
    @Poldi I'm not sure I understand either. I expected it to write a version number to the stream, which you would check at reader side. I think @Christian-Ehrlicher is saying that is not how QDataStream::setVersion() works, it does not actually write anything into the stream, so it's an in-memory thing only, affecting what code is executed. Have you read https://doc.qt.io/qt-6/qdatastream.html#versioning? If I understand right, the example code there shows how you can/should introduce your own, arbitrary field in the stream which the reader can use to recognise the writer's version for this purpose.
  • 3 Votes
    2 Posts
    459 Views
    JKSHJ
    Hi @nicolobracchi40, and welcome! This looks like a bug. See https://bugreports.qt.io/browse/QTBUG-104478
  • backgournd color only takes effect on items

    Unsolved
    5
    0 Votes
    5 Posts
    417 Views
    Christian EhrlicherC
    @m-f-d said in backgournd color only takes effect on items: but only for items, branch icons are still white background. Ignoring me helps for sure...
  • Text height of QTextEdit is 1 pixel?

    Unsolved
    2
    0 Votes
    2 Posts
    177 Views
    SGaistS
    Hi, With only that line it's impossible to say. Please provide a complete minimal compilable example that shows this behavior.
  • QTableWidget: scrolling causes data loss

    Unsolved
    7
    0 Votes
    7 Posts
    417 Views
    C
    @JonB I'm using the QTableWidgetItems that are automatically created by the table. OK just now I tried switching back to using setCellWidget and that seems to work just fine (in Qt 5). I also needed to respond to scrolling by saving the text that was entered. I had to keep a QString containing that and update it with every keystroke. Thanks.
  • What are the post-processing operations after I manually delete QObject

    Unsolved
    11
    0 Votes
    11 Posts
    675 Views
    Christian EhrlicherC
    @keeplearning said in What are the post-processing operations after I manually delete QObject: So I wonder what was done after validator was deleted, so that lineEdit could know validator was deleted. Since those are all QObjects it's easy - the other classes simply connect to QObject::destroyed(). But tbh it really depends on what you want to do with that items. Do you even need to store them as pointer?
  • Segment Fault In Deploy For Q3DScatter [Windows]

    Unsolved
    5
    0 Votes
    5 Posts
    333 Views
    L
    [image: d713d454-2783-42d6-8c76-d1a29adbbebe.png] I dont know what trace stack you need, I guess it is these. ==================================== Its source is about 40kb. Actually is not new code. It is a project copy code from doc.qt.io, as follow: #include <QtGraphs> int main(int argc, char **argv) { QApplication app(argc, argv); Q3DScatter scatter; scatter.setMinimumSize(QSize(256, 256)); scatter.setResizeMode(QQuickWidget::SizeRootObjectToView); QScatter3DSeries *series = new QScatter3DSeries; QScatterDataArray data; data << QVector3D(0.5f, 0.5f, 0.5f) << QVector3D(-0.3f, -0.5f, -0.4f) << QVector3D(0.0f, -0.3f, 0.2f); series->dataProxy()->addItems(data); scatter.addSeries(series); scatter.show(); return app.exec(); } The point is that is raising segment fault after run "windeployqt6.exe" for it Thanks!
  • how to build project using command line

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    SGaistS
    @SimonSchroeder While it allows to dictate where to store build artifacts, it does not solve the issue at hand which is in source builds. The real solution here is to do what I wrote: Create a build folder outside of the sources (which is what Qt Creator does by default) trigger the project manager from that folder build There's really nothing more to it than that.
  • Chaining async calls with QFuture

    Unsolved
    4
    0 Votes
    4 Posts
    627 Views
    H
    @Pl45m4 Yes, I updated it to make it clearer what I exactly mean.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • qcustomplot

    Unsolved
    4
    0 Votes
    4 Posts
    401 Views
    Pl45m4P
    @Saee1101 said in qcustomplot: I want line 3 to be place in the middle of line 3.01 and line 2.5 What kind of axis should that represent?! I'm currently not using QCustomPlot but you have to work on your y-axis for that... I dont know if creating such an axis is possible since it's not linear anymore... and I dont even ask why you want to do this. The distance from 3 to 3.01 is +0.1 and to the lower line -0.5... How can this be in the middle?! You can draw a line there any time, but not with a value of 3 on a linear scale... QCustomPlot only provides two options: Linear and Logarithmic scale. https://www.qcustomplot.com/documentation/classQCPAxis.html#a36d8e8658dbaa179bf2aeb973db2d6f0 Edit: Are you trying to plot a sine wave by any chance?! And these are your two upper and lower bounds and you want the 0-base line in the middle between 3.01 and 2.5?
  • Using QVariant to store custom types in Qt6.5.1

    Solved qvariant
    4
    0 Votes
    4 Posts
    2k Views
    Pl45m4P
    @szmf It might work when on the same thread (also you should register it anyway) but as soon as you have QueuedConnections this will probably fail without registering the type globally. https://doc.qt.io/qt-6/custom-types.html#overview The part here even says, that declaring is necessary for direct signal and slot connections: The Message class only needs a suitable implementation in order to be usable. However, Qt's type system will not be able to understand how to store, retrieve and serialize instances of this class without some assistance. For example, we will be unable to store Message values in QVariant. The class in Qt responsible for custom types is QMetaType. To make the type known to this class, we invoke the Q_DECLARE_METATYPE() macro on the class in the header file where it is defined: Q_DECLARE_METATYPE(Message); This now makes it possible for Message values to be stored in QVariant objects and retrieved later. See the Custom Type Example for code that demonstrates this. The Q_DECLARE_METATYPE() macro also makes it possible for these values to be used as arguments to signals, but only in direct signal-slot connections. To make the custom type generally usable with the signals and slots mechanism, we need to perform some extra work. As stated reading further here: Although the declaration in the previous section makes the type available for use in direct signal-slot connections, it cannot be used for queued signal-slot connections, such as those that are made between objects in different threads. This is because the meta-object system does not know how to handle creation and destruction of objects of the custom type at run-time. To enable creation of objects at run-time, call the qRegisterMetaType() template function to register it with the meta-object system. This also makes the type available for queued signal-slot communication as long as you call it before you make the first connection that uses the type.
  • download url with redirection

    Unsolved
    20
    0 Votes
    20 Posts
    1k Views
    S
    I also added : request.setRawHeader("User-Agent", "curl/7.54.1"); but this time. my test utility returned: QNetworkReply::InsecureRedirectError
  • Error when compling Qt 5.15.2

    Solved
    2
    0 Votes
    2 Posts
    260 Views
    kkoehneK
    @Palli , what happens is that qmake runs a command like cmd /c mimetypes\mime\generate.bat mimetypes/mime/packages/freedesktop.org.xml > qmimeprovider_database.cpp generate.bat, in turn, relies on powershell: :: No Compression and no Perl :: Just hex-dump with Powershell powershell -ExecutionPolicy Bypass %me%hexdump.ps1 %1 %1 exit /b %errorlevel% So yeah, if you have a setup where above powershell call will result in additional output, this will break the build. Is it a bug? Maybe, but it's unlikely that this still will be changed, as the code got rewritten in Qt 6.
  • QTableView add row via QLineEdit in last row

    Unsolved
    2
    0 Votes
    2 Posts
    254 Views
    JonBJ
    @just-ero QTableView on editing last row add new line In Qt, create a table with an blank editable row
  • 0 Votes
    3 Posts
    556 Views
    S
    @Anatoliy said in [qt.qpa.plugin] Could not find the Qt platform plugin "cocoa" in "" error after add CODE_SIGN_ENTITLEMENTS to the project: <key>com.apple.security.app-sandbox</key> <true/> looks like problem in this, if set to "false" then no errors
  • This topic is deleted!

    Unsolved
    5
    0 Votes
    5 Posts
    35 Views
  • Tooltips not showing after combo box content is updated dynamically

    Solved
    5
    0 Votes
    5 Posts
    426 Views
    R
    UPDATE 4: If I build with Qt 5.15.5 and run the app with the Xorg platform, the bug does not happen. It must be Wayland related, since previously I had been using the Ubuntu default desktop (which is Wayland). I am marking this as SOLVED for now, but I will probably file a bug report.