Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • QGraphicsRectItem that shows an image QPixmap or QImage....

    Solved
    2
    0 Votes
    2 Posts
    2k Views
    gfxxG
    @gfxx Sorry stupid question .... painter->drawImage(QPoint(0,0), boximg); solve the problem ..... unfortunately I always read too little references of Qt online classes .... :( regards Giorgio
  • How to properly subclass QApplication and access new methods elsewhere?

    Solved
    16
    0 Votes
    16 Posts
    7k Views
    P
    @kshegunov Thanks, good insights. I generally use the singleton in my case as it is modeling/controlling an external piece of hardware, of which there can only be one. I've been doing C++ much longer than Qt.. Still wrapping my head around "The Qt Way" for lots of things!
  • Parse an Xml file with Qt

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    B
    @mrjj said in Parse an Xml file with Qt: @Bogdan112 Hi I think its due to the use of QXmlStreamReader::Characters. If you do something like void readXML( ) { QString fileName = "e:/test.xml"; QFile file (fileName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox::critical(0, "QXSRExample::ReadXMLFile", "Couldn't open xml file", QMessageBox::Ok); return; } /* QXmlStreamReader takes any QIODevice. */ QXmlStreamReader xml(&file); /* We'll parse the XML until we reach end of it.*/ while(!xml.atEnd() && !xml.hasError()) { /* Read next element.*/ QXmlStreamReader::TokenType token = xml.readNext(); /* If token is just StartDocument, we'll go to next.*/ if(token == QXmlStreamReader::StartDocument) continue; /* If token is StartElement, we'll see if we can read it.*/ if(token == QXmlStreamReader::StartElement) { qDebug() << "#" << xml.name(); } } /* Error handling. */ if(xml.hasError()) QMessageBox::critical(0, "parseXML", xml.errorString(), QMessageBox::Ok); //resets its internal state to the initial state. xml.clear(); } Then it shows # "test" # "Page1" # "name1" # "name2" # "name3" # "name4" # "Page2" # "Val1" # "Val2" # "Val3" # "Val4" # "Page3" # "Val1" # "Val2" # "Val3" # "Val4" # "Page4" # "Val1" # "Val2" # "Val3" # "Val4" # "Page5" # "Val1" # "Val2" # "Val3" # "Val4" http://qt.shoutwiki.com/wiki/QXmlStreamReader_to_parse_XML_in_Qt Thank you. That solved my problem.
  • Qt Open Source Project License

    Unsolved
    4
    0 Votes
    4 Posts
    818 Views
    beeckscheB
    @SGaist @Eeli-K Thanks for the replies. No sorry, i do not want to keep the source code of the library private. I want to use the LGPLv3 license so developer who use the library are able to keep their code private. I reviewed the Qt Webinar "Qt Licensing & What You Need to Know" https://www.qt.io/event/qt-licensing-need-know/. Static linking and LGPLv3 do not fit together!
  • Posting on app store.

    Unsolved
    5
    0 Votes
    5 Posts
    808 Views
    jsulmJ
    @jsulm https://docs.microsoft.com/en-us/windows/uwp/get-started/whats-a-uwp
  • QAbstractVideoSurface

    Unsolved
    1
    1 Votes
    1 Posts
    389 Views
    No one has replied
  • Trouble with passing a value from lineedit to a Graph

    Solved
    3
    0 Votes
    3 Posts
    611 Views
    P
    Hi mrjj, Thank you for the reply. Yes, I have all the essentials of QCustomPlot. I figured out the solution. I didn't set the linestyle and scatterstyle therefore I was not able to see the plot as it was by default in white color. Once those parameters are set I can see the plot now and it works as expected.
  • Printing ZPL text to Zebra printer with Qprinter adds unwanted spaces

    5
    0 Votes
    5 Posts
    5k Views
    V
    Hi again, I found a solution for those who may be interested: Actually some special characters have a meaning for ZPL, but it is possible to replace them by there hexadecimal value preceded by '_'. Like this a '~' can be replaced by '_7e'... Check the ^FH in the ZPL manual. At my side I did something like this: QString escapedText(textField.text); QList<QChar> specialCharacters = QList<QChar>() << '~' << ' ' << ':' << ';' << '.' << '-' << '/' << '\\' << 'I' << '!' << '?' << '"' << '#' << '+' << '*' << '%' << '^' << '>' << '<'; foreach (QChar ch, specialCharacters) { escapedText = escapedText.replace(QString(ch), "_" % QString::number(ch.unicode(), 16)); } buildString.append("^FH^FD" % escapedText % "^FS\n");
  • Qdialog causing memory leak?

    Solved
    10
    0 Votes
    10 Posts
    5k Views
    liewjlsL
    Hi @jsulm Not sure why thought. When i tried to run valgrind on the machine, i got the error message ==4849== Command: ./test--platform xcb ==4849== --4849-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x2a valgrind: m_debuginfo/readdwarf.c:2199 (copy_convert_CfiExpr_tree): Assertion 'srcix >= 0 && srcix < VG_(sizeXA)(srcxa)' failed. ==4849== at 0x380273D0: ??? (in /usr/lib/valgrind/memcheck-x86-linux) sched status: running_tid=0 I only download and install the valgrind and debuginfo rpm from the opensuse respo. Anyone can help me on that? thanks.
  • Seeking ideas on a widget

    Unsolved
    2
    0 Votes
    2 Posts
    473 Views
    sierdzioS
    Looks like a job for QTableView.
  • Trying to create a singleton and getting LNK2019 error

    Solved singleton c++
    18
    0 Votes
    18 Posts
    8k Views
    kshegunovK
    @eggbertx said in Trying to create a singleton and getting LNK2019 error: Sorry, I meant the second code block, not the first. I'm not very familiar with assertions in general, so I've never heard of Q_ASSERT. The assertion here is only a tool to detect creating more than one instance of the class. Q_ASSERT is a Qt macro for regular debug assertions, it will be removed in release mode, so its purpose (as assertions in general) is to catch programmer errors while debugging. So if you use the class above like this: Singleton object1; Singleton object2; //< Here the assertion will be tripped and you can catch the error while debugging Adding the code in the second block fixed the issue. Do you mean the main window constructor where the connect is made? All code blocks are part of one single example, so I'd expect them to work together only. :)
  • Recomendations to create a logic for a video buffer

    Unsolved
    3
    1 Votes
    3 Posts
    653 Views
    SGaistS
    Hi, Is it some sort of camera ?
  • three.js in my Qt application

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    F
    Thanks again for your help. Yes, I had a look at Qt3D, but I have the feeling that it is a bit lower level than three.js
  • Basic QSqlite

    Solved sqlite
    14
    0 Votes
    14 Posts
    4k Views
    SGaistS
    So you have everything working now with your original database ?
  • Linux + Qt + QLineEdit + TTF = Nightmare

    Unsolved
    10
    0 Votes
    10 Posts
    3k Views
    M
    @QtAndLinux I am not having these fonts on my UBUNTU, What about other fonts(except "FontAwesome" and "LKLUG") , they work without any problem?
  • I need to get title of webpage

    Solved
    23
    0 Votes
    23 Posts
    8k Views
    A
    @jsulm Thanks I find answer. i use QUrl
  • Model based vs Item based

    Solved model item base differences treewidget
    3
    0 Votes
    3 Posts
    11k Views
    QT-static-prgmQ
    @VRonin Amen
  • Trouble installing QT on Mac: no mountable file systems

    Unsolved
    2
    0 Votes
    2 Posts
    487 Views
    jsulmJ
    @EMC3 How do you mount them? Usually you just double click on them and install.
  • Qt window on top of virtual keyboard

    Unsolved
    10
    0 Votes
    10 Posts
    4k Views
    jsulmJ
    @alecs26 You cannot use this outside a class (C++ basics). As @SGaist already said you need to use your main window instead of this.
  • QLabel text not updating

    Solved
    7
    0 Votes
    7 Posts
    4k Views
    M
    @m.sue said in QLabel text not updating: Thanks Michael it worked and the text is updating.