Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. dynamic

    Log in to post
    • All categories
    • O

      Solved How to create a LineChart without knowing the amount of needed QLineSeries until runtime?
      General and Desktop • qtcharts linechart dynamic c++ • • orsini29

      5
      0
      Votes
      5
      Posts
      96
      Views

      O

      @JonB

      But you talk about "The purpose is to have different lines/coloring for each line". That implies to me you do want multiple, separate line series, each with their own points and color?

      Yes.

      In that case you do want new QLineSeries created each time round the loop, so you end up with 5 lines (and get rid of the wasted one outside the loop).

      Okay, thank you. I did this and with a little bit of refactoring I got it to work as expected. Appreciate the assistance!

    • Y

      Solved Building on OSX Catalina and deploying on Monterey with dynamic libs
      Tools • macdeployqt macos deploy dynamic • • Yergin

      2
      0
      Votes
      2
      Posts
      203
      Views

      Y

      I've managed to deploy a test app from Monterey which works on Catalina and Monterey and given up on building on Catalina after spending a few days trying to fix the result of macdeployqt using otool and install_name_tool.

      It seems that the CMake qt_generate_deploy_app_script method doesn't work when run from Monterey either. Running the macdeployqt utility almost works out of the box, it just leaves the plugins' RPATH pointing to a nonexistent 'lib' folder where it expects Qt frameworks to be. Rather than fix the RPATH's in each of those plugin libs, adding a 'lib' symlink pointing to the Frameworks folder seems to do the trick.

      In case it's useful to anyone, I've made a template repository on GitHub with this solution. The template allows you to deploy apps with LGPL Qt on Mac and Windows and use VSCode as an IDE rather than QtCreator:

      https://github.com/yergin/qt-cmake-vscode

    • D

      Unsolved Mac, Static lib, Dynamic lib Lost signals!
      General and Desktop • static staticlibrary dynamic dynamiclibrary mac • • Dariusz

      13
      0
      Votes
      13
      Posts
      592
      Views

      SGaist

      Libraries that are shared between plugins and executable shall be shared and not static. Otherwise you will end up with multiple definition of the static meta object of your QObject based classes which is not good.

    • W

      Unsolved QGraphicsTextItem dynamic resizing
      General and Desktop • qt5 qgraphicstextit resize dynamic • • wazzdaman

      1
      0
      Votes
      1
      Posts
      302
      Views

      No one has replied

    • S

      Unsolved How to display popup window when hovered on dynamic lineseries chart?
      QML and Qt Quick • qmllineseries lineseriechart dynamic chart view chart • • Shiva Guru Prasad

      1
      0
      Votes
      1
      Posts
      119
      Views

      No one has replied

    • L

      Unsolved Access C++ factory-created objects from QML
      QML and Qt Quick • factory dynamic • • LordKalma

      4
      1
      Votes
      4
      Posts
      400
      Views

      jeremy_k

      Do these objects output by the factory have a lifetime that needs to exceed the QML component used for the object's controls? If not, I would make the object a QML (not Quick) type, and have the component that displays the controls also instantiate the object.

      Even if they do have lifetimes that don't match the UI portion, the controls can be thin wrappers around the objects that really implement the backend. In the example below RadioBackend and TapeBackend are QObject derived classes that export Q_INVOKABLE functions and properties for communication with the UI. Register them with one of the qmlRegister* functions, depending on the desired interface.

      For example:

      Radio.qml:

      Rectangle { color: control.colorTheme RadioBackend { id: control } Row { Button { onClicked: control.doAction() } Button { onClicked: control.doOtherAction() } } }

      TapeDeck.qml:

      Rectangle { color: control.colorTheme TapeBackend { id: control } Button { onClicked: control.doTapeAction() } }

      main.qml:

      Loader { property MediaType mediaType source: mediaType === MediaType.Radio ? "file://Radio.qml" : "file://TapeDeck.qml" }
    • K

      Unsolved RowLaoyut reload/refresh after dynamic anchoring
      QML and Qt Quick • layout anchoring dynamic • • Kyeiv

      1
      0
      Votes
      1
      Posts
      184
      Views

      No one has replied

    • Q

      Unsolved Add Entity to Scene3D Dynamically
      QML and Qt Quick • qt3d scene3d dynamic • • qtMec

      1
      0
      Votes
      1
      Posts
      452
      Views

      No one has replied

    • B

      Unsolved Dynamic circles/dots
      QML and Qt Quick • qml dynamic • • ben80

      5
      0
      Votes
      5
      Posts
      274
      Views

      B

      If I create the dots dynamically, are there different ways of doing it? I have never done that before.

    • K

      Solved Having fixed size for dynamically created buttons!
      General and Desktop • qtcreator dynamic button size • • Kushan

      2
      0
      Votes
      2
      Posts
      742
      Views

      VRonin

      f3 = new QFrame();

      ???

      How can I have a fixed size for the buttons for both the situations?

      c->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed);

    • K

      Unsolved sending QStringLists from dynamically created buttons using signals and slots
      General and Desktop • qtcreator signal & slot dynamic buttons • • Kushan

      21
      0
      Votes
      21
      Posts
      4887
      Views

      K

      @SGaist Thanx mate :) Qt rox :D

    • K

      Solved Opening dynamically created buttons
      General and Desktop • dynamic button click qstringlist • • Kushan

      11
      0
      Votes
      11
      Posts
      11217
      Views

      K

      @jsulm thanx bro :)

    • L

      Solved sending variables dynamically using signals and slots
      General and Desktop • qtcreator signals&slots dynamic variable • • Lasith

      3
      0
      Votes
      3
      Posts
      4067
      Views

      jsulm

      @Lasith Well, emit a signal, pass the current value to it as parameter. Connect the signal to the slot.

      // somewhere in your code connect(this, SIGNAL(mySignal(int)), otherObject, SLOT(mySlot(int))); for (int i = 0; i < 10; ++i) { emit mySignal(i); } // In the other class void MyObject::mySlot(const int value) { // Do something }

      Did you read http://doc.qt.io/qt-5.9/signalsandslots.html ?

      Actually you should think about the need of signals and slots in this particular case - maybe it will be much easier and faster to directly call a method from the other class instead of emitting a signal? Signals/slots are useful if you want to have loose coupling, so the sender does not need to know anything about receiver.

    • L

      Solved Getting values from dynamically created user interfaces
      General and Desktop • dynamic interface values store • • Lasith

      9
      0
      Votes
      9
      Posts
      1535
      Views

      mrjj

      Hi
      While walking my imaginary dog, i was wondering if the
      number you input "ui->values->text().toInt()"
      means how many names/ages to get and you mean for it
      to ask that many times, and not really create that many
      dialogs ?
      So like ask me 10 times
      and one and the same dialog would show up 10 times ?
      And each time, user press ok, it would save the data, then
      show again ?

    • M

      Unsolved Dynamic access to QML elements from QML
      General and Desktop • qml dynamic textinput keyboard dynamic linking • • monster

      2
      0
      Votes
      2
      Posts
      986
      Views

      p3c0

      @monster You can create the TextInput using createComponent and then after creating its object you can assign it to a js variable. You can store them for eg. in an array for further reference.

      var component = Qt.createComponent("MyTextInput.qml"); var textinput = component.createObject(parent);
    • Dong

      Solved Access and Change QList<QObject*> dynamic property in QObject*
      General and Desktop • qobject dynamic property qlistqobject reference • • Dong

      9
      0
      Votes
      9
      Posts
      5956
      Views

      kshegunov

      @Dong
      Hello,
      Sorry for the late reply. Yes, you've got the essence of it. Qt's containers (QList included) are pretty smart in respect to copying, they will not copy the actual data until you change it. They are implicitly shared. This is done so you can return and copy the container many times, but in actuality internally only a pointer is reassigned and reference counter updated. When you call a non-const function on that list, Qt checks the reference counter and if more than one object is attached to the data, then and only then the data is detached (copied). When you put your list in the QVariant it is stored by value (making a shallow copy), but QVariant will return a shallow copy as well (meaning the data will not be changed, only the internal pointer reassigned and reference counter incremented).

      Now, for your particular case:
      The first line of code works, because you don't modify the list, but take an element (which is a pointer) and modify the object the list is holding reference to. This doesn't cause the list data to be copied. The second line you have, doesn't work, because you're changing the list data (assigning a new value to a list's element), which causes the list data to be detached and in practice, you're operating on a completely different set of data.

      Here is a reference if you're interested in the way QList and other containers manage their data, and what implicit sharing is.

    • P

      identity id and exclusive group Radio Button created dynamically from a database
      QML and Qt Quick • database dynamic dynamic propert createobject • • Pisko

      2
      0
      Votes
      2
      Posts
      1300
      Views

      p3c0

      Hi @Pisko and Welcome,

      The first problem is that I don't know how to definite the button id if i create them dynamically so I cannot identify which buttons are pressed to save the answers in the database.

      Unfortunately you cant assign an id for dynamically created items. Check this for more details.

      Another problem is that I cannot create Exclusive Groups dynamically.

      I think you can use a ExclusiveGroup here.

    • M

      dynamic Delegate component and use of DelegateModelGroup in DelegateModel
      General and Desktop • delegatemodelgr dynamic delegate • • Mephi

      4
      0
      Votes
      4
      Posts
      1628
      Views

      p3c0

      @Mephi Hmm, sorry for that. I wasn't aware of it as i have never used it before. So digging in it seems that the attached properties of DelegateModel doesn't seem to work if the delegate is in separate file. Could be a bug I suppose. You can try reporting it here.

    • B

      Multiple Widget Containers
      General and Desktop • widgets dynamic • • Basstrom

      5
      0
      Votes
      5
      Posts
      2480
      Views

      mrjj

      @Basstrom

      Hi both ways would work with different information.
      It is possible to give each widget a name with number if needed.

      But if you are aiming for something that would be a table then
      it is far more work to create a widget for each column than to
      use a QTableWidget as sgaist suggests.

      ui->table->setRowCount ( 1 ); ui->table->setColumnCount ( 3 ); ui->table->setSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ); ui->table->setHorizontalHeaderLabels ( QString ( "Name;Track Time;Prev Track Time" ).split ( ";" ) ); //Add Table items here ui->table->setItem ( 0, 0, new QTableWidgetItem ( "Michael Schumacher" ) ); ui->table->setItem ( 0, 1, new QTableWidgetItem ( "22.55" ) ); ui->table->setItem ( 0, 2, new QTableWidgetItem ( "44.3" ) );