Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Can we make post request using QNetworkAccessManager in secondary thread?

    Solved
    2
    0 Votes
    2 Posts
    549 Views
    mrjjM
    hi 1) Yes, you can use the worker approach https://wiki.qt.io/QThreads_general_usage and run the QNetworkAccessManager there as far as i know it should work fine. 2) You can run 6 concurrent requests and handle that in an asynchronous manner. Using lambdas you can make the code very compact and local but its not blocking as that is not supported. There is a way to do it QNetworkAccessManager qnam; QNetworkReply *reply = qnam.get(QNetworkRequest(QUrl(…))); QEventLoop loop; QObject::connect(reply, SIGNAL (finished()), &loop, SLOT (quit())); loop.exec(); But using QEventLoop all over the application is the road to odd side effects and not really recommended. So why must it be blocking ? Cant you just use the normal api and simply handle the requests when they come in ? Do you need more than 6 requests at the same time ? I have not seen any access to that info but check out the code and see if you are lucky :) https://code.woboq.org/qt5/qtbase/src/network/access/qnetworkaccessmanager.cpp.html
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • Multicast UDP Ethernet

    Unsolved
    6
    0 Votes
    6 Posts
    656 Views
    Pablo J. RoginaP
    @jessiffmm ok, so is it a network configuration issue? BTW you didn't state the OS you're using, please describe both senders and receiver environments. Just in case you may want to check multicast really works in your network by checking this StackOverflow answer (see the Python script...)
  • Qt GUI application + Terminal debug

    Solved
    2
    1 Votes
    2 Posts
    362 Views
    Pablo J. RoginaP
    @fem_dev you may want to check documentation about debugging techniques The Qt implementation of these macros prints to the stderr output under Unix/X11 and macOS. With Windows, if it is a console application, the text is sent to console; otherwise, it is sent to the debugger. Please remember that you can also install your own message handler using qInstallMessageHandler()
  • QXmlQuery Please instantiate the QApplication object first in static library

    Solved
    4
    0 Votes
    4 Posts
    494 Views
    D
    Thank you. This is must be a result that I'm running this from a unit test and QCoreApplication isn't instantiated in the QTest framework. From what has been written, I'm comfortable that the error will go away when run from the actual appliction. Thank you.
  • Shortcut to QAction not being triggered

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    J.HilkJ
    @qwasder85 said in Shortcut to QAction not being triggered: Ah, you know what. Of course, it doesn't work. I added the QAction to the context menu, which isn't receiving my keyboard input. I have to add it to the QTableView as well. Sometimes it helps to just talk about an issue. It's called Rubber Duck Debugging [image: attachment_28409872] Don't forget to set the topic to solved :)
  • Example of Screen Refreshing with Widget

    6
    0 Votes
    6 Posts
    640 Views
    jsulmJ
    @Kira I'm not sure how QScreen is related to what you asked originally?
  • QAxObjects issue with Office 365?

    Unsolved
    4
    0 Votes
    4 Posts
    473 Views
    JonBJ
    @Pauly I don't know, but I guess it does point more towards a Qt issue than VBA. It does look a bit like that pVBComponent is going walkies, somehow. As for difference between 365 vs 2016, who knows, the code/requirements may be different. Dunno, try copying your setting of pVBProject & pVBComponent to inside the loop each time round. Yes, you shouldn't have to do that, but does it make any difference? Maybe do some debugging to see which precise variable it is that "goes walkies", though not sure what you're going to do with information. You're look for a "workaround" which simply works for you.
  • How to set current index in QCombobox by the value of it's model column

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    VRoninV
    Can you use QSqlRelationalTableModel instead?
  • How to comment out block of lines in project file ?

    Solved
    5
    0 Votes
    5 Posts
    4k Views
    jsulmJ
    @JonB @AnneRanch Yes, this is possible: Ctrl+/ , or Edit/Advanced/Toggle Comment Section Works for me even when editing pro files.
  • QTime more than 24 hours

    Unsolved
    12
    0 Votes
    12 Posts
    3k Views
    JKSHJ
    @Mr_Steve Your date looks like it contains corrupted or uninitialized data. Debug your program at the point where you create the QDateTime objects.
  • QInputDialog::getText, maxLenght String?

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    A
    Après d'autre réponse, j'ai trouvé une solution qui fonction bien: void { QInputDialog *dialog = new QInputDialog(this); dialog->setInputMode(QInputDialog::TextInput); dialog->setWindowTitle("Rename Bank"); dialog->setLabelText(""); dialog->setTextValue(nameBank[index]); QLineEdit *lineEdit = dialog->findChild<QLineEdit *>(); lineEdit->setMaxLength(16); if (dialog->exec() == QDialog::Accepted) { nameBank[index] = dialog->textValue(); listeDeroulanteBank->setItemText(index,nameBank[index]); } else { // Saisie annulée } } Merci pour vos réponses rapide! Cordialement, Antoine
  • qmake: Statically link AppCenter framework to Xcode target

    Unsolved
    2
    0 Votes
    2 Posts
    182 Views
    P
    Wow, the following fixed it, if "Vendor" is the dir within the same dir as the .xcodeproj: LIBS += -FVendor -framework AppCenter -framework AppCenterAnalytics -framework AppCenterCrashes I guess I wasn't familiar with static frameworks.
  • use of deleted function 'Node::Node(const Node&)'

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    mrjjM
    @fT3g0 :) we all know such situations.
  • Upgraded Qt5.4.1 to 5.12.1, and now QCodec gives an exception

    Unsolved
    3
    0 Votes
    3 Posts
    281 Views
    SGaistS
    Hi and welcome to devnet, You can check the codec available with QTextCodec::availableCodecs. Note that it's always a good idea to check the returned pointer when dealing with that kind of methods.
  • How to access values in QVector from other cpp files

    Unsolved
    3
    0 Votes
    3 Posts
    381 Views
    SGaistS
    Hi, Based on your description, I would recommend going the model view way. That will allow you to have a cleaner structure and way to share your data.
  • Compiling OCI driver

    Unsolved
    9
    0 Votes
    9 Posts
    3k Views
    E
    Did anybody solve the issue? @SGaist What do you advice? @Zipazar Did you solve the problem? Can you help me?
  • mysql library, not a Qt plugin

    Unsolved
    6
    0 Votes
    6 Posts
    403 Views
    SGaistS
    Start your application with the QT_DEBUG_PLUGINS environment variable set to 1. It might give you more clues about what is happening.
  • QGraphicsView - move item by non linear value...

    Unsolved qgraphicsview move
    3
    0 Votes
    3 Posts
    595 Views
    D
    @SGaist Its about precision moves, if user wants to move by tiny bit, scaling mouse movement by x value would allow that to happen. Else he would have to type 0.0001 0.0002 0.0003 etc etc. I think I could handle it using itemChange() and record initial mouse click press/release and calculate delta using that.. Yep that seem to do the trick... I can now move my items by tiny amount and doing "Long precise drags" deltaX = (newPos.x() - self.mMousePressPosition.x()) / 2 newPos.setX(newPos.x() - deltaX) deltaY = (newPos.y() - self.mMousePressPosition.y()) / 2 newPos.setY(newPos.y() - deltaY) Small edit, function above works for "simple" items, but as soon as I get to child items with parent it appear to break... sigh. Needs some more math there
  • QSqlQuery weird error

    Unsolved
    3
    0 Votes
    3 Posts
    322 Views
    krzysieklfcK
    Thanks for reply. I managed to solve this problem with the following: auto prepare_string = QString{ "DELETE FROM %1" }.arg(table); auto ok = q.prepare(prepare_string); auto ok = q.exec();