Hi, take a look at the code:
public:
vnosTab();
private:
};
class vnosTab : public QTabWidget {
public:
vnosTab();
private:
QVBoxLayout *m_pTopLayoutVnos;
QPushButton *m_pVnosUvoznihCarinskih;
QPushButton *m_pVnosUvoznihNecarinskih;
QPushButton *m_pVnosIzvoznihCarinskih;
QPushButton *m_pVnosIzvoznihNecarinskih;
};
To copy to clipboard, switch view to plain text mode
vnosTab::vnosTab() {
Q_CHECK_PTR(m_pTopLayoutVnos);
//buttons in tab "Vnos"
m_pVnosUvoznihCarinskih
= new QPushButton(trUtf8
("uvoznih carinskih pošiljk"));
Q_CHECK_PTR(m_pVnosUvoznihCarinskih);
m_pVnosUvoznihNecarinskih
= new QPushButton(trUtf8
("uvoznih necarinskih pošiljk"));
Q_CHECK_PTR(m_pVnosUvoznihNecarinskih);
m_pVnosIzvoznihCarinskih
= new QPushButton(trUtf8
("izvoznih carinskih pošiljk"));
Q_CHECK_PTR(m_pVnosIzvoznihCarinskih);
m_pVnosIzvoznihNecarinskih
= new QPushButton(trUtf8
("izvoznih necarinskih pošiljk"));
Q_CHECK_PTR(m_pVnosIzvoznihNecarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosUvoznihCarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosUvoznihNecarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosIzvoznihCarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosIzvoznihNecarinskih);
this->setLayout(m_pTopLayoutVnos);
}
vnosTab::vnosTab() {
m_pTopLayoutVnos = new QVBoxLayout;
Q_CHECK_PTR(m_pTopLayoutVnos);
//buttons in tab "Vnos"
m_pVnosUvoznihCarinskih = new QPushButton(trUtf8("uvoznih carinskih pošiljk"));
Q_CHECK_PTR(m_pVnosUvoznihCarinskih);
m_pVnosUvoznihNecarinskih = new QPushButton(trUtf8("uvoznih necarinskih pošiljk"));
Q_CHECK_PTR(m_pVnosUvoznihNecarinskih);
m_pVnosIzvoznihCarinskih = new QPushButton(trUtf8("izvoznih carinskih pošiljk"));
Q_CHECK_PTR(m_pVnosIzvoznihCarinskih);
m_pVnosIzvoznihNecarinskih = new QPushButton(trUtf8("izvoznih necarinskih pošiljk"));
Q_CHECK_PTR(m_pVnosIzvoznihNecarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosUvoznihCarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosUvoznihNecarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosIzvoznihCarinskih);
m_pTopLayoutVnos->addWidget(m_pVnosIzvoznihNecarinskih);
this->setLayout(m_pTopLayoutVnos);
}
To copy to clipboard, switch view to plain text mode
here I'm using the previously declared class
void qKobilica::addToolMenu() {
setWindowTitle("Kobilica:");
m_pTabVnos = new vnosTab();
//m_pTabVnos->setHorizontalPolicy(QSizePolicy::Maximum);
//tabs
m_pToolbox->addItem(m_pTabSifrant,trUtf8("Šifranti"));
m_pToolbox->addItem(m_pTabVnos,trUtf8("Vnos"));
m_pToolbox->addItem(m_pTabNatisni,trUtf8("Tiskanje"));
m_pTopLayout->addWidget(m_pToolbox);
//add the central menu to the application
setCentralWidget(m_pToolbox);
}
void qKobilica::addToolMenu() {
setWindowTitle("Kobilica:");
m_pTopLayout = new QVBoxLayout();
m_pToolbox = new QToolBox;
m_pTabSifrant = new QTabWidget;
m_pTabVnos = new vnosTab();
//m_pTabVnos->setHorizontalPolicy(QSizePolicy::Maximum);
m_pTabNatisni = new QTabWidget;
//tabs
m_pToolbox->addItem(m_pTabSifrant,trUtf8("Šifranti"));
m_pToolbox->addItem(m_pTabVnos,trUtf8("Vnos"));
m_pToolbox->addItem(m_pTabNatisni,trUtf8("Tiskanje"));
m_pTopLayout->addWidget(m_pToolbox);
//add the central menu to the application
setCentralWidget(m_pToolbox);
}
To copy to clipboard, switch view to plain text mode
What I want to do is to resize the buttons (there are 4 at the moment) that would fill the whole canvas (now there's some space in between those buttons), I want only buttons to be on the screen.
Bookmarks