Skip to content
  • 0 Votes
    4 Posts
    2k Views
    Pl45m4P

    @vicky_mac

    A QStackedWidget works like a book. You have pages with your content. You can flip these pages to change your widget inplace (without opening another window or something else).
    So one possibility is to put one of each QTabWidget (each with a different tabBar position) on a page of a QStackedWidget. You could flip the pages by clicking a dummy tab on each tabBar or you use a button to go to the next page. I know, this is not exactly what the widget in your image looks like :)

    @vicky_mac said in How to Add multiple Qtoolbar in QtabWidget:

    Haven't used QT much

    If you want a widget, that looks exactly like the one shown above, you could still try to subclass and create your own, custom TabWidget, but I fear, that it might be a little too challenging.

    Here's all you need to know about QStackedWidget (https://doc.qt.io/qt-5/qstackedwidget.html#details)

  • 0 Votes
    1 Posts
    323 Views
    No one has replied
  • Qurl

    Unsolved General and Desktop
    6
    0 Votes
    6 Posts
    2k Views
    mrjjM

    Hi
    Alternatively, you could use QProcess and start it with

    QString program = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"; QStringList arguments; arguments << "--new-window" << "https://forum.qt.io"; QProcess chromeProcess; if ( ! chromeProcess.startDetached(program, arguments) ) { qDebug() << "error" << chromeProcess.errorString(); }
  • 0 Votes
    11 Posts
    2k Views
    A

    Hi. Did you get a solution for you problem. I am having a similar issue where I would like to create a multi tab window with each tab as a separate process.

  • 0 Votes
    13 Posts
    4k Views
    O

    thanks. i will try it :)

  • 0 Votes
    6 Posts
    4k Views
    freddy311082F

    @Paul-Colby
    Yes paaul, it doesn't work for me neither

    any other advise ?

    regards

  • 0 Votes
    2 Posts
    1k Views
    p3c0P

    Hi @MP10 and Welcome,

    Have a look at the following:

    http://doc.qt.io/qt-4.8/qmlevents.html
    This is similar to Qt C++ signals and slots mechanism and allows transfer of data. http://doc.qt.io/qt-5/qtqml-syntax-propertybinding.html
    This explains how variables/properties can be defined in QML and binded to other properties on same or other pages so that when one changes the other is updated too. In your case you can try binding the numerical values on Tab1 with similar properties on Tab2. Then you can use the corresponding event handler for these properties to update the graph. The event handlers are triggered when a property's value changes.
  • 0 Votes
    3 Posts
    5k Views
    GofferG

    Hmm I thought about that but I wanted to avoid 'useless' iterations. What I have done is when i create my tab, I call the setCurrentWidget() and then I can get the Index with currentIndex().

  • 0 Votes
    6 Posts
    2k Views
    J

    To be precise: click the gear, choose 'Edit' en put the string [Solved] in front of the title of your post

  • 0 Votes
    2 Posts
    2k Views
    AlbertoA

    Resuelto.
    El problema era que cuando hace el primer remove los indices cambian, así que cuando elimino el indice 1 los indices pasan de ser 0,1,2 a ser 0,1. El segundo remove intenta eliminar el indice 2 pero este dejó de existir cuando hace el primer remove.
    Así que la solución es esta:

    Partes::Partes(QWidget *parent) : QDialog(parent), ui(new Ui::Partes) { ui->setupUi(this); ui->Pestanas->setCurrentIndex(0); ui->Pestanas->removeTab(1); ui->Pestanas->removeTab(1); }

    Or:

    Partes::Partes(QWidget *parent) : QDialog(parent), ui(new Ui::Partes) { ui->setupUi(this); ui->Pestanas->setCurrentIndex(0); ui->Pestanas->removeTab(2); ui->Pestanas->removeTab(1); }

    Como puedo marcar este post como resuelto?

  • 0 Votes
    4 Posts
    4k Views
    RatzzR

    @Jeroen3
    Thanks for the reply.
    I tried using setCurrentIndex which helped me out .

    ui->tabWidget->setCurrentWidget(ui->tab);
  • 0 Votes
    2 Posts
    2k Views
    mrjjM

    The QTableWidget is item-based. meaning you insert the data into the widget and it takes control of it. (owns it)
    So sharing between QTableWidgets is not really working.

    However, the QTableView is a view-model object.
    Here your data lives in a object (the model) that the QTableView asks for data.

    It is possible to share this model between QTableViews and if you
    update any field, it would be the same for all as "playername" would only exists once.

    So if you have not,please read about QTableView and Qt's model/view framework.

    If only player name is shared, then using a model might be a bit overkill. Still super flexible.

  • 0 Votes
    2 Posts
    3k Views
    SGaistS

    Hi and welcome to devnet,

    This is something you should check with the Qt Creator team. You should bring this to the qt-creator mailing list You'll find there Qt Creator's developers/maintainers (this forum is more user oriented)