Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • How to check server life using QWebsocket ping pong.

    Solved
    20
    0 Votes
    20 Posts
    5k Views
    aha_1980A
    @bd9a A short google for "lambda capture member variables" gave the following result: https://stackoverflow.com/questions/7895879/using-member-variable-in-lambda-capture-list-inside-a-member-function In short, you need to capture [this]: QTimer::singleShot(5000, this, [this]() { Regards
  • Accessing application classes from a plugin?

    Unsolved
    3
    0 Votes
    3 Posts
    224 Views
    SGaistS
    Hi, Move all the classes that you want to be able to use in both your application and plugin in a shared library and link your plugins as well as your application against said library.
  • How do I update button when a string is printed?

    Unsolved
    2
    0 Votes
    2 Posts
    146 Views
    Gojir4G
    @sdf1444 Hi, print("Hello World! Im a laser") self.Button.setText("On")
  • qDebug output the message from point to QString::toLocal8Bit().data();

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    aha_1980A
    @jonb said in qDebug output the message from point to QString::toLocal8Bit().data();: It is not the answer to what I am interested in, which is how the value at a given memory location gets changed between two consecutive statements which read it. My question is what changes it between these two lines (simply because I am interested). And that's what I liked to point out: we are talking about accessing invalid memory. You simply cannot do that.
  • Clip part of the viewport in place

    Unsolved
    1
    0 Votes
    1 Posts
    168 Views
    No one has replied
  • QT 5.13 on OS X 10.12 -- spinning ball of death

    Unsolved
    3
    0 Votes
    3 Posts
    271 Views
    G
    @mrjj Thanks for your help. I followed your lead -- the qt examples were fine as were the qcustomplot examples. However, I finally traced the issue to the settings of the pixel buffer ratio. One line of code resolved all the problems ui->plot->setBufferDevicePixelRatio(1.0); It seems the default (2.0) causes drawing large graphs to go very very slowly. Geoffrey
  • 0 Votes
    4 Posts
    3k Views
    S
    Ok so I managed to import the html by modeling my code similar to the example with: QString code = QStringLiteral("qt.jQuery('#first_page').load('html/first_page.html');"); //you can even nest it with: QString code = QStringLiteral( "qt.jQuery('#first_page').load('html/first_page.html', ()=>{" "qt.jQuery('#border_content').load('html/border_content.html', ()=>{" //some other html "qt.jQuery('#last_page').load('html/last_page.html');" "});" "});" ); unfortunately I now cannot use the qwebchannel.js script anymore and my css gets screwed :( even loading it with: QFile script_file(":/qtwebchannel/qwebchannel.js"); if(!script_file.open(QIODevice::ReadOnly)) qDebug()<<"Couldn't load Qt's QWebChannel API!"; QString qt_script = QString::fromLatin1(script_file.readAll()); script_file.close(); view->page()->runJavaScript(qt_script); did not help. Since it is a small project and I am on a short deadline right now I will put everything in one html file and mark this question als solved.
  • Retrieve files in a project

    Solved
    2
    0 Votes
    2 Posts
    135 Views
    sierdzioS
    git revert or git reset --hard. If you are not using a version control system - well you've just learned an important lesson why it's a good idea to use such a system ;-) You can try ctrl+z but I doubt it will work.
  • Fortune client/server example details

    Unsolved
    12
    0 Votes
    12 Posts
    876 Views
    tomyT
    @j-hilk Thanks for the answer. Let's get it straight! It's main.cpp where all Qt Widget/Quick projects start from when we hit Run. #include <QApplication> #include "client.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); QApplication::setApplicationDisplayName(Client::tr("Fortune Client")); Client client; client.show(); return app.exec(); } The first lines are creating a QApplication object with two arguments, then setting the window's display name. We then instantiate our class called Client. So these stages plus object's creation are carried out (as compile time stage supposedly) until control reaches show() - showing the project's UI -, and app.exec - starting executing the project (run-time stage). From this point, Qt event loop begins. Now what are the cycles of it? How is the event loop divided into a number of cycles?
  • Worker/Controller multi-threading and interface class

    Unsolved
    4
    0 Votes
    4 Posts
    325 Views
    F
    @kent-dorfman I tried. The lambda is not executed.
  • BindValue() in QPSQL is not working?

    Solved qsqlquery postgresql sqldriver sql
    13
    0 Votes
    13 Posts
    4k Views
    Christian EhrlicherC
    @bartoszpaj said in BindValue() in QPSQL is not working?: driver()->hasFeature(QSqlDriver::NamedPlaceholders) returns false. Good catch. I think it's because support for PostgreSQL 10 was added in a later version. If the version is not known to the driver it will fall back to the oldest.
  • QSqlQuery for ms access database

    Solved
    24
    0 Votes
    24 Posts
    4k Views
    behruz montazeriB
    @ronaldviscarral Thank you very much it works now.
  • QPrinter problem in Qt-5.13.0 with Xcode 10.3

    Solved
    4
    0 Votes
    4 Posts
    528 Views
    S
    Ah ha! Solved. I was using the wrong version of qmake to build the project. All sorted now.
  • Read JSON WITHOUT readAll()

    Solved
    2
    0 Votes
    2 Posts
    355 Views
    Kent-DorfmanK
    doubtful...the json is a document format. so, to be parsed correctly it needs to be cached somewhere. The readall() pulls the whole document into memory so that it can be parsed.
  • Custom Input: QLineEdit

    Solved
    3
    0 Votes
    3 Posts
    392 Views
    F
    @sgaist that's right! Thank you! QLineEdit *myLineEdit = new QLineEdit(this); QAction *myAction = myLineEdit->addAction(QIcon("test.png"), QLineEdit::TrailingPosition); connect(myAction, &QAction::triggered, this, &MyClass::onActionTriggered);
  • Using QPainterPath to generate more complex "images"

    Unsolved
    9
    0 Votes
    9 Posts
    757 Views
    M
    If I'm looking at the doc, I see: Header: #include <QGraphicsSvgItem> qmake: QT += svg Have you add this to your pro file ?
  • can i use lib from qt 5.11 with qt 5.3 ?

    Unsolved
    4
    0 Votes
    4 Posts
    307 Views
    A
    @christian-ehrlicher That's what I feared . so , thanks, i will manage with this.
  • 0 Votes
    3 Posts
    454 Views
    Gojir4G
    @sonichy said in How to recognize QNetWorkReply.Error() form QNetWorkManager.get() or QNetWorkManager.put(): QNetworkAccessManager manager; Just for clarify, is your instance of QNetworkAccessManager still alive at the time your slots are called ? Because as you are declaring it on the stack, it may be already destroyed and I presume it will also destroy internal QNetworkReply objects.
  • plasmoids disappear

    Unsolved
    7
    0 Votes
    7 Posts
    502 Views
    SGaistS
    Where did you open that thread ?
  • Threads in PyQt and opencv

    Unsolved
    3
    0 Votes
    3 Posts
    580 Views
    Pablo J. RoginaP
    @iammhz said in Threads in PyQt and opencv: when i click other buttons , they can't access the Webcam What if you just have only one method/thread to access the webcam, independent on which button is actually pressed, and when the image is captured then pass that image to the specific processing method/thread depending on the button/effect pressed. This way you'll avoid the bottleneck of "sharing" the webcam among threads