Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • I am getting this error "QPainter::setPen: Painter not active"

    7
    0 Votes
    7 Posts
    49k Views
    A
    Thanks for your replies. Actually I am implementing a crop function. I want to draw a rectangle on an image displayed in qgraphicsview widget. the rectangle should be resizable on its ends using mouse. Once the user finalises the part of image, the program would use copy function of QImage to extract the cropped part. So, can you plz guide me with creating a resizable rectangle. If I reimplement the painter function of my mainwindow class, the rectangle gets displayed at the beginning. It should appear only when crop is invoked.
  • Qt Frozen Column example error when adding new column

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    2 Posts
    2k Views
    M
    I don't believe nobody experienced this issue. :(
  • QTreeView selection not updating until mouse enters

    4
    0 Votes
    4 Posts
    3k Views
    G
    That's really strange. The code looks perfectly ok to me. Can you create a small, complete test case?
  • Example of match(....) function over-ridden of QAbstractItemModel

    2
    0 Votes
    2 Posts
    2k Views
    G
    You usually do not need to override the method. Just feed it with the appropriate arguments (the string to search for, the role to check the data against, where to start, case insensitivity and so on).
  • 0 Votes
    8 Posts
    3k Views
    F
    Thanks a lot for your help. I will give it another try.
  • QPluginLoader and shared resources

    6
    0 Votes
    6 Posts
    3k Views
    R
    Yeah, even though I know that, I haven't thought about it. It will take a while to get the information from there, thought that the forums would be faster to get response from ;-)
  • Connect process finished() and error signal to set pushButton enabled?

    13
    0 Votes
    13 Posts
    9k Views
    S
    Ok, got it now, was my fault, just had the wrong QProcess "Prozess" in my connection method. THX for the help.
  • [SOLVED]QProcess get RAM usage of a program

    3
    0 Votes
    3 Posts
    5k Views
    J
    Looks like I'll have some fun using preprocessor directives for writing cross platform function. As memory usage, I mean amount of RAM used, like it's shown in Task Manager or top command in linux/unix OS. Application will be strict C/C++ programs without any threads, external libraries and "system()" functions. And I assume, that on every OS standard C/C++ libraries are constantly kept on RAM, so I can overlook that. Thanks for helping! Regards, Jake
  • Some problem with sql query.

    4
    0 Votes
    4 Posts
    2k Views
    H
    Structure a table Groups: @TABLE Groups (name VARCHAR(30) PRIMARY KEY, creator VARCHAR(30),exhibitors TEXT, files TEXT, password VARCHAR(20))@ New situation with sql query has arrived. Here is a code: @ QString MyServer::getListOfContact(QString name) { QSqlQuery query; query.exec("SELECT listOfUsers FROM users WHERE login='"+name+"'"); // if(query.isActive()&&query.isValid()) // { QString listOfContact; while(query.next()) listOfContact=query.value(0).toString(); QStringList l=listOfContact.split(","); listOfContact.clear(); for(int i=0;i<l.count();i++) if(l.at(i)=="NULL") l.removeAt(i); for(int i=0;i<l.count();i++) listOfContact+=l.at(i)+","; listOfContact.remove(listOfContact.size()-1,1); query.clear(); return listOfContact; // } // else // { // qDebug()<<query.isValid(); // qDebug()<<query.lastError(); // } } @ I belive issue is a similar to the previous. When program using this method in a first time, it's fine, exept check the validity. My consideration about follow below. After what, when program using this procedure again, AND VARIABLE name HAS A SAME VALUE, query is empty. There no calls to database, between first and last query. What it can be? Now about check for validity. Here is one of procedure of adding new element to table: @ QString nameOfCreator; QString nameOfTheGroup; QString listOfTheGroupExhibitors; QString passwordOfTheNewGroup; QStringList listOfAlreadyExistingGroups; ///////////////////////////// if(!listOfAlreadyExistingGroups.contains(nameOfTheGroup)) { query.exec&#40;"INSERT INTO Groups(name, creator, exhibitors, files, password&#41;" "VALUES(:name,:creator,:exhibitors,:files,:password)"); query.bindValue(":name",nameOfTheGroup); query.bindValue(":creator",nameOfCreator); query.bindValue(":exhibitors",listOfTheGroupExhibitors); query.bindValue(":files",NULL); query.bindValue(":password",NULL); @ Not a single query does not pass for validity, but i don't understand why. I already try create table with TEXT fileds - result is a same: query is not valid and lastError return @QSqlError(-1, "", "")@. It's more than just a strange, because database open correctly and first query was execute file. I'm stuck. Many thanks in advance.
  • [SOLVED] QTcpSocket packet buffer

    2
    0 Votes
    2 Posts
    6k Views
    V
    I actually ended up figuring it out...I set the socket options TCP_NODELAY and the send timout socket option on my server side, and on the Qt side I set the LowDelayOption to 1 and all the packets are coming in quite nicely now no matter the side.
  • [SOLVED] Signal from QList Object to Slot from parent

    7
    0 Votes
    7 Posts
    6k Views
    R
    OK thanks, I will rewrite my code and try to put the Trays on the heap and save pointers them in the trayList
  • QPSQL Multithread Crash

    2
    0 Votes
    2 Posts
    2k Views
    G
    Did you read "Threads and the SQL Module":http://qt-project.org/doc/qt-4.8/threads-modules.html#threads-and-the-sql-module of the QSqlDatabase documentation? Did you open another connection in another thread? Are you sure the code is running in the new thread?
  • Qt style sheets implementation

    2
    0 Votes
    2 Posts
    1k Views
    D
    All the information can be found from Manual. Online version is here: http://qt-project.org/doc/qt-4.8/stylesheet.html If you want to see how it's implemented, you can dig into the source code.
  • [SOLVED]How to get a selected item from QListWidget &#63;

    5
    0 Votes
    5 Posts
    69k Views
    D
    Done. Thanks again!
  • Build error when building Qt 4.8.1 for VS2005

    8
    0 Votes
    8 Posts
    4k Views
    D
    Seems OK, I will try to commit a patch for Qt5. When it get merged, we can commit another patch for Qt4.8. ;-)
  • 'qt_metatype_id' is not a member of...

    3
    0 Votes
    3 Posts
    13k Views
    T
    Okay, that solved my first problem. Thanks for that Lukas. However I am now getting the error @Unable to assign QList<MOCourse*> to QDeclarativeListModel*@ in my QML file. Any idea how to fix this? I did not find any relevant information online.
  • [SOLVED] Arranging Items with fixed sizes

    3
    0 Votes
    3 Posts
    1k Views
    J
    Thank you! I know I've created a dock item, I was planning on using it once I understood why the sizes were being ignored.
  • Highlight entire row

    12
    0 Votes
    12 Posts
    28k Views
    P
    just add one line: @ QTableView::selectionChanged(selected,deselected); @ thank you guys and appreciate all of ideas and discussion
  • Application context, or service manager

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied