hi ,
I am using a QTabWidget to display 4 dialogs in 4 tab items. For that i have implementes my Dialogs using QHBoxLayout and QVBoxLayout. I tried with out using layout. but then the dialogs were not displayed. Since i am using Layout, i cannot use setGeometry() API to the items contained in the dialogs. But now there is another problem. When the dialogs are displayed , items are going out of the screen. The size of the screen i am using is 320H/240H. The items are going out horizontally in the right side of the screen.
ProxysettingWindow()
resize(240,320);
m_httpProxy
= new QLabel("HttpProxy",
this);
m_proxyEdit
= new QLineEdit(settings.
value("HttpHost").
toString(),
this) ;
m_httpPort
= new QLabel("Httpport",
this);
m_portEdit
= new QLineEdit(settings.
value("Httpport").
toString(),
this) ;
m_userName
= new QLabel("UserName",
this);
m_nameEdit
= new QLineEdit(settings.
value("UserName").
toString(),
this) ;
m_userpassword
= new QLabel("Pasword",
this);
m_passWordEdit
= new QLineEdit(settings.
value("Password").
toString(),
this) ;
proxyLayout->addWidget(m_httpProxy);
proxyLayout->addWidget(m_proxyEdit);
portLayout->addWidget(m_httpPort);
portLayout->addWidget(m_portEdit);
userNameLayout->addWidget(m_userName);
userNameLayout->addWidget(m_nameEdit);
passLayout->addWidget(m_userpassword);
passLayout->addWidget(m_passWordEdit);
mainLayout->addLayout(proxyLayout);
mainLayout->addLayout(portLayout);
mainLayout->addLayout(userNameLayout);
mainLayout->addLayout(passLayout);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
}
ProxysettingWindow()
resize(240,320);
m_httpProxy = new QLabel("HttpProxy", this);
m_proxyEdit = new QLineEdit(settings.value("HttpHost").toString(), this) ;
m_httpPort = new QLabel("Httpport", this);
m_portEdit = new QLineEdit(settings.value("Httpport").toString(), this) ;
m_userName = new QLabel("UserName", this);
m_nameEdit = new QLineEdit(settings.value("UserName").toString(), this) ;
m_userpassword = new QLabel("Pasword", this);
m_passWordEdit = new QLineEdit(settings.value("Password").toString(), this) ;
QVBoxLayout *mainLayout = new QVBoxLayout();
QHBoxLayout *proxyLayout = new QHBoxLayout;
QHBoxLayout *portLayout = new QHBoxLayout;
QHBoxLayout *userNameLayout = new QHBoxLayout;
QHBoxLayout *passLayout = new QHBoxLayout;
proxyLayout->addWidget(m_httpProxy);
proxyLayout->addWidget(m_proxyEdit);
portLayout->addWidget(m_httpPort);
portLayout->addWidget(m_portEdit);
userNameLayout->addWidget(m_userName);
userNameLayout->addWidget(m_nameEdit);
passLayout->addWidget(m_userpassword);
passLayout->addWidget(m_passWordEdit);
mainLayout->addLayout(proxyLayout);
mainLayout->addLayout(portLayout);
mainLayout->addLayout(userNameLayout);
mainLayout->addLayout(passLayout);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
}
To copy to clipboard, switch view to plain text mode
this is the code i have written in the const of the dialog
m_proxyWindow = new ProxysettingWindow(this);
m_tabbar->addTab(m_proxyWindow, "proxy");
m_tabbar = new QTabWidget(this);
m_proxyWindow = new ProxysettingWindow(this);
m_tabbar->addTab(m_proxyWindow, "proxy");
To copy to clipboard, switch view to plain text mode
this is how i created the Tabwidget
If anyone had faced such kind of problem, please provide some pointers.
Regards
Kulajit das
Bookmarks