Arguments for function addTab()
-
In our qml.main we have some code that is repeated multiple times with variations of course:
[CODE]videoTab=makeTab("videoTab","Video", "video.qml",tabView.count)
tabView.addTab(videoTab.name,videoTab.tab)[/CODE]I have searched for function makeTab() to no avail. Where can I find a description? Specifically I wish to see a description of property: videoTab.name.
I have found that addTab() is an overloaded function and both of them have the same first argument. Here is one of the descriptions:
[CODE\int QTabWidget::addTab(QWidget *page, const QIcon &icon, const QString &label)[/CODE]
As I read that, the first argument is a pointer to a widget. In the working code, the example provided above, it looks like the name of the tab is being provided. To me, the name of the argument provided implies a string. If so then the argument provided does not match required argument type.
What am I missing here? -
Hi
[CODE] is ```
and same for the end -
Hi
The QML tabView seems to accept a string
http://doc.qt.io/qt-5/qml-qtquick-controls-tabview.html#addTab-method -
Hello mrjj,
so that page shows the first arg as a string. This page:
http://doc.qt.io/qt-5/qtabwidget.html
is the one I get when I search from here:
http://doc.qt.io/qt-5/search-results.html?q=addtab
Under the section Public Functions I find this line:
int addTab(QWidget *page, const QString &label)
I will go with your page but ask for a suggestion as to how to find it with a search.On my Internet Explorer the CODE markers look like three apostrophies but that does not work. I used copy paste for this post. How might I type in those characters?
-
Hello mrjj,
so that page shows the first arg as a string. This page:
http://doc.qt.io/qt-5/qtabwidget.html
is the one I get when I search from here:
http://doc.qt.io/qt-5/search-results.html?q=addtab
Under the section Public Functions I find this line:
int addTab(QWidget *page, const QString &label)
I will go with your page but ask for a suggestion as to how to find it with a search.On my Internet Explorer the CODE markers look like three apostrophies but that does not work. I used copy paste for this post. How might I type in those characters?
-
Hi you seems to have found
tabWidget but the QML sample you talk about is using TabView so its other class :)
( i just searched for tabview)I never type them. i just use button :)
-
@JonB
hehe well i was like 2 years to discover that
right click on class or variables in Creator and choose the
refactor menu, have tons of features for adding virtual members,
sync parameters change and generate get/setters for variables.
:) -
@JonB
hehe well i was like 2 years to discover that
right click on class or variables in Creator and choose the
refactor menu, have tons of features for adding virtual members,
sync parameters change and generate get/setters for variables.
:) -
Hi
The QML tabView seems to accept a string
http://doc.qt.io/qt-5/qml-qtquick-controls-tabview.html#addTab-method@mrjj
Trying the backtick marker to delineate code in the next line
const int MAX_SIZE = 480;
Does that work as expected.
I think this question is answered so am marking it as such. Just taking the opportunity to test that backtick thing.
In the preview window it looks ok. -
@mrjj
Trying the backtick marker to delineate code in the next line
const int MAX_SIZE = 480;
Does that work as expected.
I think this question is answered so am marking it as such. Just taking the opportunity to test that backtick thing.
In the preview window it looks ok. -
@BKBK
Almost correct, but you need to use 3 of them in start and end.const int MAX_SIZE = 480;
(image)@mrjj Interesting, one looks good in the editor. Lets try one backtick on each end in the next line:
const int MAX_SIZE = 480;
and then three on each end in the next line:
const int MAX_SIZE = 480;
and see how that looks. I cannot see any difference in the preview pane. Maybe a difference will show up in the final post. -
@mrjj Interesting, one looks good in the editor. Lets try one backtick on each end in the next line:
const int MAX_SIZE = 480;
and then three on each end in the next line:
const int MAX_SIZE = 480;
and see how that looks. I cannot see any difference in the preview pane. Maybe a difference will show up in the final post. -
@BKBK
Hi
you put them too close to the text. the code should be in between.const int MAX_SIZE = 480;
@mrjj Too close to the text??? I do not understand your intent. When I typed each of the code lines I pressed the backtick key 1 or 3 times then immediately followed it with letters "const" that began the line of code. From my view, using Internet Explorer through a government firewall, both lines look exactly the same and both are nicely highlighted with red font to indicate they are lines of code.
-
@mrjj Too close to the text??? I do not understand your intent. When I typed each of the code lines I pressed the backtick key 1 or 3 times then immediately followed it with letters "const" that began the line of code. From my view, using Internet Explorer through a government firewall, both lines look exactly the same and both are nicely highlighted with red font to indicate they are lines of code.