Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.3k Posts
  • Qt mediaplayer and gstreamer pipeline

    Unsolved
    3
    0 Votes
    3 Posts
    451 Views
    SGaistS
    Hi, Can you explain how you manage your GStreamer pipeline ?
  • QTextListFormat size

    Unsolved
    1
    0 Votes
    1 Posts
    184 Views
    No one has replied
  • 0 Votes
    3 Posts
    694 Views
    L
    @mrjj Thanks, so I hit the limit. I'll try not to go over that.
  • QAbstractItemModel::endInsertRows message in terminal

    Solved
    6
    0 Votes
    6 Posts
    720 Views
    U
    EDIT: i found this issue, beginInsertRows should take parent index, not parent of parent. i found more details on the issue. so i have two level tree view: a |_a1 |_a2 |_... b |_b2 the problem occurs when i expand a first level node, e.g. a, and i get the message when the expanded node happens to be near the bottom. when i moved the same node near top, there's no message in terminal. so i guess the 123 i'm getting actually refers to first level item population, and not for expanded node. but see, it says ( 123 , 0 ) i.e. first column, so why is it happening when i expand the node? seems it is trying to insert expanded node's children as first level items, but first level items (rowCount()) are less than 123
  • Drag and Drop different item text in two QListWidgets

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    B
    @Mr-Workalot Hmm..I tried to find an easiest way to handle this... The QDataStream decode/encode thing may need to subclass the model, too. So I think you just let it drop in the normal way, and then change it. protected: bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action) { if(QListWidget::dropMimeData(index, data, action)) { if(QListWidgetItem *dropped = item(index)) { dropped->setData(Qt::DisplayRole, dropped->data(Qt::UserRole)); } return true; } return false; } This is only working when you'll only accept drops from a item which you need to change its text to its Qt::UserRole. If you want to accept drops from other items, you may need to add some conditional statements.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • Building a project with MSVC2013

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    C
    @mrjj Unfortunately I cannot get the projects in the installation's examples folder to run, either. I'm getting the same issue as with the actual project I pulled. When trying the MSVC2013 64-bit kit in QT 5.9.0, I'm getting plenty of linker errors related to libusb and to the API of the device this program eventually communicates with (FX3). I don't know if it helps, by the way, but this is what I'm trying to build. These errors are very reminiscent of the ones I got with the latest version of Qt with MSVC2019 64-bit. Swapping to MSVC2019 32-bit, building libusb separately in Visual Studio, and replacing the .lib files directly with this new build allowed me to build with MSVC2019 32-bit (but with the suspicion the program doesn't work because of this configuration). That's why I was trying to stick with MSVC2013 32-bit.
  • Has anyone gotten QSerialPort to work with a USB-to-serial adapter?

    Solved
    5
    0 Votes
    5 Posts
    784 Views
    K
    JUST FOR INFO: I'm afraid that it is impossible to do a fixing anymore on an OSX OS from my side. Because I use now an AMD CPU.. )) So, maybe someone in future can fix a future bugs related to OSX..
  • 0 Votes
    2 Posts
    286 Views
    M
    Found the solution by myself. You need to exec the QSqlQuery object BEFORE set it in QSqlQueryModel object then the model is updated and signal it to the connected QSqlTableView QSqlDatabase mySqlDatabase; QSqlQuery sqlQuery(mySqlDatabase); sqlQuery.prepare("select id, name from mytable where name = :searchstring") sqlQuery.bindValue(":searchstring", "Peter"); if (sqlQuery.exec()) { sqlTableModel.setQuery(sqlQuery); }
  • QPrintPreviewDialog does not show arabic caracters correctly

    Unsolved
    1
    0 Votes
    1 Posts
    120 Views
    No one has replied
  • How to convert QIcon::fromTheme to Pixmap?

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    K
    @mrjj said what does https://doc.qt.io/qt-5/qicon.html#isNull say ? No I'm on Windows, I use setThemeName. Thanks for the tip with isNull(), I completely overlooked it since it appeared to be working on the face of it (icons would show, they just wouldn't convert to pixmap), it turns out it was returning true in every case. I moved my search paths and set theme name code higher up in main.cpp, this changed isNull to false in every case. The program is huge (not mine) and main is about 1000 lines so I don't fully understand why that happened yet, but converting to QPixmap now works it seems. Thanks! I'll be back if it fails in my functions.
  • remove space around qToolButton

    Unsolved
    19
    0 Votes
    19 Posts
    2k Views
    mrjjM
    Hi Sadly no. If you want such things, make a custom button that does it. However, Qt has support for HIRES displays that do scaling etc. and QIcon can have hires version to be used on such displays https://doc.qt.io/qt-5/highdpi.html but this has nothing to do with you want icon to cover all of the button at all times :) That is not a hires thing, in my opinion :) here is example of custom button https://stackoverflow.com/questions/31742194/dynamically-resize-qicon-without-calling-setsizeicon It scales the cion to fit at any given time. As you can see its not much code.
  • Avoiding name clashes with Qmake if two files in project have the same name.

    Unsolved
    6
    0 Votes
    6 Posts
    762 Views
    mrjjM
    @sandro4912 hi yes since all output goes to the same folder, having files with the same names will overwrite each other .o file. So basically its just a bad idea that will come back and hurt you. :) Why have namespaces when they are not usefull. They are used to avoid name clash for types internally. Not to protect from name clash on files. at one point in time one could do CONFIG += object_parallel_to_source or CONFIG += object_with_source https://stackoverflow.com/questions/9450225/why-does-qmake-put-all-object-o-files-to-one-directory But Moc dont understand this so if Qt based classes, its a no go. I thought with the folder system and the namespace I can avoid long names. Is there really no way? What long names ?
  • QColorDialog doesn't preview alpha

    Unsolved
    1
    0 Votes
    1 Posts
    642 Views
    No one has replied
  • TableView, SQLite, QSqlRelationalTableModel

    Unsolved
    3
    0 Votes
    3 Posts
    281 Views
    C
    Thanks, will give that a shot... ( still learning the classes ). Thanks!
  • When Clicking Combobox The Whole Window Is Moved to That Location

    Unsolved
    3
    0 Votes
    3 Posts
    473 Views
    L
    @jsulm No because it is saying if it is not the box I want to be dragged then to not do anything essentially, currently it all works other than when i click a combo box it bugs out.
  • Using Community instead of Evaluation

    Unsolved
    1
    0 Votes
    1 Posts
    121 Views
    No one has replied
  • Is it a difference where I compile a code?

    Unsolved compile
    19
    0 Votes
    19 Posts
    3k Views
    Pablo J. RoginaP
    @TomNow99 I guess you may want to take a look at this library: lwext4 Although "The main goal of the lwext4 project is to provide ext2/3/4 filesystem for microcontrollers" documentation also mentions compilation for Windows. And then take a look at project ext4-browser which relies on that library to provide "a file-archiver like utility which can create, read and modify ext2/3/4 disks and disk images on Windows and Mac OS systems." although the GUI is written using wxWidgets framework. So getting back to my suggestion, I guess you might combine lwext4 library and the ext2read GUI to achieve your goal...
  • Wrong OpenGL viewport of widget inside QDockWidget

    Solved
    7
    0 Votes
    7 Posts
    653 Views
    Jaime02J
    I found the problem: There was missing a QOpenGLWidget::resizeEvent(event); statement at resizeEvent.