Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.3k Posts
  • This topic is deleted!

    Unsolved
    9
    0 Votes
    9 Posts
    52 Views
  • How do deal with external changes to a model

    Unsolved views models columns qt 5 qt widget
    4
    0 Votes
    4 Posts
    995 Views
    F
    An update on this from my side: My initial approach wasn't flawless, as @VRonin pointed out, because QAbstractItemModel::columnCount didn't return the appropriate values. I've fixed this, by not immediately passing the new count after inserting the elements to a list, of which the size was used, but instead have the model save exactly how many categories it currently accounts for, so the connection looks like this: connect(item_registry.get(), &item_registry::category_added, [this](int position, QSharedPointer<category>) { beginInsertColumns(QModelIndex{}, position, position); _current_category_count++; endInsertColumns(); }); and likewise columnCount: int item_model::columnCount(QModelIndex const&) const { if(!_register) { qCritical() << "Item-model didn't have a register"; return 0; } return 1 /* name */ + _current_category_count; }
  • Layered Views

    Unsolved
    10
    0 Votes
    10 Posts
    662 Views
    F
    I'll try to give as much concise information as I can: The data is (almost always) generated by the user - an exception to this would be a shipped demo project, and in the future perhaps plugins. Children only ever have one parent, but parents can have multiple children. So it's a true 1:n relationship. The user can create parents, and assign children to them, as well as delete and reorder them. Both parents and children are part of a project's state, which is persisted through multiple iterations using messagepack. You can load a project at any time, which would completely switch out the data the program is currently using - similar to how you'd be able to with word/pretty much any IDE. Can't think of anything else that could be relevant - thanks for taking the time btw!
  • 0 Votes
    4 Posts
    2k Views
    A
    @jsulm Hello! Sorry, but that doesn't work. I tried to insert a loop in different places, but the result remains the same. I also tried to display the main widget. [image: 28c1a758-71f9-4787-b168-f698dfe99275.png] @SGaist Hello. So the VideoWindow.h file (VideoWindow class) is my custom widget. This is the first piece of code that I presented.
  • QGridLayout only showing last grid occupied

    Unsolved
    10
    0 Votes
    10 Posts
    753 Views
    SGaistS
    What I was suggesting is to have one QGLWidget per QGraphicsView you want to accelerate.
  • Widget crops while rotating about its center

    Unsolved
    4
    0 Votes
    4 Posts
    257 Views
    SGaistS
    The complete widget code would be nice to recreate the situation locally.
  • widget "leave" event /"focus out" event

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    SGaistS
    Why would the parent lose a focus it didn't have in the first place ? In any case, with your additional explanations, I understand better what you want which makes it way less "surprising". Are all your controls grouped in group boxes ?
  • QMainWindow swap Central Widget or QStackedWidget

    Solved
    2
    0 Votes
    2 Posts
    437 Views
    SGaistS
    Hi, Why do you need to put them out of the stacked widget ? Implement them so that you can refresh/reset them so you only have one instance of each and be done with it.
  • QFileDialog / CoCreateInstance failed

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    S
    After some heavy detective work, I found the cause to my problem. Cute Qt was free of guilt as expected, and this problem is very specific to our app. But I am leaving here a description of the resolution just in case somebody else ever hits something similar. Our software makes use of Intel's Embree. And there is a pair of rtcNewDevice/rtcReleaseDevice calls to init and dispose of resources used by said library. We use Embree to build some raytracing structures that are indeed dependent on document size (number of objects/primitives). For some reason, starting at some (consistently the same) high number of objects, COM is affected badly within this sandwich of New/Release calls. The effect is that services such as Drag & Drop and very specially the native file Open/Save dialogs (wrapped by QFileDialog) are left inoperable. In the very case of our app, creating and disposing of the Embree device only when it is about to be used, instead of once per document was enough to fix my problem. I haven't found anything online about this. But our particular problem is gone now. Thank you for your replies!
  • How to use url in QT style sheets

    Unsolved
    6
    0 Votes
    6 Posts
    836 Views
    mrjjM
    @bemlun Hi Your syntax indicates you are using an resource file ( the ":/" ) However, the project seems not to contain one. please see here https://doc.qt.io/qtforpython/overviews/resources.html I normally recommend using a resource file for icons. But since its python im not sure it has the same benefits :)
  • 0 Votes
    5 Posts
    513 Views
    Pablo J. RoginaP
    @Diren said in QUdpSocket.readyread is not emitting when QCoreApplication not created from main thread.: it works. time to mark your post as solved then? thanks.
  • Add custom QWidget to QListWidget

    Unsolved
    1
    0 Votes
    1 Posts
    250 Views
    No one has replied
  • Can we remove Dialog or Mainwindow written on the top of Application output.

    Solved
    34
    0 Votes
    34 Posts
    5k Views
    JonBJ
    @Ashutosh_Sachdeva Assuming you mean you have changed over to QStackedWidget, isn't it nicer/cleaner than all those show/hides yourself? And it makes code easier to follow. :)
  • format stream output

    Solved
    5
    0 Votes
    5 Posts
    560 Views
    JonBJ
    @LeLev https://doc.qt.io/qt-5/qstring.html#arg is the overload you want for strings, use fieldWidth argument (negative number if you want left-aligned as per your example). Tabs are quick and work till they don't (depends on number of characters determining where the next tab stop is).
  • how to import .net dll libraries in project

    Unsolved
    3
    0 Votes
    3 Posts
    458 Views
    VRoninV
    Also make sure you are compiling with the /clr option on
  • QTQuickItem and QT_SCALE_FACTOR

    Unsolved
    1
    0 Votes
    1 Posts
    117 Views
    No one has replied
  • Reading rows from qtableview and using them to draw in new window

    Solved
    12
    0 Votes
    12 Posts
    487 Views
    T
    Thank you very much, I managed to finally do it.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • How to have path names that include spaces in .pro file?

    Unsolved
    2
    0 Votes
    2 Posts
    353 Views
    aha_1980A
    @kitfox Putting the path in quotes is usually enough. But the best advice I can give you: avoid spaces at all. Rename the directories to have proper ASCII names without spaces will save you a lot of trouble. Also blame the library vendor so he becomes aware of the problem. Regards
  • Signal and slot from other class not working

    Solved
    29
    0 Votes
    29 Posts
    5k Views
    jsulmJ
    @Ucn_ Don't you have send as class member? Regarding error: simply remove & in front of send in connect as send is now already a pointer. QObject::connect(send, SIGNAL(valueChanged()), SLOT(someFunction()));