I have used QFile, and store the project data as xml. It works fine.
Besides that I want to write Project details om the Welcome-tab
Here is the "welcometab.cpp" file:
#include "welcometab.h"
WelcomeTab
::WelcomeTab(QWidget *parent
) :{
view = new QWebView(parent);
view->setMinimumWidth(700);
leftbox->addWidget(view);
labProjName
= new QLabel(tr
("Project Name:"),
this);
infoLayout->addWidget(labProjName);
labProjNameText
= new QLabel("",
this);
infoLayout->addWidget(labProjNameText);
rightbox->addLayout(infoLayout);
rightbox->addStretch();
layout->setSpacing(0);
layout->addLayout(leftbox);
layout->addLayout(rightbox);
setLayout(layout);
}
void WelcomeTab
::setTextProjName(QString s
){ labProjNameText->setText(s);
}
#include "welcometab.h"
WelcomeTab::WelcomeTab(QWidget *parent) :
QWidget(parent)
{
view = new QWebView(parent);
view->setMinimumWidth(700);
leftbox = new QVBoxLayout();
leftbox->addWidget(view);
infoLayout = new QGridLayout();
labProjName = new QLabel(tr("Project Name:"),this);
infoLayout->addWidget(labProjName);
labProjNameText = new QLabel("",this);
infoLayout->addWidget(labProjNameText);
rightbox = new QVBoxLayout();
rightbox->addLayout(infoLayout);
rightbox->addStretch();
layout = new QHBoxLayout();
layout->setSpacing(0);
layout->addLayout(leftbox);
layout->addLayout(rightbox);
setLayout(layout);
}
void WelcomeTab::setTextProjName(QString s){
labProjNameText->setText(s);
}
To copy to clipboard, switch view to plain text mode
In the Lani.cpp constructor you'll find:
tabWidget->setShortcutEnabled(0,true);
welcomeTab = new WelcomeTab();
tabWidget->addTab(welcomeTab,tr("&1 Welcome"));
tabWidget = new QTabWidget;
tabWidget->setShortcutEnabled(0,true);
welcomeTab = new WelcomeTab();
tabWidget->addTab(welcomeTab,tr("&1 Welcome"));
To copy to clipboard, switch view to plain text mode
In Lani.h I declare welcomeTab:
QWidget *welcomeTab;
To copy to clipboard, switch view to plain text mode
What I can't understand is: Why can't I write
welcomeTab.setTextProjName("somestring");
welcomeTab.setTextProjName("somestring");
To copy to clipboard, switch view to plain text mode
It really puzzles me...
Bookmarks