PaletteButton(GuiToolbar * bar, ToolbarItem const & item)
: QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
{
- setToolTip(qt_(to_ascii(tbitem_.label_)));
- setStatusTip(qt_(to_ascii(tbitem_.label_)));
- setText(qt_(to_ascii(tbitem_.label_)));
+ QString label = qt_(to_ascii(tbitem_.label_));
+ setToolTip(label);
+ setStatusTip(label);
+ setText(label);
connect(bar_, SIGNAL(iconSizeChanged(QSize)),
this, SLOT(setIconSize(QSize)));
panel_ = new IconPalette(this);
- panel_->setWindowTitle(qt_(to_ascii(tbitem_.label_)));
+ panel_->setWindowTitle(label);
setCheckable(true);
connect(this, SIGNAL(clicked(bool)), panel_, SLOT(setVisible(bool)));
connect(panel_, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));
: QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
{
setPopupMode(QToolButton::InstantPopup);
- setToolTip(qt_(to_ascii(tbitem_.label_)));
- setStatusTip(qt_(to_ascii(tbitem_.label_)));
- setText(qt_(to_ascii(tbitem_.label_)));
+ QString label = qt_(to_ascii(tbitem_.label_));
+ setToolTip(label);
+ setStatusTip(label);
+ setText(label);
setIcon(QPixmap(":images/math/" + toqstr(tbitem_.name_) + ".png"));
connect(bar, SIGNAL(iconSizeChanged(QSize)),
this, SLOT(setIconSize(QSize)));
initialized_ = true;
- ButtonMenu * m = new ButtonMenu(qt_(to_ascii(tbitem_.label_)), this);
- m->setWindowTitle(qt_(to_ascii(tbitem_.label_)));
+ QString label = qt_(to_ascii(tbitem_.label_));
+ ButtonMenu * m = new ButtonMenu(label, this);
+ m->setWindowTitle(label);
m->setTearOffEnabled(true);
connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
ToolbarInfo const * tbinfo =
}
+
void GuiToolbar::add(ToolbarItem const & item)
{
switch (item.type_) {
QToolButton * tb = new QToolButton;
tb->setCheckable(true);
tb->setIcon(getIcon(FuncRequest(LFUN_TABULAR_INSERT), true));
- tb->setToolTip(qt_(to_ascii(item.label_)));
- tb->setStatusTip(qt_(to_ascii(item.label_)));
- tb->setText(qt_(to_ascii(item.label_)));
+ QString label = qt_(to_ascii(item.label_));
+ tb->setToolTip(label);
+ tb->setStatusTip(label);
+ tb->setText(label);
InsertTableWidget * iv = new InsertTableWidget(owner_, tb);
connect(tb, SIGNAL(clicked(bool)), iv, SLOT(show(bool)));
connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool)));