Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Problem with QTextEdit copy function after assigning it a QAction

    Solved
    6
    0 Votes
    6 Posts
    577 Views
    L
    @mpergand Yes, that's what I want. Thanks. I tested it and it works.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Programmatically modify QSqlTableModel field

    Solved
    16
    0 Votes
    16 Posts
    2k Views
    JonBJ
    @NameRakes Absolutely. The updates work in two directions: When the bound value in the model changes, the widget is updated accordingly. When the user (interactively) changes the widget's value, the bound value in the model is updated accordingly. I would not have necessarily known that calling QLineEdit::setText() does not alter the model value. I am taking your word for that. That would emit QLineEdit::textChanged() signal. But there are also textEdited() & editingFinished() signals, and those are only emitted when the user interactively changes the text, not via setText(). So at a guess the model update happens on one of those instead. One would have to look at the code. If you wanted to test, you might force those to be emitted (by calling them directly) and see if that did cause the model to change. Other widgets do not have this distinction between programmatic and user interaction signals. For example, QComboBox::currentIndexChanged() is emitted whenever the user or code causes setCurrentIndex() to be called. I imagine that one would cause the model value to be updated if called from code. As a general rule if you want to change a value on a bound widget I would suggest/expect you to do so by altering the model, and letting that reflect back to the widget.
  • QWebEngine in non-main thread of native application

    Unsolved
    6
    0 Votes
    6 Posts
    648 Views
    S
    @SanZ Just confirmed that the problematic behaviour occurs when the whole thing is put to another thread. In my mock application I had everything in main thread, now I changed to HANDLE hThread = CreateThread(0, 0, thread_fn_for_web, 0, 0, 0); this is the same way as I did with my original application, and now the mock application is failing with the same issue. Anybody has any insight? Thanks.
  • QT Dns Over Https / DOH

    Unsolved dns doh dns over https
    2
    0 Votes
    2 Posts
    418 Views
    C
    The relevant classes/functions in Qt hand DNS resolution off to the operating system. If your operating system implements DoH then you have that support, otherwise you do not. As I understand it, Apple's iOS 14 and macOS 11 and Windows 11 have the support.
  • tr() with binding: how to get the calling classname to a function,

    Unsolved
    12
    0 Votes
    12 Posts
    798 Views
    SGaistS
    What about implementing the changeEvent method to handle your object's translatable strings like shown in the dynamic translation part of the internationalization documentation ?
  • 0 Votes
    4 Posts
    697 Views
    D
    My goal was to create a project display so it's easy to determine where a problem occurs when updating the project files. I have several libraries and the dependencies can be nest quite a bit. I wanted output like: Project MESSAGE Project.Pro Project MESSAGE include file 1 Project MESSAGE include file 2 Project MESSAGE include file 3 Project MESSAGE include file 3 -- done Project MESSAGE include file 2 -- done Project MESSAGE include file 1 -- done Project MESSAGE Project.pro -- done To accomplish that I did the following pattern Project.pro INDENT_SPACES = "" INDENT_ADD_SPACES = " " message("$$INDENT_SPACESProject.pro") FILE_NAME = include1.pri.export !exists($$FILE_NAME) { message("$${INDENT_SPACES}File does not exist: $$FILE_NAME") error() } ! include(FILE_NAME) { message("$${INDENT_SPACES}Error importing file: $$FILE_NAME") error() } message("$$INDENT_SPACESProject.pro" -- done) include1.pri.export UNIQUE_VARIABLE = $$INDENT_SPACES INDENT_SPACES += INDENT_ADD_SPACES message("$${INDENT_SPACESinclude file 1"} # Follow the pattern described in Project.Pro to import file include2.pri.export message("$${INDENT_SPACESinclude file 1 -- done"} INDENT_SPACES = $$UNIQUE_VARIABLE include2.pri.export UNIQUE_VARIABLE2 = $$INDENT_SPACES INDENT_SPACES += INDENT_ADD_SPACES message("$${INDENT_SPACESinclude file 2"} # Follow the pattern described in Project.Pro to import file includ3.pri.export message("$${INDENT_SPACESinclude file 2 -- done"} INDENT_SPACES = $$UNIQUE_VARIABLE2 include2.pri.export UNIQUE_VARIABLE3 = $$INDENT_SPACES INDENT_SPACES += INDENT_ADD_SPACES message("$${INDENT_SPACESinclude file 3"} # Follow the pattern described in Project.Pro to import file includ3.pri.export message("$${INDENT_SPACESinclude file 3 -- done"} INDENT_SPACES = $$UNIQUE_VARIABLE3 I hope it helps!
  • 0 Votes
    2 Posts
    736 Views
    JoeCFDJ
    @RobotMaker said in Svg Rendering Perspective Transform on QGraphicsView Viewport: Some code will be helpful. And how you update it? try to call this after your change to update it. I use it to toggle svg pics display. update(const QRectF &) ==>update( boundingRect() ); I assume you overrides boundingRect();
  • Set text in QTextDocument

    Solved
    5
    0 Votes
    5 Posts
    496 Views
    P
    @SGaist I think its can help to solve my problem. Thanks for help.
  • Automatic typer

    Solved
    10
    0 Votes
    10 Posts
    896 Views
    S
    @JonB thanks for you answer. It works perfectly, even if it isn't Qt, it still does what I want it to do. Thanks :)
  • 0 Votes
    6 Posts
    597 Views
    T
    @jsulm ok, sorry for trouble to you. I will learn more and try that.
  • General information about QT

    Unsolved
    5
    0 Votes
    5 Posts
    347 Views
    S
    Thank you for your answer! I wanted to write to the official developers about this, but in order to contact them, a paid license is required ...
  • Ui, finding control by using literal string

    Solved
    13
    0 Votes
    13 Posts
    2k Views
    J.HilkJ
    @SPlatten because findChild is a function of QObject However QWidgets based classes requiere a QWidget and not a QObject as a parent. Layouts are no QWidgets
  • QMap, index of entry without iterating through

    Solved
    18
    0 Votes
    18 Posts
    4k Views
    J.HilkJ
    Disregard almost everything I said 🙈, of course the internal storage is sorted on key/value pair insert
  • Executable library permission?

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    artwawA
    you might find it easier to install Qt on your raspi, together with the creator, then just use Remote Desktop session for developing directly on the raspi.
  • Run the executable file built in Ubuntu on Raspberry Pi Ubuntu

    Unsolved
    6
    0 Votes
    6 Posts
    677 Views
    sierdzioS
    @IknowQT said in Run the executable file built in Ubuntu on Raspberry Pi Ubuntu: @sierdzio If the arm64 and amd64 architectures are different for the same Ubuntu, do you need to make cross-compilation? Yes, cross-compile or compile natively on Raspberry Pi.
  • QCompleter with a QLineEdit into QGraphicsScene

    Unsolved
    3
    0 Votes
    3 Posts
    294 Views
    cfdevC
    Tested with Qt 5.15.2 on MSWindows 10 and Ubuntu 20.04 LTS The problem is the same. I forgot to say, I use QCompleter normally through the QLineEdit. m_textLineEditWidget->setCompleter(completer); I think that the QListView used for completer is not managed by the Scene, and it s for that the scale of it doesnt operate. Probably to fix it, I will need to create a ListView manually and Add it to the scene. :-/ What do you think ?
  • Move items in a QSortFilterProxyModel

    Unsolved
    27
    0 Votes
    27 Posts
    5k Views
    F
    hi, can anybody tell me how to implement moveRows() for the class derived from QSortFilterProxyModel: moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) it looks like we need to exchange the proxy indexes, but we can't access to the private members in the subclass
  • Do I need to use pointer to QImage to save memory?

    Solved
    4
    0 Votes
    4 Posts
    327 Views
    L
    @ChrisW67 Thank you for the explanation, I will stop returning image pointer now.
  • libqrencode undefined reference error

    Solved
    5
    0 Votes
    5 Posts
    514 Views
    T
    Nevermind, I solved it, I forgot to define the config as staticlib while building the qrencode library