Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • 0 Votes
    5 Posts
    2k Views
    P
    Thanks for the tips. I will put them into practice, and I will try to stick to this cleaner and safer programming. Best regards.
  • [SOLVED] QTcpSocket signals problem

    2
    0 Votes
    2 Posts
    558 Views
    R
    I just realized that I was connecting my socket with another socket (p.sockets).
  • Annoying issue in console development

    5
    0 Votes
    5 Posts
    1k Views
    C
    Unfortunate not! - Thanks anyway Disassembler dump: @ Function: ntdll!DbgUserBreakPoint 0x77690008 int3 0x77690009 <+0x0001> nop 0x7769000a <+0x0002> ret 0x7769000b <+0x0003> nop Function: ntdll!DbgBreakPoint 0x7769000c int3 0x7769000d <+0x0001> ret <---STOPS HERE 0x7769000e <+0x0002> nop 0x7769000f <+0x0003> nop 0x77690010 <+0x0004> mov 0x4(%esp),
  • About multi-tasking

    2
    0 Votes
    2 Posts
    678 Views
    JeroentjehomeJ
    Hi, Yes, as you know this has to do with threading! There are very helpful QtConcurrent classes for high level multithreading or QThread for low level threading.
  • [Solved] Save for QGenericMatrix

    13
    0 Votes
    13 Posts
    3k Views
    D
    Actually the working code is the one in the post here using the cast , And if I comment that code to use @stream << myMatrix;@ Instead of writing 0100 the file contains f03f
  • Adding symbol ≥ in mysql table fails.

    3
    0 Votes
    3 Posts
    1k Views
    N
    Hi, Thank you. will try setting encoding in my.cnf and then report id it works. Greetings
  • Using MOC wihtout qmake

    2
    0 Votes
    2 Posts
    895 Views
    B
    Hi again, don't know why, but now everything works fine when I do it like that: @moc main.h moc_main.cpp g++ moc_main.cpp main.cpp -I... -L... -o main.exe@ I'm very lucky about that, so I don't have to create confusing object files or stuff... Other question: Whe I run g++ with my own executable file using command line (system("g++...");), how can I catch g++'s result (success or failure)? I need that to throw an error messagebox in case of failure... Any clues? EDIT: Solved! For everyone who is interested in it: @g++ -main.cpp -o main.exe 2> main_error.txt@ the main_error.txt will be created in case of success and also in case of failure, so you additionally have to check the contents: @ char error_buffer_1[10]; FILE *file_error = fopen("main_error.txt", "r"); fgets(error_buffer_1, 10, file_error); string error_buffer_2 = error_buffer_1; int error_buffer_length = error_buffer_2.length(); if (file_error == NULL || fgets(error_buffer_1, 10, file_error) == NULL || error_buffer_length < 1) { fclose(file_error); remove(file_error_path.c_str()); } else { fclose(file_error); cout << "compiler error occured"; system("pause>nul"); }@ :)
  • [Solved] Overwriting files when copying using QFile

    3
    0 Votes
    3 Posts
    14k Views
    L
    But "Remove, Copy" is hardly atomic, how do I ensure other processes, such as the web server never fail to find the file?
  • [Solved]How to build Qt 5.3.2 from source on OS X 10.9?

    3
    0 Votes
    3 Posts
    1k Views
    F
    Thanks so much sandy.martel. It`s works fine for me. Thanks again. You saved me.
  • Testable models and derived Table models

    1
    0 Votes
    1 Posts
    495 Views
    No one has replied
  • Searching for a particular text in a combo box

    5
    0 Votes
    5 Posts
    868 Views
    SGaistS
    One way I can is would be to use a QListModel with all your topics, then in between add a QSortFilterProxyModel where you set e.g. a QRegExp filter base on your combo box number 1 selection
  • Locals and Expressions window is blank

    7
    0 Votes
    7 Posts
    2k Views
    B
    Windows 7 64-bit, and I believe that was Qt Creator 3.1.0 and Qt 5.2.1. I installed Qt Creator "3.2.1 (opensource)" and the problem has gone away for now. I may be back later. Thanks for your help. Ron
  • How to save username and password in Qwebview

    1
    0 Votes
    1 Posts
    825 Views
    No one has replied
  • System-wide Linux Qt QSS Themes

    2
    0 Votes
    2 Posts
    2k Views
    N
    Bump. Same problem here. Actually I'd be glad to get some documentation on QSS files and the whole theming structure.
  • Unset Qt::WindowStaysOnTopHint flag problem

    6
    0 Votes
    6 Posts
    8k Views
    S
    -Had this same issue...thanks for the code above.- -Not sure why unsetting the WindowStaysOnTopHint doesn't have the expected effect...I don't think the documentation alludes to this.- After posting this noted that I only get the desired effect if a insert a breakpoint into the code. As this is slightly different to the question asked here I've posted it as a new question at http://qt-project.org/forums/viewthread/48218/ Stephen
  • QPushButton causes shadow in QFrame

    1
    0 Votes
    1 Posts
    896 Views
    No one has replied
  • [SQLLITE] - whoes (Parameter count mismatch upon Insert)

    10
    0 Votes
    10 Posts
    4k Views
    H
    Allright, revisiting this thread as I have come up with a solution to my problem, and not contributing to a closure when you have found a workaround is bad form. Basically the solution was be more competent. (even though I have no idea why my initial approach didn't work in the first place, but I digress). I scrapped the notion of running direct queries on the Sqlite database, and switched my entire codebase over to QT's model view architecture. So where my code previously looked like this: @ QSqlQuery query(this->db); if (!this->db.open()) { qDebug() <<this->db.lastError().text(); } query.prepare ("INSERT INTO inventory (name, description, category) VALUES (?,?,?)"); query.addBindValue(name); query.addBindValue(description); query.addBindValue(category); if (!query.exec&#40;&#41;) { qDebug() <<query.lastError().text(); }@ It now looks like this: @ QHash<QString, QVariant> tableInsert; tableInsert["name"] = ui->inputName->text(); tableInsert["description"] = ui->inputDescription->toPlainText(); tableInsert["category"] = ui->inputCategory->currentData().toInt(); if (!this->inventory->insert(tableInsert)){ qDebug() << this->inventory->getModel().lastError().text(); } else { ui->inputName->clear(); ui->inputDescription->clear(); ui->inputName->setFocus(); }@ The Inventory object has a QSqlTableModel attached to it, it's "insert" method reads like this: @bool Dataset::insert(QHash<QString, QVariant> values) { QHashIterator<QString, QVariant> i(values); QSqlRecord record = this->model->record(); while (i.hasNext()){ i.next(); record.setValue(i.key(), i.value()); } this->model->insertRecord(-1, record); return this->model->submitAll(); }@ (where the model object is offcourse an instance of QSqlTableModel). This way I not only get more readable code, but I manage to abstract the code into a more logical workflow. Let me know if you have any comments or suggestions for improvement
  • This topic is deleted!

    3
    0 Votes
    3 Posts
    1k Views
  • QUdpSocket not sending

    4
    0 Votes
    4 Posts
    2k Views
    B
    Good idea. I get "Unknown error".. that is all! Not a very helpful message!
  • [ABANDONED] Best way to design model + TableModel using ORM

    3
    0 Votes
    3 Posts
    2k Views
    M
    Thank you for your advices I note qxorm (which I've explored a little)