Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • undefined reference error in Qt Test project.

    Unsolved
    2
    0 Votes
    2 Posts
    177 Views
    Christian EhrlicherC
    So did you actually implement this ctor and include the source of it in your project?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • READ DATA FROM SPECIFIC UDP ""PORT""

    Unsolved
    3
    0 Votes
    3 Posts
    457 Views
    Kent-DorfmanK
    Try your original code with the address of 0.0.0.0 I believe you may need privilege to bind to a specific interface.
  • VPN integration

    Solved
    2
    0 Votes
    2 Posts
    180 Views
    JKSHJ
    @Ryna said in VPN integration: it gives me uncountable linking errors. You must tell your linker where to find the libraries. See https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
  • QGraphicsPathItem anti collision with other items

    Unsolved
    1
    1 Votes
    1 Posts
    112 Views
    No one has replied
  • 0 Votes
    4 Posts
    636 Views
    SGaistS
    Hi, There's currently no possible workaround with a single QDataWidgetMapper. The internal logic does not handle multiple "same source widget".
  • Error indexing a QGenericMatrix

    Solved
    12
    0 Votes
    12 Posts
    952 Views
    Pl45m4P
    @viniltc Why you need the inverse of the resulting quaternion in step 3? I've never done gravity compensation before, but I think it may works like suggested here: https://stackoverflow.com/questions/18252692/gravity-compensation-in-accelerometer-data https://stackoverflow.com/questions/12617200/remove-gravity-from-imu-accelerometer There are also some papers dealing with this topic. I would try to just subtract the gravity component (vector in Z - direction, let's say (0, 0, 9.81)) from your actual, accelerometer vector. Is the result vector after step 2 looking correct?
  • Get QDialog be its title (or name)

    Solved
    9
    0 Votes
    9 Posts
    807 Views
    mrjjM
    @Please_Help_me_D well even im so called experienced, it also took me a while to think in terms of signals and slot where i would normally have a pointer to "the other class" But it really is much better as the 2 classed dont even have to know each other and the slot will have direct access to the UI / widgets which outside pointer will not - so to send the data via a signal is good design in most cases. Also you can easily write a test object that you connect to instead and it can automatic send some test data. The ColorBarWidgetMain wont know the difference. So its a more decoupled Design which is good for maintenance and adding features as nothing breaks even if you change the dialog. it still just have to emit the signal and no other class needs to know about any internal changes.
  • Printing QTextDocument in different thread distorts image.

    Solved
    6
    0 Votes
    6 Posts
    523 Views
    A
    @gde23 said in Printing QTextDocument in different thread distorts image.: What I would try is something like this, but as I said its just a guess... void AbstractEcoForm::printDocument() { std::unique_ptr<QTextDocument> printDoc(new QTextDocument); std::unique_ptr<QPrinter> printer(new QPrinter); printDoc->setPageSize(QSizeF(printer->pageRect().size())); setDocumentData(printDoc.get()); printer->setPrinterName(mCurrentPrinter); QString numeDoc = QStringLiteral("Test-print"); printer->setDocName(numeDoc); QPrinterInfo printerInfo(*printer); if (printerInfo.isNull()) { emit printerError("Nu este setata nici o imprimanta!"); return; } if (!printer->isValid()) { emit printerError("Imprimanta setata nu este valida!"); return; } QTimer::SingleShot(10, this, SLOT(printTheDocument()); where printTheDocument() is a slot that calls the printDoc->print(printer.get()); of your original code And I'm back :D, seems while the code somehow works and the app doesn't crash I get the following warning: QObject: Cannot create children for a parent that is in a different thread. (Parent is QTextDocument(0x10f7a800), parent's thread is QThread(0x143b22b8), current thread is QThread(0x12e10d0) Edit:: I gave up on QtConcurrent and went with QueuedConnection connection. Thank you.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    48 Views
    No one has replied
  • Select whole row in QTableWidget when radio button is checked

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    P
    @Christian-Ehrlicher Thanks for the suggestion. Still I consider a custom delegate an overkill for such simple functionality, as my table is fairly simple and it will not contain more than a dozen rows. @anil_arise Thank you for the code. I will try that too. In the meantime, I found a solution. The problem and the confusion was that when a radio button (or checkbox) is checked, two toggled signals are emitted -one for the radio button actually clicked and one for the previously checked radio button which changes to unchecked, as the buttons are set to autoExclusive. So, I worked with the model indexes and got the result I wanted (note that in the end I opted for a QCheckBox): void ServiceDialog::setActiveModel() { for (auto row = 0; row < ui->myTable->rowCount(); row++) { QCheckBox *box = qobject_cast<QCheckBox*>(ui->myTable->cellWidget(row,5)); if (box && box->isChecked()) { ui->myTable->setCurrentIndex(ui->myTable->model()->index(row,0)); ui->myTable->selectRow(ui->myTable->currentIndex().row()); theStringIwant = ui->myTable->item(ui->myTable->currentIndex().row(),0)->text(); break; } } ... }
  • Errors occur when building yaml-cpp in Windows

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    P
    Okay! I've fixed the problem! All I needed to do was remove C:/devkitPro/msys/bin/ from the System PATH in Environmental Variables and then disabled YAML_CPP_BUILD_TESTS in the Qt Projects Build Settings for yaml-cpp, and it worked! For some reason, GTest (Google Test Framework) doesn't build in MinGW, that's why it has that error.
  • How to have multiple QCompleters in one QLineEdit

    Unsolved
    9
    0 Votes
    9 Posts
    919 Views
    L
    Thanks but that seems complicated. I think I'll go the old fashion way and just use multiple combo-boxes each with its own completer.
  • error: ‘fromJSON’ is not a member of ‘QJsonDocument’

    Unsolved
    4
    0 Votes
    4 Posts
    274 Views
    V
    Thanks, I start using an IDE
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • QML Table View with itemdelegate and row delegate

    Unsolved
    3
    0 Votes
    3 Posts
    853 Views
    R
    Hmmm, let me research some more on that. If the model is a QSqlModelQuery not quite sure how to expand the model.
  • [vsaddin] What's needed to do to update existing projects to use property pages

    Unsolved
    2
    0 Votes
    2 Posts
    227 Views
    Chris KawaC
    If you select the project in solution explorer and go to Extensions -> Qt VS Tools there's an option to convert your project: Convert custom build steps to Qt/MSBuild.
  • Any Good Git Client Suggestion

    Unsolved
    6
    0 Votes
    6 Posts
    666 Views
    S
    Before switching to GIT we have used (in both companies I have made this transition) TortoiseSVN. So, it was an obvious choice to go with TortoiseGIT. However, we have a very simple tree structure (we rarely use branches) which does not require more advanced visualization techniques. Other than that it does its job. TortoiseGIT requires to install the GIT command line tools for Windows separately. Then, also Qt Creator (and I believe Visual Studio as well) has a lot of GIT features already integrated. I do use at least GIT blame and GIT log from Qt Creator quite often.
  • QQuickWidget touch

    Unsolved
    5
    0 Votes
    5 Posts
    615 Views
    J
    @jsulm said in QQuickWidget touch: t is scene here? QGraphicsScene scene; scene.setSceneRect(0, 0, 1920, 1080); QGraphicsView view(&scene); view.show();
  • How to get QTextEdit Text minimum Height ? I Want use ScrollBar..

    Unsolved
    5
    0 Votes
    5 Posts
    711 Views
    P
    @SGaist https://forum.qt.io/topic/112598/how-to-get-fit-size/1 I want to do it like the above article. Setting toPlainText returns a smaller size than desired The scroll bar is still visible.