Skip to content

Brainstorm

Stuck? Some ideas just need to be dumped on someone before they can materialize.
458 Topics 3.2k Posts
  • QEventLoop + QNetworkRequest = dead lock

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    So I simply needed handle one more signal: QObject::connect(reply, &QNetworkReply::errorOccurred, &loop, &QEventLoop::quit);
  • creating lib.a file from the current project

    Unsolved
    4
    0 Votes
    4 Posts
    820 Views
    V
    @jsulm Hi, I have update the project - ".pro" file and it working and building the project and I am adding the dependence for all the connect project files. Thanks
  • JavaScript references in QML

    Solved
    3
    0 Votes
    3 Posts
    830 Views
    mzimmersM
    Fixed it -- I added a bool to my parent property to tell me whether this button belongs to to the start or end panel, and I check that bool in my callback. Button { id: action buttonText: actionButtonLabel onClicked: { stackView.clear() stackView.push( actionComponent, { "listModel": scheduleActionPanel.actionModel, "listIndex": isStartPanel ? newSchedule.startAction : newSchedule.endAction, "buttonGroup": startStopGroup, "titleText": scheduleActionPanel.actionTitle, "callback": ((i) => { if (isStartPanel) { newSchedule.startAction = i } else { newSchedule.endAction = i } } ) } ) } } If necessary, the bool could be replaced by an int, and the callback logic made more elaborate.
  • Changing ABI doesn't modify effective qmake call

    Unsolved
    3
    1 Votes
    3 Posts
    1k Views
    JKSHJ
    Hi @Bradyok, and welcome! Yes, it's a bug in Qt Creator 11.0.2: https://bugreports.qt.io/browse/QTCREATORBUG-29506 It will be fixed in v11.0.3. In the meantime, you can install and use v11.0.1: https://download.qt.io/official_releases/qtcreator/11.0/11.0.1/ or use @S_M_R's workaround
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • Qt for thin GUI client

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    V
    @SimonSchroeder Thanks so much for the suggestions everyone, I truly value the input from others that are most definitely more talented than myself.
  • Call to QMessageBox::exec or show logs out from my acct in ubuntu18

    Unsolved
    3
    0 Votes
    3 Posts
    608 Views
    jsulmJ
    @Podugu You should also check Linux logs (dmesg for example). It really looks like your desktop session is terminated for some reason (I guess something is crashing). What graphics hardware and driver do you use?
  • controls that don't really "control"

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    mzimmersM
    @TomZ said in controls that don't really "control": My personal advice on the usecase where getting a new state may take more than 200ms is to have your datamodel update the state after 250ms to "waiting-for-state-B" or something (use a timer) and then the front-end can show the 3rd state, indicating that its busy doing what you requested. I agree completely -- it's just a little hard to figure out how to do this with a Switch. EDIT: I got my issue with the Switch figured out - it wasn't so much a state problem as it was my lousy model implementation (explained in painful detail elsewhere in the forum). Thanks to all for the help.
  • Insight Web Console in WebAssembly

    Unsolved
    2
    0 Votes
    2 Posts
    482 Views
    lorn.potterL
    It probably could be built using Qt WebAssembly, as it looks to be javascript based.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • kmap2qmap

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    SGaistS
    @myneur The us.kmap from that link is valid. However, it does also generate around 40 warnings as the other two do. Do you still need the qmap files ?
  • Some advice for a table application

    Unsolved
    4
    0 Votes
    4 Posts
    884 Views
    M
    @Hannibal said in Some advice for a table application: What about the first and last columns, should I merge the cell for have the same look as pics? https://forum.qt.io/topic/123343/qtableview-qtablewidget-cell-span-range Search the web and this forum, there's numerus topics on this.
  • displaying only part of model

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    mzimmersM
    @SGaist maybe it's because I'm old school, or maybe it's because I have enough trouble reading other people's code, but...whatever the reason, I prefer to explicitly derive a function's return value, assign it to a variable, and return that variable. I realize it accomplishes nothing, and in the absence of a good optimizing compiler, is actually fractionally slower, but...it's just how I roll.
  • identifying signal senders

    Solved
    17
    0 Votes
    17 Posts
    5k Views
    mzimmersM
    @TomZ I ended up taking Jeremy's suggestion, and it works beautifully. Keeps the message manager self contained and no need for state awareness.
  • This topic is deleted!

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

    Unsolved
    1
    0 Votes
    1 Posts
    11 Views
    No one has replied
  • Which QT framework for dashboard of ship

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    SGaistS
    That's good to know. In that case, depending on the fanciness you want, Qt Quick is still a good option as it allows for more visual effects and they would be easier to implement than with widgets. Otherwise the graphics view framework will also be of interest. On what kind of device will your dashboard run ? KDAB has built something for boats.
  • Implementing many-to-many relationships

    Solved
    40
    0 Votes
    40 Posts
    14k Views
    TomZT
    @mzimmers said in Implementing many-to-many relationships: Doesn't seem to me that I'd need new/delete anyway, but I do agree that it seems preferable to: create and maintain a map of Equipment objects (or structs) with a UUID as the key in the Activity object, maintain a list of Equipment UUIDs. Is this what you had in mind? The various comments here went towards using pointers to instances of classes as the relationship. Can't use a raw pointer (safely) without 'new'. If your only objects are the Equipment and the Activity, then yeah, that's pretty simple. as this got confusing, here is a very quick and dirty mockup I just wrote in 5 minutes. Apologies for the roughness. struct PActivity; struct PEquipment; class ManagerPrivate { public: std::map<int, PActivity> m_activities; std::map<int, PEquipment> m_equipments; int m_lastAssignedId = 0; }; struct PActivity { QString name; }; struct PEquipment { QString name; std::deque<int> activities; }: class Manager { public: ManagerPrivate *d; Activity createActivity(); }; // ---- class Activity { public: explicit Activity(Manager *parent, int n); Activity(); // gives invalid instance. bool isValid() const { return d && n; } QString name() const { assert(isValid()); auto i = d->m_activities.find(n); assert(i != d->m_activities.end()); return i->name; } void setName(const QString &name) { assert(isValid()); auto i = d->m_activities.find(n); assert(i != d->m_activities.end()); i->name = name; } int id() const { return n; } private: ManagerPrivate *d = nullptr; int n = 0; }; class Equipment { explicit explicit(Manager *parent, int n); explicit(); // gives invalid instance. bool isValid() const; QString name() const; void setName(const QString &name); void addActivity(const Activity &a) { assert(a.isValid()); assert(isValid()); auto i = d->m_equipments.find(n); assert(i != d->m_equipments.end()); i->activities.push_back(a->id()); } private: ManagerPrivate *d = nullptr; int n = 0; }
  • 0 Votes
    2 Posts
    485 Views
    Kent-DorfmanK
    in my 30+ years of experience taking over someone elses app usually means throwing it out the nearest airlock and doing it from scratch "correctly". The previous owner never knew what the tar they were doing. LOL
  • need suggestions for transition/animation of banner

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    mzimmersM
    @sierdzio yes, that seemed to fix it. Item { id: banner property int bannerHeight: 80 implicitHeight: (opMode.mode === OpModes.Service) || (navBar.tabIndex === 3) ? bannerHeight : 0 Behavior on implicitHeight { NumberAnimation { duration: 250 } } Layout.fillWidth: true Rectangle { id: rect anchors { left: parent.left right: parent.right } implicitHeight: parent.implicitHeight ... } } I think I need to apply a similar animation to the opacity of the contents of the Rectangle (a couple lines of text and a Button), but I get the principle now. Thanks to all for the help.