void BookmarksManager::updateEditBox(BookmarkItem* item) { setUpdatesEnabled(false); m_blockDescriptionChangedSignal = true; bool editable = bookmarkEditable(item); bool showAddressAndKeyword = item && item->isUrl(); bool clearBox = !item; if (clearBox) { ui->title->clear(); ui->address->clear(); ui->keyword->clear(); ui->description->clear(); ui->title->setReadOnly(true); ui->address->setReadOnly(true); ui->keyword->setReadOnly(true); ui->description->setReadOnly(true); } else { ui->title->setText(item->title()); ui->address->setText(item->url().toEncoded()); ui->keyword->setText(item->keyword()); ui->description->setPlainText(item->description()); } ui->title->setReadOnly(!editable); ui->address->setReadOnly(!editable); ui->keyword->setReadOnly(!editable); ui->description->setReadOnly(!editable); ui->labelAddress->setVisible(showAddressAndKeyword); ui->address->setVisible(showAddressAndKeyword); ui->labelKeyword->setVisible(showAddressAndKeyword); ui->keyword->setVisible(showAddressAndKeyword); // Without removing widgets from layout, there is unwanted extra spacing QFormLayout* l = static_cast<QFormLayout*>(ui->editBox->layout()); if (showAddressAndKeyword) { // Show Address + Keyword l->insertRow(1, ui->labelAddress, ui->address); l->insertRow(2, ui->labelKeyword, ui->keyword); } else { // Hide Address + Keyword l->removeWidget(ui->labelAddress); l->removeWidget(ui->labelKeyword); l->removeWidget(ui->address); l->removeWidget(ui->keyword); } m_blockDescriptionChangedSignal = false; // Prevent flickering QTimer::singleShot(10, this, SLOT(enableUpdates())); }
App::App(const Wt::WEnvironment& env) : Wt::WApplication(env) { setTheme(new Wt::WBootstrapTheme()); useStyleSheet("style.css"); root()->addWidget(config_wdgt = new Config_wdgt(session)); root()->addWidget(new Wt::WBreak()); root()->addWidget(stat_wdgt = new Stat_wdgt(session)); root()->addWidget(new Wt::WBreak()); root()->addWidget(line_wdgt = new Line_wdgt(session)); root()->addWidget(new Wt::WBreak()); root()->addWidget(prog_wdgt = new Prog_wdgt(session)); enableUpdates(true); worker_connect(this); }
TableView::TableView(const Wt::WEnvironment& env, Table *t) : Wt::WApplication(env), table(t) { setTitle("Push Test"); setCssTheme(""); useStyleSheet("data/style.css"); enableUpdates(true); messageResourceBundle().use(appRoot() + "i18n"); table->connect(this); Wt::WPushButton* button = new Wt::WPushButton("Increment", root()); sound = new Wt::WSound("data/click.mp3"); button->clicked().connect(this, &TableView::increment); text = new Wt::WText("Number will appear here", root()); }