Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 457.9k Posts
  • Load HTML file in QWebView by QTcpServer

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    F
    Oh My God, and it works. It really works. Of course. Not sure if I'm a fool. 😄 I'll continue with some other tests and adjustments in the next hours or days then I'll update this thread to fixed state. Thank you for your help!
  • QPlainTextEdit Clearing Problems

    Solved
    4
    0 Votes
    4 Posts
    619 Views
    A
    @jsulm said in QPlainTextEdit Clearing Problems: @admkrk Where is this code located? It is in a getCursorPosition() function I use to track the cursor in the status bar. I never anticipated that it would ever read on the first line since the header takes up that line. It looks like the cursor is put back to the start before the header is inserted, after the initial time. I have been bitten like this before, but it involved when widgets were made visible. Thanks for the good eyes JonB.
  • Qt installer framework execute command

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    sierdzioS
    @GregB said in Qt installer framework execute command: < This is different. QProcess does not spawn a full shell, it only executes a single process. So pipes, redirection etc. do not work. There are ways around, probably the easiest is to move that line into a script and call it via something like (pseudo code, not tested): component.addElevatedOperation("Execute", "{0}", "bash", "-c", "script.sh");
  • QAbstractSocket::SocketAccessError when trying to listen on a port

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    S
    @aha_1980 I think they checked that already. We will simply switch to a port outside the dynamic range, which seems to fix the issue. We wanted to change the port for a while because it gave us other issues, we just had to deal with some compatibility issues between our client and server for that update. Basically, listening on a dynamic port (from 49,152 to 65,535) is a bad idea for at least 2 reasons (now 3, counting this thread): Any program could be using that port at the moment you need it, by having it selected randomly, which will either break the other program, or not let yours use the port at all You can end up with weird self connection issues if the client is idling and searching for a server that is not there.
  • QStateMachine Custom Events and Transitions

    Unsolved
    5
    0 Votes
    5 Posts
    741 Views
    B
    @mrjj Thanks a lot! I will study it :)
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    22 Views
  • 0 Votes
    2 Posts
    747 Views
    SGaistS
    Hi, I think you are looking for QMAKE_RPATHDIR.
  • Difference between QGraphicsView::sceneRect and QGraphicsScene::sceneRect?

    Solved
    5
    0 Votes
    5 Posts
    977 Views
    P
    @Asperamanca Ah. now I understand what you wrote in your original reply more clearly. That does make sense, and it looks like the implementation accomplishes that level of flexibility without compromising the most general case.
  • no out-of-line virtual method definitions

    Unsolved
    5
    0 Votes
    5 Posts
    4k Views
    VRoninV
    @mrdebug said in no out-of-line virtual method definitions: is deprecated because it has a user-declared destructor This is just the good old rule-of-3 (now became rule-of-5). why don't you just =default them instead of having an empty body to avoid headakes?
  • Plot EEG samples

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    mrjjM
    @MajidKamali Ok in that way. I dont recall seeing a widget that has this sort of multi graph.
  • Qt widgets do not update on touch screen in full screen mode

    Unsolved
    5
    0 Votes
    5 Posts
    364 Views
    JoeCFDJ
    @J-Hilk said in Qt widgets do not update on touch screen in full screen mode: 5.9.8 IIRC Thank you for your reply. No, I have not tried 5.9.8 IIRC. I will check it out. Unluckily, I have only two types of touch screens(small and big ones). On the small one, everything is fine. The driver for the big one is the latest which has been reinstalled.
  • Quad Splitter Implementation in QT

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    Gojir4G
    @magicstar said in Quad Splitter Implementation in QT: How do I get horizontal position of QSplitter handle which has vertical orientation ? AFAIK you cannot. A vertical splitter does not have horizontal position. Here is one possible solution : customsplitter.h #ifndef CUSTOMSPLITTER_H #define CUSTOMSPLITTER_H #include <QSplitter> class CustomSplitter : public QSplitter { Q_OBJECT public: CustomSplitter(QWidget *parent = nullptr); void bind(CustomSplitter *splitter); private slots: void onBoundSplitterMoved(int pos, int index); private: int lastPos = -1; int lastIndex = -1; }; #endif // CUSTOMSPLITTER_H customesplitter.cpp #include "customsplitter.h" #include <QTimer> CustomSplitter::CustomSplitter(QWidget *parent) : QSplitter(parent) { } void CustomSplitter::bind(CustomSplitter *splitter) { connect(splitter, &QSplitter::splitterMoved, this, &CustomSplitter::onBoundSplitterMoved); } void CustomSplitter::onBoundSplitterMoved(int pos, int index) { if(pos == lastPos && index == lastIndex) return; lastPos = pos; lastIndex = index; moveSplitter(pos, index); } widget.cpp Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); ui->splitHB->bind(ui->splitHT); //Bind Horizontal Bottom to Horizontal Top ui->splitHT->bind(ui->splitHB); //Bind Horizontal Top with Horizontal Bottom } @magicstar said in Quad Splitter Implementation in QT: And when I click at the center, I should be able to move handle in both horizontal and vertical direction I think this is not possible except if you implement your own splitter.
  • How to create a widget that independent from any window?

    Unsolved
    2
    0 Votes
    2 Posts
    346 Views
    jsulmJ
    @Ibrahim See https://stackoverflow.com/questions/3948441/how-to-remove-the-window-border-containing-minimize-maximize-and-close-buttons You can create a window with setWindowFlags( Qt::CustomizeWindowHint );
  • 0 Votes
    8 Posts
    4k Views
    jsulmJ
    @BoboFuego said in How to make mouseMoveEvent and keyPressEvent to be called interchangeably?: I don't know how to mark this thread as solved "Topic Tools" at the bottom right side and then "Mark as Solved".
  • QPainter, drawing right aligned text in rectangle cuts the text off

    Unsolved
    2
    0 Votes
    2 Posts
    4k Views
    No one has replied
  • QModelIndex: how to get the Model

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    VRoninV
    If you need to do non-const operations you need to pass the model pointer downstream. You currently have something like a slot with a signature void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); and a connect that looks something like connect(view->selectionModel(),&QItemSelectionModel::selectionChanged,this,&MyClass::onSelectionChanged); all you have to do is chane the signature to void onSelectionChanged(QSqlTableModel * model,const QItemSelection &selected, const QItemSelection &deselected); and the connect to connect(view->selectionModel(),&QItemSelectionModel::selectionChanged,this,std::bind(&MyClass::onSelectionChanged,this,model,std::placeholders::_1,std::placeholders::_2));
  • Send QEvent to QGraphicsScene base on QGraphicsView rendering

    Solved
    5
    0 Votes
    5 Posts
    586 Views
    robinfauryR
    Thx for the conversion! It works well now. Best regards!
  • Compile Qt5 myself, how to change the name of DLL

    Unsolved
    2
    0 Votes
    2 Posts
    433 Views
    sierdzioS
    You need to use this flag: -qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so. So in your case it will be: configure -qtlibinfix 51
  • variable as object

    Solved
    6
    0 Votes
    6 Posts
    472 Views
    jsulmJ
    @rktech said in variable as object: I need a way to create ui->modra1->... if i == 1 and ui->modra2->... if i == 2 This is not possible in C/C++ - variable names are compile time.
  • How to get list of all items in QML StackView that pushed into stack?

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    B
    @CKurdu Thx for reply. I am doing similar usually. I've been seeking something that in-box from pure QT without additional storing info about what in stack. Looks like nothing in it yet. First time I've been questioning about it about 4-5 years ago ...