Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k Posts
  • gui not showing, or closing to fast to see

    Solved
    40
    0 Votes
    40 Posts
    6k Views
    jsulmJ
    @micha_eleric said in gui not showing, or closing to fast to see: where is build in qt designer? There is no build in QtDesigner. You build your project in QtCreator. And you also should rather edit ui files in QtCreator (QtDesigner is integrated there)...
  • Will this even work - why using QTConcurrent in first place ?

    Unsolved
    9
    0 Votes
    9 Posts
    830 Views
    A
    @AnneRanch AnneRanch about 4 hours ago @MrShawn said in Will this even work - why using QTConcurrent in first place ?: I have been looking at your suggestion, unfortunately I cannot "reply " again since I did once. So hopefully you will find this. From academic point of view - I was under the impression that QTConcurrent is a "wrapper" of "low level stuff " - likes thread. As such I expected KISS . The limits of passing "only" max of 5 parameters was a bad indicator of things to come. My main "complain " is the barrage of nothing saying errors. It actually started by saying - the results have failed , and said nothing what the possible source of the failing results are. The QTConcurrent needs QFuture and QFutureWatcher to be useful... I am not a total idiot - I have been writing code since 1975 , I have done some QA ( for living) and cannot stand " I did not know what it did so I deleted it " Replacing failing code with "better (and more complex) code " is not my idea of troubleshooting. Enough ranting , it does no good anyway . I'll try plain "new thread " next... \
  • progress bar to show the process of adding item to list view

    Unsolved
    8
    0 Votes
    8 Posts
    795 Views
    JonBJ
    @kook said in progress bar to show the process of adding item to list view: @Christian-Ehrlicher yea the data i am appending to the list is more like this That's not really the point though. Just how many (approximately) list.append()s are you doing? Like 100,000? Or what sort of number? How many messages? (Just the 2 fields you show are added per message?)
  • result of QProcess and Windows cmd is not the same - why?

    Solved
    13
    0 Votes
    13 Posts
    762 Views
    LeoCL
    Sorry for not comming back earlier. I was forced to do some other things in between... But it seems that doing something different for 3 weeks was the right thing to do. I opened the project again, checked every line , adjusted it a bit (including the proposal of @KroMignon ) and now... it works :) Thanks to everyone involved here.
  • QChart legend labels don't reflect the sequence of QPieSeries labels.

    Unsolved
    1
    0 Votes
    1 Posts
    200 Views
    No one has replied
  • Accessibility

    Solved
    4
    0 Votes
    4 Posts
    262 Views
    SGaistS
    Which version of Qt are you using ? On which platform ?
  • How to include a macOS .framework file in Qt creator "qmake"

    Unsolved
    14
    0 Votes
    14 Posts
    4k Views
    U
    I think my issue is not with linking the library itself and I apologize for that. the question that would solve my problem is, what is the equivalent of xocde's "Runpath Search Path" for qmake?
  • Adding buttons to Table

    Solved
    5
    0 Votes
    5 Posts
    465 Views
    I
    Thank you.
  • Program crash when iterating over dirs with recursion

    Solved
    5
    0 Votes
    5 Posts
    406 Views
    artwawA
    Ok, that was one of my less stellar moments, I somehow overlooked to check for repeated paths... Also, I was absolutely oblivious to the existence of QDirIterator! HOW. Thank you @SGaist @mpergand The idea was to first recurrently check for existing folders and dive into them to the very bottom, hence path() without the filename was what I needed. Once the routine is out of folders it was supposed to get the file paths - again, idea was that the list is already sorted from the deepest point and ends up with the top-level files. The idea is moot since I was indeed trying (and failing) to reinvent the wheel. Thank you all for pointing out my mistakes but I will mark @SGaist's post as the solution, as he provided me with (Yet Another Useful Class) what I will use. Thank you!
  • Warning shown in QT. Should I be worried about it? Or can I choose to ignore it?

    Unsolved
    2
    0 Votes
    2 Posts
    174 Views
    Christian EhrlicherC
    You should worry about it. Don't open the database more than once and then use QSqlDatabase::database() to retrieve the db connection (if you really need it)
  • FTP in Qt

    Unsolved
    2
    0 Votes
    2 Posts
    233 Views
    Christian EhrlicherC
    From a short look this is now all in QUrl and QFileInfo
  • 0 Votes
    5 Posts
    337 Views
    T
    The core code looks like this, but the returned click coordinates is incorrect .... // mouse press event void mousePressEvent(QMouseEvent *e) { w_pos = e->globalPos(); // get current position qDebug("Click pos - X: %d ,Y: %d", e->x(), e->pos().ry()); qDebug("Click globel pos - X: %d ,Y: %d", e->globalPos().rx(), e->globalPos().ry()); qDebug("Widget size - X: %d ,Y: %d", this->size().width(), this->height()); qDebug("w_pos value - X: %d, Y: %d", w_pos.rx(), w_pos.ry()); // change mouse cursor if(this->hasFocus()) { qDebug("Cal X-: %d, X+: %d, Y-: %d, Y+: %d", this->width() -BLOCK_SIZE, this->width(), this->height()/2-BLOCK_SIZE, this->height()/2+BLOCK_SIZE); qDebug("Widget frame pos X: %d, Y: %d", this->frameGeometry().x(),this->frameGeometry().y()); qDebug("Widget pos X: %d, Y: %d", this->mapToGlobal(this->pos()).x(),this->pos().y()); qDebug("Widget Geometry X: %d, Y: %d", this->geometry().right(), this->geometry().left()); if(e->pos().rx() >= this->width() -BLOCK_SIZE && e->pos().rx() <= this->width() && e->pos().ry() >= this->height()/2-BLOCK_SIZE && e->pos().ry() <= this->height()/2+BLOCK_SIZE) { qDebug("click right block"); // change cursor this->setCursor(Qt::SizeHorCursor); block_pos = "right"; } } // redraw this->update(); } // mouse move event void mouseMoveEvent(QMouseEvent *e) { if(block_pos == "right") { // left drag // button QRect rect = m_pb->geometry(); rect.setRight(rect.right() + (e->globalPos().rx() - w_pos.rx())); w_pos = e->globalPos(); / m_pb->setGeometry(rect); // widget QRect rectW = this->geometry(); rectW.setRight(rectW.right() + (e->globalPos().rx() - w_pos.rx())+BLOCK_SIZE); this->setGeometry(rectW); } // redraw this->update(); } // mouse release event void mouseReleaseEvent(QMouseEvent *e) { // switch mouse cursor this->setCursor(Qt::ArrowCursor); } ....
  • How to fix button size when I stretch layout?

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    jsulmJ
    @Hoin said in How to fix button size when I stretch layout?: I want to fix button size Then use https://doc.qt.io/qt-5/qwidget.html#setFixedSize
  • How to parse a json file without a key?

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    D
    @jsulm thanks a lot... Solved this issue. **QByteArray json_bytes = json_msg->toLocal8Bit(); QJsonDocument doc = QJsonDocument::fromJson(json_bytes, &err); QJsonArray jsonArray = doc.array(); QJsonValue abc = jsonArray[0]; qDebug() << "abc:" << abc << "type : " << abc.type(); abc = jsonArray[1]; qDebug() << "abc1:" << abc << "type : " << abc.type(); abc = jsonArray[2]; qDebug() << "abc2:" << abc << "type : " << abc.type(); for (auto it = jsonArray.constBegin(); it != jsonArray.constEnd(); ++it) { const QJsonValue &val = *it; QJsonObject o = val.toObject(); for (auto oIt = o.constBegin(); oIt != o.constEnd(); ++oIt) { qDebug() << "Key:" << oIt.key() << ", Value:" << oIt.value().toString(); } }**
  • 0 Votes
    2 Posts
    606 Views
    JonBJ
    @TimothyJ said in Error in qthread.h when compiling: std::invoke': no matching overloaded function found: The version of QT that I'm using is 5.15.8. Since that is a commercial-only version shouldn't you ask TQtC?
  • why overriding paintEvent in MainWindow doesn't work

    Unsolved
    3
    0 Votes
    3 Posts
    335 Views
    SGaistS
    Hi and welcome to devnet, Since you have a ui file, any chances you have a widget set as central widget of your QMainWindow based class ?
  • How to Accept/Reject an InternalMove in a QTreeView

    Unsolved
    5
    0 Votes
    5 Posts
    451 Views
    SGaistS
    Hi and welcome to devnet, Since it's GUI related, you should implement a custom tree view. There you have the logic that will check whether the index under the mouse is a valid target.
  • Qt Installer Framework - Don't uninstall specific files or folders?

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    M
    Could you find a solution to this? I have the same issue as well couldn't figure out a solution @Trapezoid_Dreams
  • [Solved] Using constants in several cpp files

    11
    0 Votes
    11 Posts
    6k Views
    P
    @Chris-Kawa You Kidding? Your explanation was very interesting, clear and easy to understand. Thank you very much. I loved the below line, "Please compiler, don't create an object of this variable. I'm just hinting to you that there will be a variable like this somewhere in the program but let linker worry about it. Just pretend it's defined but don't define it yourself."
  • How to display multiline messages in QTableView ?

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    I
    @SGaist Let me just post my model.