Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • QPushButton onClick without explicit connect-call

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    matthew.kuiashM
    @Torsten-S. No problem. Have a nice day!
  • Unwanted vertical offset with with QRubberBand

    Unsolved
    18
    0 Votes
    18 Posts
    6k Views
    mrjjM
    @Bidski Hi Not in Qt. ( maybe if old) I would guess from the attempt to snap the coordinates but cant say for sure. However, please see this sample https://www.dropbox.com/s/gp9rvylkb18xnl3/myrubberband.zip?dl=0 [image: Cqi71U.png] Drag the rubberband and release It cuts what is expected and show in label So all seems to be fine :) #include <QMouseEvent> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); move_rubberband = false; rubberBand = new QRubberBand(QRubberBand::Rectangle, this); rubberBand->setGeometry(0,0,50,50); rubberBand->show(); } void MainWindow::mousePressEvent(QMouseEvent *e) { if(rubberBand->geometry().contains(e->pos())) { rubberband_offset = e->pos() - rubberBand->pos(); move_rubberband = true; } } void MainWindow::mouseMoveEvent(QMouseEvent *e) { if(move_rubberband) { rubberBand->move(e->pos() - rubberband_offset); } } void MainWindow::mouseReleaseEvent(QMouseEvent *e) { move_rubberband = false; QRect r=rubberBand->geometry(); rubberBand->hide(); QPixmap p=grab(r); // no need for mapTo here. ui->label->setPixmap(p); rubberBand->show(); rubberBand->raise(); }
  • ERROR:ASSERT: "uint(i) < uint(size())"

    Solved
    6
    0 Votes
    6 Posts
    9k Views
    M
    @isan You are welcome :)
  • Drag n Droop functionality in db mapped QLabel

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    P
    Thank you for your time SGaist, have a nice day.
  • libEGL.dll under Qt commercial license

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    Angela_1234A
    I think I found the answer http://doc.qt.io/qt-5/licenses-used-in-qt.html
  • QPushButton inside a tab of QTabWidget

    Solved
    13
    0 Votes
    13 Posts
    4k Views
    O
    @o6a6r9v1p Got the problem, the label is to declared public. it is working fine. Thanks to all
  • Delete a line in text file

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    JulianJ
    thank. That's what I thought
  • QMYSQL driver not loaded

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    SGaistS
    You're welcome ! Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)
  • Starting Drag from QListWidget initiates Unwanted Selection

    Unsolved
    4
    0 Votes
    4 Posts
    743 Views
    SGaistS
    I'd recommend rather implementing your own list model based on the drag and drop model described here. That will likely make your implementation simpler and cleaner.
  • QTableView shows nothing

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    T
    @mrjj said in QTableView shows nothing: @t0msk Yes You do QSqlQueryModel query; .. ui->tableView->setModel(&query); Here you use & to take adress of it. So as soon as function ends query is deleted and view is empty. You could move QSqlQueryModel query; to .h file. as member in mainwindow Ah, thank you for explanation :)
  • QNetworkAccessibleChanged Signal not working

    Unsolved
    2
    0 Votes
    2 Posts
    340 Views
    mrjjM
    Hi Can you provide some code and details about platform and Qt version. "kosomkooooooooooooooooooooooooooooooooooooooooooooo" is not particular useful :)
  • 1 Votes
    10 Posts
    2k Views
    SGaistS
    You aren't working on Windows, are you ? Because, in the detailed description there's a note stating that it's a feature not supported on Windows platform.
  • How to get the socket from a socket error signal

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    kshegunovK
    To be completely frank, I'd just have a session object where I have the socket and whatever's needed for the communication. So your original question is a bit unusual from my perspective. For example you could take a peek here and here.
  • Drag & Drop Question: "Accessing QMimeData directly"

    Solved
    2
    0 Votes
    2 Posts
    345 Views
    ModelTechM
    I got it to work with a const_cast ...
  • Cannot insert new record when database is empty

    Solved
    6
    0 Votes
    6 Posts
    726 Views
    P
    At last I found it! I had it like this: int row = mapper->currentIndex(); Replaced with: int row = model->rowCount(); and works fine!!
  • Remove row while model (QSqlRelationalTableModel) is dirty

    Solved
    3
    0 Votes
    3 Posts
    505 Views
    P
    But the model>isDirty() remains true... How can I make it become false? I tried: mapper->submit(); model->submitAll(); model->submit(); but they fail. EDIT: model->revertAll() seems to set isDirty to false.
  • Pop up a new window on a pushed button

    Solved button slots connect window
    6
    0 Votes
    6 Posts
    43k Views
    A
    Yep, it works. Thanks :)
  • Problem to save text edit content to a file

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    mrjjM
    hi i would try stream << "TEST TEST"; and see.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • windeploy not working?

    Locked Unsolved
    2
    0 Votes
    2 Posts
    588 Views
    kshegunovK
    Don't post it anew, you already have a thread. Have patience to collect answers, some of us live 12 hours worth of timezones apart. If you get nothing in a couple of days you can bump your thread up by posting at the end.