Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • [Solved] QTableView item update Automatically???

    qt 5.4.1 qtable
    11
    0 Votes
    11 Posts
    8k Views
    sierdzioS
    Ha, that is good to hear. Happy coding!
  • Calling Qfiledialog form openglwindow example

    5
    0 Votes
    5 Posts
    2k Views
    Q
    In openglwindow . cpp if(e->key() == Qt::Key_5){ filenam = QFileDialog::getOpenFileName(0,"Vali graafiku fail"); } Call from main also cause problems. Is only way to make opengl draw from other thread or could use same thread for gui as well?
  • Not safe to use QPixmap outside the GUI thread

    qpixmap
    4
    1 Votes
    4 Posts
    4k Views
    A
    @JKSH @JKSH said: One thing I noticed is that QPixmap objects read/write global objects without mutexes or any other thread locking. That's one good argument right there. Currently, the application never tries to work on the QPixmaps from different threads at the same time.
  • QML Scripting...

    3
    0 Votes
    3 Posts
    953 Views
    JKSHJ
    Hi, @arealperson said: Is QML like a normal scripting language ? What I’m asking is… Is it general purpose ? In the beginning, QML was designed as a quick and easy language to create GUIs. It consists of JavaScript plus custom declarative code which is similar to CSS/JSON. Since QML is a superset of JavaScript, you can use its engine for JavaScript scripting. QML is general-purpose. It is even used to implement a build system. Like, can I do anything in it just like I would use any other scripting language ? Things, like Flow control, User defined types, File IO, etc… What type of scripting work is QML not really made for ? Well... anything that's not suitable for JavaScript, I guess. I can’t find a good getting started tutorial about how to compile/execute a QML script. http://doc.qt.io/qt-5/topics-scripting.html http://doc.qt.io/qt-5/qtjavascript.html
  • about set qcompleter drop-down list item background color problem

    2
    0 Votes
    2 Posts
    579 Views
    SGaistS
    Hi, You can't set the background of a QCompleter, it's not a QWidget. However you can style the widget that will use the QCompleter. Hope it helps
  • HOW TO: Add a button to QFileDialog ? [solved]

    3
    0 Votes
    3 Posts
    3k Views
    SGaistS
    @jerome_isAviable said: getOpenFileUrls is not a member function per se, it's a static function, that's why you didn't got what you wanted.
  • 0 Votes
    4 Posts
    8k Views
    L
    I had the same problem trying to run my QTestLib QGuiApplication unit tests on a headless build system. I worked around it by providing a X virtual server. Xvfb :1 & DISPLAY=:1 make check pkill Xvfb
  • 0 Votes
    5 Posts
    2k Views
    SGaistS
    Nice ! Thanks for sharing :)
  • 0 Votes
    4 Posts
    1k Views
    SGaistS
    Were you using QSharedMemory to communicate between two objects of the same application ?
  • 0 Votes
    15 Posts
    6k Views
    SGaistS
    qt.conf is the recommended way for the plugins handling part
  • Program works on Linux but not on OSX

    taglib osx linux
    11
    0 Votes
    11 Posts
    5k Views
    D
    @devbrs You certainly must check if taglib is null. And you must use toUTF8() instead of toAscii(). The last problem is that some of the string conversion functions in TagLib don't appear to work with the QString conversion functions. Namely the functions that create c++ string and wstring objects: QString::fromStdString(tag->title().to8Bit()); QString::fromStdWString(tag->title().toWString()); The functions that return c style string pointers do work: QString::fromWCharArray(tag->title().toCWString()); QString(tag->title().toCString(true)); Now, why the string functions work on Linux and not on the Mac, I don't know. Perhaps you could delve into it.
  • I can not receive simple int values over a socket

    2
    0 Votes
    2 Posts
    490 Views
    K
    In which way is your int send? If it is sent binary, you will have to extract it from your buffer. There is no automatic conversion. With QByteArray you may use toInt() However, you need to know the information type to be received.
  • Highlighting entire string

    12
    0 Votes
    12 Posts
    3k Views
    simowS
    @joeydonovan4 Then just add a property like for example autoSelectAllOnFocus to the new subclassed MyLineEdit and then in the overloaded method you either call home() or selectAll() in dependence of the property.
  • Qdebug problem

    8
    0 Votes
    8 Posts
    3k Views
    Q
    Sorry for long response , Running windows 7 Pro and mingw compiler. In terminal all works perfect , problem mostly is with floating window or variables tab on right under debug. Sometimes floating window turn gray and hard to see content, Probably will install linux version of qt also if it very stable.
  • Change GUI objects from a scound class

    5
    0 Votes
    5 Posts
    1k Views
    Q
    Hi Chris, thank you very much I was able to solve it :). I tried something similar before but I think I have done sth. wrong with all these pointer stuff.. Cheers
  • 0 Votes
    3 Posts
    3k Views
    sahadumS
    Hi, thx, I added a report to Qt Jira. QTBUG-45114
  • Get all selected items in a treeview

    4
    0 Votes
    4 Posts
    4k Views
    H
    @mcosta @sahadum Thank you for your responses! Both of these are great points. I have a similar implementation to Sahadum's suggestion in place regarding item roles, and Mcosta, that's the EXACT thing I was doing to determine if it's a child node. The only problem is, when I query my selectionModel->selectedRows(), my rows still are out of order. When I run my foreach loop, this is what's given to me: rows - 0, 0, 0, 1, 1, 1, 2, 3, 4, 5 deconstructed as below: item3:child1.row() ==0, item4:child1.row() == 0, item1.row()==0, item3:child2.row()==1 item4:child2.row()==1 item2.row()==1 This is the order that the rows are presented to me in the foreach loop. I tried ignoring child nodes, and then adding their data to my QStringList when I encounter a parent. This orders things properly, but what if I select ONLY a child line, for instance Item3:Child1 - this will be ignored and not be copyable. I must then copy the parent and get ALL the children. I still need a means of walking through my selectionModel that will give me the rows in the order they appear in my Treeview.
  • 0 Votes
    1 Posts
    360 Views
    No one has replied
  • What happens when QMap reaches maximum items

    Solved qmap
    7
    0 Votes
    7 Posts
    3k Views
    ?
    Thanks for your opinions, guys! So it's really safe to ignore this.
  • QDataStream only accept Qt data types?

    2
    1 Votes
    2 Posts
    501 Views
    A
    Hello, You have to write your own implemenation of QDataStream operators (<<,>>) for your String Class e.g. MyString QDataStream &operator<<(QDataStream &out, const MyString &string) {......} QDataStream &operator>>(QDataStream &in, MyString &string) {......}