Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • Simple FIleManager in Qt

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    A
    @Pradeep-Reddy This is what I need .. good information. Thanks
  • Resizing font size in QLCDNumber

    Unsolved
    13
    0 Votes
    13 Posts
    11k Views
    S
    @mrjj said in Resizing font size in QLCDNumber: I need to convert your codes to python and look into it as I'm not familiar with writing custom paint code.(any good learning material(s)?) What is the goal / acceptable solution? Something like the image if it could be less ugly ? Yes, my goal is 'less ugly'. Actually, I'm building a very complex application, which consists of multiple applications on ONE main widget. I want to have them the same look&operational feel including resizing(eg.stretching). SO,,, it looks like custom resizeEvent as well as paint would be necessary.. Sat
  • Finding GUI Event-Handling Crashes

    Unsolved crash
    21
    0 Votes
    21 Posts
    9k Views
    J
    Final update on this...unless I learn more about why my changes worked and believe it could help others... Today I deployed a (seemingly) fixed version after almost two months' testing. I made many changes including most of those @SGaist had suggested -- thanks for the super helpful feedback and suggestions! This was a difficult bug to fix. The program is a really, really large in-house application used by hundreds of people every day. Some of the source files were written in the late 90's and are still used today; it uses MFC; it uses the QMfcApp class; it uses Qt; it uses Boost; and I'm skeptical of the smooth integration of these frameworks into a cohesive unit. In fact, I'm not sure QMfcApp was intended to be a long-term solution...it looks more like a bridge for moving from MFC to Qt... At any rate, I made several changes that led to a fix. First, I moved the vector into the Model rather than injecting a pointer to a vector anchored in the dialog as the original author had done. I also disable UI controls while the data is acquired, then disable updates ( setUpdatesEnabled(false) ) to the TableView and TableModel while major changes are made, remove events (removePostedEvents(Table, 0) & removePostedEvents(Model, 0)) before clearing the vector, and I changed the app from emitting a restart-event after N items are processed and then exited knowing that when the restart bubbles off the queue it can pickup where it left off, to simply processing every item and issuing a qApp->processEvents() periodically to keep the UI responsive. I created a state variable to control when the app is busy or idle. I don't know if all of this is in line with the standard Qt rules of engagement, particularly disabling controls and flushing their event queues, but it has been working after hours and hours of testing. Before I disabled updates and removed enqueued pending update events, I would get intermittent update events for stale data. I thought the documentation said if you emptied your Model's container between a beginModelReset() and endModelReset() the framework would recognize that data requests were stale and would purge them. Either I misunderstood how this works, failed some other necessary step, or there's just a bug in Qt or our code or the commingling of both that allowed UI updates after the table was emptied. If something illuminating happens that provides greater understanding as to why these changes "fixed" the crashes, I'll come back here and update this thread. But I do want to say thanks to @SGaist for your input and suggestions. It helped a lot. john
  • 0 Votes
    8 Posts
    2k Views
    SGaistS
    In that case you should first ensure that you have a good architecture for your client/server. Then it will be easier to get thing running.
  • Can’t find the example of Vulkan in Welcome->Example

    Unsolved
    3
    0 Votes
    3 Posts
    753 Views
    SGaistS
    Hi, From a quick search, it looks like it's under Qt/Examples/Qt-5.10.0/vulkan/hellovulkanwindow/
  • 1 Votes
    6 Posts
    1k Views
    mrjjM
    @kmatheussen Good work finding it in such large program :)
  • How to use QMouseEventTransition with QGraphicsScene?

    Unsolved
    2
    0 Votes
    2 Posts
    552 Views
    SGaistS
    Hi, QGraphicsSceneMouseEvent is not a QMouseEvent but a QGraphicsSceneEvent thus the behaviour you have currently. One alternative could be to subclass QGraphicsScene and emit a custom signal from the QGraphicsScene::mousePressEvent and use a QSignalTransition. If you don't want to subclass, then you can use an event filter and again emit a custom signal. Hope it helps
  • QNetworkAccessManager better way of using it

    Unsolved
    2
    0 Votes
    2 Posts
    728 Views
    mrjjM
    Hi The reason for the slots is that QNetworkAccessManager is asyncon. So it will not wait/stay at the line until something received but "call you back" instead However since you can now use lambdas you can keep it very local (demo code, not complete) QNetworkRequest request = QNetworkRequest(QUrl(xxxxx)); QNetworkReply* reply = m_manager->get(request); connect(reply, &QNetworkReply::finished, [this, reply]() // <-- lamda as slot { qDebug() << sender(); qDebug() << reply->errorString(); qDebug() << reply->readAll(); reply->deleteLater(); });
  • From JavaScript async operations to C++/Qt

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    Y
    Thank you guys a lot for that, I'll be studying in order to see what is better for me.
  • Stylesheets control Layout objects?

    6
    0 Votes
    6 Posts
    14k Views
    mrjjM
    @JonB Hi Nope. Sadly. https://bugreports.qt.io/browse/QTBUG-22862 And as far as i know, Layouts are not really into stylesheets at all. https://forum.qt.io/topic/32043/qlayout-margin-through-stylesheet-solved/
  • QtWebKit

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    mrjjM
    @devs4p Since you show nothing besides installing it, how am i to know what you actually are doing ? Since you are compiling it yourself, i assume none of the pre-existing can be used ? https://forum.qt.io/topic/76739/webkit-status-2017
  • QLCDnumber, slots, and my own complete loss of mental function...

    Unsolved
    29
    0 Votes
    29 Posts
    7k Views
    mrjjM
    Hi i think it says your RelayController::SetLCD is PROTECTED and not public. Since you are in another class, you cant use a protected member. Ok. we nail it in 2018 ;)
  • What is the Qt equivalent for AutoEllipsis on a QLabel?

    Solved
    3
    1 Votes
    3 Posts
    5k Views
    aha_1980A
    @bs55: as @dheerendra said, there is an example: http://doc.qt.io/qt-5/qtwidgets-widgets-elidedlabel-example.html
  • 0 Votes
    4 Posts
    1k Views
    T
    (1)case 1: the root "NSView" of window's property "wantsLayer" is "YES", then The size and layout of all widget of window are correct, but the content drawn in window is scaled when drag the window from one moitor to another. mark: when apply “NSWindowStyleMaskFullSizeContentView” style in Mac OS, the root "NSView" of window's property "wantsLayer" will be auto set to "YES". (2)case 2: the root "NSView" of window's property "wantsLayer" is "NO", then if WebEngineView's content size is equal to window's content size, the WebEngineView will cover the corner of window, and affect the effect of the corner. so, WebEngineView will cause different problem in different window style, but there is no way to resolve them.
  • QMutex: destroying locked mutex What the ***?

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    JonBJ
    @Kofr I you place breakpoint at line #205 of ~QMutex() you can see which of your mutexes is the culprit, which may help you.
  • QXcbConnection couldnt connect to display

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    mrjjM
    @devs4p Ok thx for reporting back. happy holidays
  • background thread before main loop starts

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    U
    @mrjj class Worker : public QObject { Q_OBJECT public: explicit Worker(int param= 300) : m_param(param) { emit initialized(); } void start(HANDLE *handle) const { // call the funcion periodically } signals: void initialized() const; private: int m_param; }; auto pBgThread = new QThread; pBgThread->setPriority(QThread::LowPriority); Worker o; o.moveToThread(pBgThread); QObject::connect(pBgThread, SIGNAL(finished()), &o, SLOT(deleteLater())); QObject::connect(pBgThread, SIGNAL(finished()), pBgThread, SLOT(deleteLater())); o.start(handle); pBgThread->start();
  • QDesktopServices::openUrl issue

    Unsolved
    5
    0 Votes
    5 Posts
    917 Views
    mrjjM
    hi Works fine in linux mint [image: r1tTgR.png] What types of file are u searching for and what app are expected to open. if i click on a not bound .EXT then it says nothing. Where does it say "The location is not a folder" ?
  • Deploying QT network application

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    M
    Thanks for your valuable suggestions. Thanks jsulm.
  • QImage won't load a jpg that it saved

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    mrjjM
    @j_omega Well at least to 32 bit. If possible i will try vs 20015 32 bit Its hard to imagine if mingw would produce wrong code (its pretty mature). its more likely something with QImage and 32 bit and massive tiff file. Update: with vs 2015 32-bit it dies with [image: sbSIfv.png]