Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • QAbstractItemModelReplica data issue

    Unsolved
    3
    0 Votes
    3 Posts
    278 Views
    rincewindR
    The only workaround I can find at the moment is to wait for a second or two before trying to read the data from the model. It seems the data is only "fetched" later, but no model signals are emitted once the data is fetched. So, supplying the model to a view doesn't work as the view doesn't get notified to refresh once the data is fetched.
  • How to build Qt6 from source for arm and intel on macOS

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    M
    https://bugreports.qt.io/browse/QTBUG-113694
  • QSystemTrayIcon does not disappear on MacOS

    Solved
    5
    0 Votes
    5 Posts
    652 Views
    S
    @mpergand Hey! Since there were no issues while debugging and I have migrated to Qt 6.5, I will mark this topic as solved, because the issue no longer exists after the migration. Thank you for the useful hints!
  • How to set the QTabWidget background image when there is not any widget page

    Solved
    18
    0 Votes
    18 Posts
    2k Views
    HansonH
    @Bonnie Nice!It works.Thank you very much!
  • Failed to run cube demo on xcb_egl in Qt5.12.5

    Unsolved
    3
    0 Votes
    3 Posts
    322 Views
    L
    The segment error statement is located under the qxcbeglwindow.cpp file: qt-everywhere-src-5.15.9/qtbase/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp m_surface = eglCreateWindowSurface(m_glIntegration->eglDisplay(), m_config, m_window, nullptr); [image: bf6688e9-5902-45c6-8732-0fbef013fcda.png] Found that this function is an egl universal interface, I do not understand this aspect of the problem, who can solve the confusion?
  • Method for Connecting Button to Method

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    Axel SpoerlA
    @tfre Good that you have found a pragmatic solution. Maybe mark the thread solved. Just two practical hints. (1) In case you want to connect to a signal from a class that (for overhead reasons) doesn't inherit from QObject: You can connect to a lambda wrapper, that calls a member function: // Wrap member function in a lambda to avoid inheriting from QObject auto wrapper = [this](const QString &arg){myMemberFunction(arg); }; const auto result = QObject::connect(myLineEditPointer, &QLineEdit::textChanged, wrapper); qDebug() << __FUNCTION__ << __LINE__ << result; (2) Debug QObject::connect()doesn't fatal out if the connection fails. I find it very helpful to qDebug()its return value (see above). Guess why I find it so helpful: Because I occasionally miss the obvious. Just like you :-)
  • Encoding an image to webp will distort the colors.

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    M
    @SGaist I solved it. you were correct. thank you. And thank you everyone. std::unique_ptr<QImage> unique_img(new QImage(reader.read())); if (unique_img->isNull()) { throw std::runtime_error("Cannot create image from file"); } /* new add */ **QImage convertedImg = unique_img->convertToFormat(QImage::Format_RGBA8888);** int width = convertedImg.size().width(); int height = convertedImg.size().height(); // Encode the image data with the configured options uint8_t* output; output = nullptr; size_t output_size = WebPEncodeRGBA(reinterpret_cast<uint8_t*>(convertedImg.bits()), width, height, width * 4, 80, &output);
  • Graphics Scene data connect to SQL data

    Unsolved
    10
    0 Votes
    10 Posts
    979 Views
    N
    @JonB Let's take the above diagram itself. This diagram is very much like the diagram I want to draw. It has a set of boxes connected by arrows. Now if we want to save this information in a relational database, we need to break it down to data tables. The data tables will consist of two tables; A list of boxes and a list of connections. Table 1: Box1 Box2 . Table 2: Line1, From Box1, To Box2 Line2, From Box3, To Box4 etc. The list of connections in Table 2 need to refer to the list of boxes to store the connection information. That is where the relational table model comes in. It will combine Table 1 and Table 2 and compile the data into one. The Tree Model is to display Some boxes containing other boxes recursively. That was drawn to show that multiple views will access the same data through different models.
  • How to save a QIcon in a settings.ini using QSettings?

    Solved
    13
    0 Votes
    13 Posts
    849 Views
    D
    I have been able to get it working as: To save the icon in the settings: QIcon icon = pushButton->icon(); if (!icon.isNull()) iniSettings->setValue(key, icon.pixmap(32, 32)); And to load: QIcon icon = iniSettings->value(key).value<QPixmap>(); if (!icon.isNull()) pushButton->setIcon(icon);
  • QWidget: Cannot create a QWidget without QApplication

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    W
    @Krishna-B said in QWidget: Cannot create a QWidget without QApplication: The same approach we have followed in QT4 and it was working fine. Can anyone let me know the reason for this behavior in Qt5.12. Multiple threads touching the GUI never worked fine in Qt4 and was never supported. You may just not have been getting "lucky" in not seeing it crash, but you may also have been experiencing things like weird data corruptions that weren't immediately obvious. There's a large gap between "appears to work on my machine" and "is correct."
  • Disabled appearance icons

    Unsolved
    2
    0 Votes
    2 Posts
    302 Views
    Christian EhrlicherC
    An unavailble icon is create with the help of QStyle::generatedIconPixmap() - so if you want to modify it you should create a QProxyStyle and override this function.
  • The titlebar is not displayed

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    JoeCFDJ
    @Renio You may try 6.5.1 which just came out 5 days ago. The issue might be fixed in this release.
  • Creating a timeline widget in Qt?

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    A
    @mrjj said in Creating a timeline widget in Qt?: https://github.com/arsdever/timeline this one seems a little special. As the creator, owner and maintainer of the repo you mentioned, I wanted to say that I was working on improving the repo recently. There should be a branch called #model-view-approach, which implements the things in model/view approach, so the future readers, please, check that out.
  • Leaked memory object

    Solved
    5
    0 Votes
    5 Posts
    504 Views
    PerdrixP
    @sierdzio I managed to get an stack trace by changing the vld.ini file to log in Unicode and to a file, instead of in ascii to the debugger. That did produce the necessary stack trace! The leak turned out to be a "ui" object that belonged to a QDialog that was created with the application QMainWindow (which was a stack object in main()) as its parent. I don't understand why that was done rather then making the object that created it the parent (I need to discuss that with the developer). I don't quite understand why it wasn't cleaned up when the QMainWindow went out of scope at the end of main(). Thanks all, David
  • Using variables ending with numbers

    11
    0 Votes
    11 Posts
    2k Views
    JonBJ
    @AdamHynes ...Might interfere with people's ability to write good Qt code... ;-)
  • Qt not executing after connecting with server

    Solved
    6
    0 Votes
    6 Posts
    445 Views
    JonBJ
    @azhagan2 Then nobody can tell from the detail you have given so far, produce a minimal reproducible example.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    32 Views
  • QT Licenses

    Unsolved
    2
    0 Votes
    2 Posts
    193 Views
    sierdzioS
    @JuanM said in QT Licenses: Good afternoon, I would like to know about QT licenses. I would like to develop a QT based app liking dinamically qt libraries. I'm not sure if I have to pay or not if I would in the future make money with the developed app. If you fulfill LGPL requirements and use LGPL parts of Qt, then you don't need to pay for license and you can make money with your app. I also would like to use QT creator IDE with Qt5. ¿Is there any necessity of paying for using this IDE with Qt5? No need to pay for Qt Creator.
  • How to set QPdfView's viewport background color?

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    C
    @ChrisW67 Thanks a lot! This clarifies it for me.
  • :-1: error: [Makefile.Debug:11324: debug/DebugQt.o] Error 1

    Unsolved
    2
    0 Votes
    2 Posts
    320 Views
    SGaistS
    Hi, No, there's not enough information to tell. You likely have more lines on top of this one giving clues about what is happening ?