XLineEdit::XLineEdit(QWidget *parent, const char *name) : QLineEdit(parent) { if (! name && objectName().isEmpty()) setObjectName("XLineEdit"); setAcceptDrops(FALSE); #ifdef Q_WS_MAC QFont f = font(); f.setPointSize(f.pointSize() - 2); setFont(f); #endif _parsed = true; _valid = false; _isNull = true; _id = -1; connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); _listAct = new QAction(tr("List..."), this); _listAct->setShortcut(QKeySequence(tr("Ctrl+Shift+L"))); _listAct->setShortcutContext(Qt::WidgetShortcut); _listAct->setToolTip(tr("List all records")); connect(_listAct, SIGNAL(triggered()), this, SIGNAL(requestList())); addAction(_listAct); _searchAct = new QAction(tr("Search..."), this); _searchAct->setShortcut(QKeySequence(tr("Ctrl+Shift+Space"))); _searchAct->setShortcutContext(Qt::WidgetShortcut); _searchAct->setToolTip(tr("Search on specific criteria")); connect(_searchAct, SIGNAL(triggered()), this, SIGNAL(requestSearch())); addAction(_searchAct); _aliasAct = new QAction(tr("Alias..."), this); _aliasAct->setShortcut(QKeySequence(tr("Ctrl+Shift+A"))); _aliasAct->setShortcutContext(Qt::WidgetShortcut); _aliasAct->setToolTip(tr("List of alias records")); connect(_aliasAct, SIGNAL(triggered()), this, SIGNAL(requestAlias())); addAction(_aliasAct); _copyProject = new QAction(tr("New From..."), this); _copyProject->setShortcut(QKeySequence(tr("Ctrl+Shift+C"))); _copyProject->setShortcutContext(Qt::WidgetShortcut); _copyProject->setToolTip(tr("Copy Project From Selected")); connect(_copyProject, SIGNAL(triggered()), this, SIGNAL(requestCopy())); addAction(_copyProject); _mapper = new XDataWidgetMapper(this); }
TextToolbar::TextToolbar(QWidget *parent) : QToolBar(parent), action_copy(new QAction(this)), action_pronounce(new QAction(this)) { action_copy->setIcon(APP_ICON("copy")); action_pronounce->setIcon(APP_ICON("play")); addAction(action_copy); addAction(action_pronounce); connect(action_copy, SIGNAL(triggered()), SIGNAL(requestCopy())); connect(action_pronounce, SIGNAL(triggered()), SIGNAL(requestPronounce())); setIconSize(QSize(16, 16)); setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); #ifdef Q_OS_MAC setStyle(new QCommonStyle()); setStyleSheet("border: none"); #endif }