Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • No error, but no reading from serial port

    Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    JonBJ
    @agmar It would be better if you pasted some minimal example of your problematic code. But if you are going to post code as big as this please use the forum's Code tags around code blocks. Meanwhile, your MainWindow::sendMessage() at least has a local QSerialPort and opens and closes it. I don't know about the rest of your code, but you are supposed to have a single instance of QSerialPort permanently open for both writes & reads.
  • phonon::Mediaobject

    Unsolved
    2
    0 Votes
    2 Posts
    182 Views
    jsulmJ
    @praveen_1323 said in phonon::Mediaobject: video/widget.cpp:-1: error: undefined reference to `Phonon::VideoPlayer::VideoPlayer(Phonon::Category, QWidget*)' You're apparently not linking the library containing VideoPlayer. Please post the linker call and also check the compiler output for any messages like unsupported library. Why do you use Qt4?
  • Qtableview set background color to some columns

    Solved
    22
    0 Votes
    22 Posts
    8k Views
    jsulmJ
    @Chuck333 What is your exact problem/question?
  • identifier and initializer errors in extracted example code

    Solved
    5
    0 Votes
    5 Posts
    444 Views
    A
    @JonB thank you, i just missed the line in the terminal example... its the example available in the welcome page :-) just type out "terminal" in the search bar
  • 0 Votes
    4 Posts
    310 Views
    A
    @ChrisW67 Experienced. The code doesn't work. It does not transfer the string.
  • How does one create a QChart Colorbar?

    Unsolved
    6
    0 Votes
    6 Posts
    859 Views
    H
    @Stewman-Phil have you found the method ? i have the same problem
  • focus tracking

    Solved
    3
    0 Votes
    3 Posts
    281 Views
    SPlattenS
    @J-Hilk said in focus tracking: https://doc.qt.io/qt-6/qfocusevent.html Thank you, I have: bool clsXMLnode::eventFilter(QObject* pobjObject, QEvent* pobjEvent) { Q_ASSERT_X(pobjEvent!=nullptr, "clsXMLnode::eventFilter", "pobjEvent is null!"); QWidget* pobjWidget(qobject_cast<QWidget*>(pobjObject)); clsXMLnode* pobjWindow(pobjGetWindow()); clsXMLinterface* pobjXMLIF(nullptr); if ( pobjWindow != nullptr ) { pobjXMLIF = pobjWindow->pobjGetXMLIF(); } QEvent::Type evtType(pobjEvent->type()); QString strID; if ( pobjWidget != nullptr ) { strID = pobjWidget->accessibleName(); } if ( evtType == QEvent::FocusIn ) { if ( pobjXMLIF != nullptr ) { clsXMLnode* pobjNode(pobjXMLIF->pobjGetNode()); emit pobjNode->setWidgetInFocus(pobjWidget); } } else if ( evtType == QEvent::FocusOut ) { } else if ( evtType == QEvent::MouseMove ) { //HACK QMouseEvent* pobjMouse = qobject_cast<QMouseEvent*>(pobjEvent); //HACK QPoint ptPos = pobjMouse->pos(); //HACK qdbg() << "9" << clsDebugService::msccDebugLevelDelimiter << "" << "eventFilter(MouseMove):" << strGetAttribute(clsXMLnode::mscszAttrID) << ptPos.x() << ptPos.y() << "HACK!"; } else if ( evtType == QEvent::Move ) { QMoveEvent* pobjMove(reinterpret_cast<QMoveEvent*>(pobjEvent)); QPoint ptNew(pobjMove->pos()); if ( ptNew.x() >= 0 && ptNew.y() >= 0 && ptNew != mptLastMouse ) { mptLastMouse = ptNew; setAttribute(clsXMLnode::mscszAttrPoint ,QString::number(mptLastMouse.x()) + clsXMLnode::msccParamDelimiter + QString::number(mptLastMouse.y())); return false; } } else if ( evtType == QEvent::Resize ) { QResizeEvent* pobjResize(reinterpret_cast<QResizeEvent*>(pobjEvent)); QSize szNew(pobjResize->size()); if ( szNew.isValid() == true ) { setAttribute(clsXMLnode::mscszAttrResize, QString::number(szNew.width()) + clsXMLnode::msccParamDelimiter + QString::number(szNew.height())); return false; } } return QObject::eventFilter(pobjObject, pobjEvent); } Which I wrote a long time ago, will revisit and adapt. I must be getting old, because I've already done this: QObject::connect(this, &clsXMLnode::setWidgetInFocus ,this, &clsXMLnode::onSetWidgetInFocus);
  • QNetworkAccessManager I don't get data in my php file

    Unsolved
    9
    0 Votes
    9 Posts
    793 Views
    A
    Okay I trie it
  • Bulk way to comment all cout

    Unsolved
    3
    0 Votes
    3 Posts
    239 Views
    JonBJ
    @JKSH And hope that, e.g. code never passes it as a parameter... :)
  • can use rcpp in qt ?

    Unsolved
    4
    0 Votes
    4 Posts
    355 Views
    jsulmJ
    @donkey007 What C++ compiler do you use and what C++ compilers are supported by rcpp? And again: this has nothing to do with Qt, you should consider to ask in a rcpp forum/mailing list and check rcpp documentation.
  • Whoopps I done it again - how to rename "MainWindow" ?

    Unsolved
    3
    0 Votes
    3 Posts
    434 Views
    J.HilkJ
    @AnneRanch I would suggest: Right click on your project Choose Qt Files and Classes template Choose Qt Designer Form Class Select Main Window This time, name it like you want it to Finish the wizard Delete old "MainWindow" from project
  • segfault "caused" by unused variable in different class

    Unsolved
    12
    0 Votes
    12 Posts
    758 Views
    M
    @Kent-Dorfman said in segfault "caused" by unused variable in different class: I detect a strong odor of pointer problems. i am getting random segfault at Class2::Print() , but most dont occur everytime. the one involving (m_vPointA.size() is the only one that occurred every time for two days lets go with pointer error. how to track it down?
  • pass data from terminal to txt

    Unsolved
    3
    0 Votes
    3 Posts
    237 Views
    Kent-DorfmanK
    in linux the "script" command entered in a terminal window will save all IO to the file "typescript". "exit" when done. Not that it saves in DOS endline format which is "<CR><LF>"
  • Timer error when launching a new QGuiApplication after exit

    Unsolved
    6
    0 Votes
    6 Posts
    562 Views
    JoeCFDJ
    @bart_janssens said in Timer error when launching a new QGuiApplication after exit: Julia https://github.com/barche/QML.jl
  • QProcess DOS command not working

    Unsolved
    3
    0 Votes
    3 Posts
    424 Views
    JoeCFDJ
    @TGRSM Do not you need arguments to call execute? int QProcess::execute(const QString &program, const QStringList &arguments) https://doc.qt.io/qt-5.15/qprocess.html#execute The following one is run like QStringList arguments; arguments << "/c" << ""w:/scripts/myscript.bat"" int exitCode = QProcess::execute( "cmd", arguments );
  • How to subclass QStyleOptionButton?

    Solved
    6
    0 Votes
    6 Posts
    624 Views
    Axel SpoerlA
    @schrute: Style options are used for data exchange between widgets and styles. The widget populates it with data that each style may interpret differently when doing its drawing work. So in the case at hand, a custom style is supposed to react specifically to a custom widget. It’s a question of style (haha) whether to query the widget directly or derive from QStyleOption. Deriving from QStyleOption has the advantage that information can be detached at a specific state without being modified when the widget’s state transitions in the meanwhile. For instance if it should be drawn differently while being hovered, the widget may no longer know at the point of direct query, that it once was under the mouse cursor. That’s where I’d draw the line: If conserving fluctuating states is crucial, derive from QStyleOption. If that’s not the case, call the widget directly.
  • I want to create a log display like show in the Image.

    Unsolved
    4
    0 Votes
    4 Posts
    357 Views
    SGaistS
    @Aviral-0 Hi, Unless I am mistaking, it's Qt Creator. Therefore take a look at Qt Creator's sources.
  • 0 Votes
    3 Posts
    1k Views
    SGaistS
    Hi, That part comes from KDE, I would recommend also checking with them.
  • how to rename standard process name qtcreator_process_stub.exe

    Unsolved
    2
    0 Votes
    2 Posts
    181 Views
    Christian EhrlicherC
    I would guess the only way is to compile QtCreator by yourself and change the name in the code. Why would someone need to rename a helper executable??
  • 0 Votes
    17 Posts
    10k Views
    Aviral 0A
    @JonB hehe! IThats what exactly I am tryingg to do. If anyone can find github link or repositry it will be very helpful for me!