CDlgEditMapLevel::CDlgEditMapLevel(QTreeWidgetItem * item, const QString& path, QWidget * parent) : QDialog(parent) , item(item) , mapPath(path) { setupUi(this); spinZoom->setValue(item->data(0,CCreateMapQMAP::eZoom).toInt()); listFiles->addItems(item->text(CCreateMapQMAP::eFiles).split("; ",QString::SkipEmptyParts)); toolFiles->setIcon(QPixmap(":/icons/iconFileLoad16x16.png")); connect(toolFiles, SIGNAL(clicked()), this, SLOT(slotSelectFiles())); toolAdd->setIcon(QPixmap(":/icons/iconFileAdd16x16.png")); connect(toolAdd, SIGNAL(clicked()), this, SLOT(slotAdd())); toolDel->setIcon(QPixmap(":/icons/iconFileDel16x16.png")); connect(toolDel, SIGNAL(clicked()), this, SLOT(slotDel())); toolUp->setIcon(QPixmap(":/icons/iconUpload16x16.png")); connect(toolUp, SIGNAL(clicked()), this, SLOT(slotUp())); toolDown->setIcon(QPixmap(":/icons/iconDownload16x16.png")); connect(toolDown, SIGNAL(clicked()), this, SLOT(slotDown())); connect(listFiles, SIGNAL(itemSelectionChanged()), this, SLOT(slotListChanged())); }
ConfFilters::ConfFilters(TQWidget *parent, const char *name) : TQWidget(parent, name) { m_filters = new TDEListView(this); m_filters->addColumn(i18n("Mime Type")); m_filters->addColumn(i18n("Command")); m_filters->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken); m_filters->setLineWidth(1); m_filters->setSorting(-1); m_filters->header()->setStretchEnabled(true, 1); connect(m_filters, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(slotChange())); m_add = new TQPushButton(this); m_add->setPixmap(BarIcon("document-new")); m_remove = new TQPushButton(this); m_remove->setIconSet(BarIconSet("remove")); m_change = new TQPushButton(this); m_change->setIconSet(BarIconSet("filter")); m_up = new TQPushButton(this); m_up->setIconSet(BarIconSet("go-up")); m_down = new TQPushButton(this); m_down->setIconSet(BarIconSet("go-down")); connect(m_add, TQT_SIGNAL(clicked()), TQT_SLOT(slotAdd())); connect(m_change, TQT_SIGNAL(clicked()), TQT_SLOT(slotChange())); connect(m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemove())); connect(m_up, TQT_SIGNAL(clicked()), TQT_SLOT(slotUp())); connect(m_down, TQT_SIGNAL(clicked()), TQT_SLOT(slotDown())); TQToolTip::add(m_add, i18n("Add filter")); TQToolTip::add(m_change, i18n("Modify filter")); TQToolTip::add(m_remove, i18n("Remove filter")); TQToolTip::add(m_up, i18n("Move filter up")); TQToolTip::add(m_down, i18n("Move filter down")); TQHBoxLayout *l0 = new TQHBoxLayout(this, 10, 10); TQVBoxLayout *l1 = new TQVBoxLayout(0, 0, 0); l0->addWidget(m_filters, 1); l0->addLayout(l1, 0); l1->addWidget(m_add); l1->addWidget(m_change); l1->addWidget(m_remove); l1->addSpacing(10); l1->addWidget(m_up); l1->addWidget(m_down); l1->addStretch(1); updateButton(); connect(m_filters, TQT_SIGNAL(selectionChanged ()),TQT_SLOT(updateButton())); }
CCreateMapFineTune::CCreateMapFineTune(QWidget * parent) : QWidget(parent) { setupUi(this); toolUp->setIcon(QIcon(":/icons/iconUpload16x16.png")); toolDown->setIcon(QIcon(":/icons/iconDownload16x16.png")); toolLeft->setIcon(QIcon(":/icons/iconLeft16x16.png")); toolRight->setIcon(QIcon(":/icons/iconRight16x16.png")); connect(pushOpenFile, SIGNAL(clicked()), this, SLOT(slotOpenFile())); connect(toolUp, SIGNAL(clicked()), this, SLOT(slotUp())); connect(toolDown, SIGNAL(clicked()), this, SLOT(slotDown())); connect(toolLeft, SIGNAL(clicked()), this, SLOT(slotLeft())); connect(toolRight, SIGNAL(clicked()), this, SLOT(slotRight())); connect(pushSave, SIGNAL(clicked()), this, SLOT(slotSave())); progressBar->hide(); }
void StandGrapher::createGui() { //-------------------------------------------------- // Universal button creator for the navigation bars //-------------------------------------------------- class ButtonCreator { public: static QPushButton * create(QWidget * parent, const QString & objName, const QIcon & icon, const QKeySequence & key, QString toolTip, QWidget * target, const char * slot) { QPushButton * button = new QPushButton(parent); button->setObjectName(objName); button->setFocusPolicy(Qt::NoFocus); connect(button, SIGNAL(pressed()), target, slot); button->setIconSize(QSize(32, 32)); button->setIcon(QIcon(icon)); if (!key.isEmpty()) toolTip += " " + tr("(Shortcut: <b>%1</b>)").arg(key.toString()); button->setToolTip(toolTip); QShortcut * shortcut = new QShortcut(key, target); connect(shortcut, SIGNAL(activated()), target, slot); return button; } }; QList<QPushButton *> buttons; //------------------------------------------- // Horizontal tool box //------------------------------------------- hToolBox = new QFrame(this); hToolBox->setFrameStyle(QFrame::StyledPanel | QFrame::Plain); hToolBox->setAutoFillBackground(true); hToolBox->setCursor(Qt::ArrowCursor); hToolBox->installEventFilter(this); // Create buttons buttons << ButtonCreator::create(hToolBox, "Start_button", QIcon(":/start.png"), Qt::Key_Home, tr("Start"), this, SLOT(slotStart())); buttons << ButtonCreator::create(hToolBox, "Prev_button", QIcon(":/previous.png"), Qt::Key_Left, tr("Previous"), this, SLOT(slotPrevious())); buttons << ButtonCreator::create(hToolBox, "HFit_button", QIcon(":/fit.png"), QKeySequence(), tr("Fit horizontally"), this, SLOT(slotFit())); buttons << ButtonCreator::create(hToolBox, "Next_button", QIcon(":/next.png"), Qt::Key_Right, tr("Next"), this, SLOT(slotNext())); buttons << ButtonCreator::create(hToolBox, "Finish_button", QIcon(":/finish.png"), Qt::Key_End, tr("End"), this, SLOT(slotEnd())); buttons << ButtonCreator::create(hToolBox, "HZoomIn_button", QIcon(":/plus.png"), Qt::Key_Plus, tr("Wider"), this, SLOT(slotZoomIn())); buttons << ButtonCreator::create(hToolBox, "HZoomOut_button", QIcon(":/minus.png"), Qt::Key_Minus, tr("Narrower"), this, SLOT(slotZoomOut())); // Layout buttons QHBoxLayout * hLayout = new QHBoxLayout(hToolBox); foreach(QPushButton * button, buttons) hLayout->addWidget(button); hToolBox->setLayout(hLayout); //------------------------------------------- // Vertical tool box //------------------------------------------- vToolBox = new QFrame(this); vToolBox->setFrameStyle(QFrame::StyledPanel | QFrame::Plain); vToolBox->setAutoFillBackground(true); vToolBox->setCursor(Qt::ArrowCursor); vToolBox->installEventFilter(this); buttons.clear(); buttons << ButtonCreator::create(vToolBox, "Up_button", QIcon(":/up.png"), Qt::Key_Up, tr("Up"), this, SLOT(slotUp())); buttons << ButtonCreator::create(vToolBox, "VFit_button", QIcon(":/fit_vert.png"), QKeySequence(), tr("Fit vertically"), this, SLOT(slotVFit())); buttons << ButtonCreator::create(vToolBox, "Down_button", QIcon(":/down.png"), Qt::Key_Down, tr("Down"), this, SLOT(slotDown())); buttons << ButtonCreator::create(vToolBox, "VZoomIn_button", QIcon(":/plus.png"), Qt::SHIFT+Qt::Key_Plus, tr("Wider"), this, SLOT(slotVZoomIn())); buttons << ButtonCreator::create(vToolBox, "VZoomOut_button", QIcon(":/minus.png"), Qt::SHIFT+Qt::Key_Minus, tr("Narrower"), this, SLOT(slotVZoomOut())); // Layout buttons QVBoxLayout * vLayout = new QVBoxLayout(vToolBox); foreach(QPushButton * button, buttons) vLayout->addWidget(button); vToolBox->setLayout(vLayout); //------------------------------------------- // Tool Box //------------------------------------------- toolBox = new QFrame(this); toolBox->setFrameStyle(QFrame::StyledPanel | QFrame::Plain); toolBox->setAutoFillBackground(true); toolBox->setCursor(Qt::ArrowCursor); toolBox->installEventFilter(this); buttons.clear(); // Filter button filterButton = new QPushButton(toolBox); filterButton->setIcon(QIcon(":/filter.png")); filterButton->setCheckable(true); filterButton->setShortcut(Qt::Key_F); filterButton->setToolTip(tr("Filter window")); connect(filterButton, SIGNAL(released()), this, SLOT(slotFilterWindow())); buttons << filterButton; filterWindow = new ParamsFilterWidget(this); connect(filterWindow, SIGNAL( modelChanged(Stand_trace_model::Ptr) ), this, SLOT( setModel(Stand_trace_model::Ptr) )); connect(filterWindow, SIGNAL(windowClosed()), filterButton, SLOT(toggle())); // Drawing lines option drawLinesButton = new QPushButton(toolBox); drawLinesButton->setIcon(QIcon(":/draw_lines.png")); drawLinesButton->setCheckable(true); drawLinesButton->setChecked(true); drawLinesButton->setShortcut(Qt::Key_L); drawLinesButton->setToolTip(tr("Draw lines")); connect(drawLinesButton, SIGNAL(released()), this, SLOT(slotDrawLineSwither())); buttons << drawLinesButton; // Antialiasing option antialiasingButton = new QPushButton(toolBox); antialiasingButton->setIcon(QIcon(":/antialiasing.png")); antialiasingButton->setCheckable(true); antialiasingButton->setChecked(antialiasing); antialiasingButton->setShortcut(Qt::Key_A); antialiasingButton->setToolTip(tr("Antialiasing")); connect(antialiasingButton, SIGNAL(clicked(bool)), this, SLOT(slotAntialiasingSwither(bool))); buttons << antialiasingButton; // Print button printButton = new QPushButton(toolBox); printButton->setIcon(QIcon(":/printer.png")); printButton->setShortcut(Qt::Key_P); printButton->setToolTip(tr("Print")); connect(printButton, SIGNAL(released()), this, SLOT(slotPrintGraph())); buttons << printButton; // Setup buttons foreach (QPushButton * button, buttons) { button->setIconSize(QSize(16, 16)); button->setFocusPolicy(Qt::NoFocus); button->setToolTip(button->toolTip() + " " + tr("(Shortcut: <b>%1</b>)").arg(button->shortcut().toString())); }
KMConfigFonts::KMConfigFonts(TQWidget *parent, const char *name) : KMConfigPage(parent, name) { setPageName(i18n("Fonts")); setPageHeader(i18n("Font Settings")); setPagePixmap("fonts"); TQGroupBox *box = new TQGroupBox(0, Qt::Vertical, i18n("Fonts Embedding"), this); TQGroupBox *box2 = new TQGroupBox(0, Qt::Vertical, i18n("Fonts Path"), this); m_embedfonts = new TQCheckBox(i18n("&Embed fonts in PostScript data when printing"), box); m_fontpath = new TDEListView(box2); m_fontpath->addColumn(""); m_fontpath->header()->setStretchEnabled(true, 0); m_fontpath->header()->hide(); m_fontpath->setSorting(-1); m_addpath = new KURLRequester(box2); m_addpath->setMode(KFile::Directory|KFile::ExistingOnly|KFile::LocalOnly); m_up = new KPushButton(KGuiItem(i18n("&Up"), "up"), box2); m_down = new KPushButton(KGuiItem(i18n("&Down"), "down"), box2); m_add = new KPushButton(KGuiItem(i18n("&Add"), "add"), box2); m_remove = new KPushButton(KGuiItem(i18n("&Remove"), "editdelete"), box2); TQLabel *lab0 = new TQLabel(i18n("Additional director&y:"), box2); lab0->setBuddy(m_addpath); TQVBoxLayout *l0 = new TQVBoxLayout(TQT_TQLAYOUT(box->layout()), KDialog::spacingHint()); l0->addWidget(m_embedfonts); TQVBoxLayout *l1 = new TQVBoxLayout(TQT_TQLAYOUT(box2->layout()), KDialog::spacingHint()); l1->addWidget(m_fontpath); TQHBoxLayout *l2 = new TQHBoxLayout(0, 0, KDialog::spacingHint()); l1->addLayout(l2); l2->addWidget(m_up); l2->addWidget(m_down); l2->addWidget(m_remove); l1->addSpacing(10); l1->addWidget(lab0); l1->addWidget(m_addpath); TQHBoxLayout *l3 = new TQHBoxLayout(0, 0, KDialog::spacingHint()); l1->addLayout(l3); l3->addStretch(1); l3->addWidget(m_add); TQVBoxLayout *l4 = new TQVBoxLayout(this, 0, KDialog::spacingHint()); l4->addWidget(box); l4->addWidget(box2); TQWhatsThis::add(m_embedfonts, i18n("These options will automatically put fonts in the PostScript file " "which are not present on the printer. Font embedding usually produces better print results " "(closer to what you see on the screen), but larger print data as well.")); TQWhatsThis::add(m_fontpath, i18n("When using font embedding you can select additional directories where " "KDE should search for embeddable font files. By default, the X server " "font path is used, so adding those directories is not needed. The default " "search path should be sufficient in most cases.")); connect(m_remove, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemove())); connect(m_add, TQT_SIGNAL(clicked()), TQT_SLOT(slotAdd())); connect(m_up, TQT_SIGNAL(clicked()), TQT_SLOT(slotUp())); connect(m_down, TQT_SIGNAL(clicked()), TQT_SLOT(slotDown())); connect(m_fontpath, TQT_SIGNAL(selectionChanged()), TQT_SLOT(slotSelected())); connect(m_addpath, TQT_SIGNAL(textChanged(const TQString&)), TQT_SLOT(slotTextChanged(const TQString&))); m_add->setEnabled(false); m_remove->setEnabled(false); m_up->setEnabled(false); m_down->setEnabled(false); }
PrefsWages::PrefsWages(QWidget* parent) : QWidget(parent) { QVBoxLayout *vboxLay = new QVBoxLayout; mWagesModel = new QSqlTableModel(this); mWagesModel->setTable("stdSaetze"); mWagesModel->setSort(3, Qt::AscendingOrder); mWagesModel->setEditStrategy(QSqlTableModel::OnManualSubmit); mWagesModel->select(); mWagesModel->setHeaderData(0, Qt::Horizontal, tr("ID")); mWagesModel->setHeaderData(1, Qt::Horizontal, tr("Code")); mWagesModel->setHeaderData(2, Qt::Horizontal, tr("Price")); mWagesModel->setHeaderData(3, Qt::Horizontal, tr("Sortkey")); mProxyModel = new QSortFilterProxyModel(this); mProxyModel->setSourceModel(mWagesModel); mWagesTreeView = new ImpTreeView; vboxLay->addWidget( mWagesTreeView ); mWagesTreeView->setModel(mProxyModel); mWagesTreeView->setItemDelegate(new WagesItemDelegate()); mWagesTreeView->hideColumn(0); mWagesTreeView->hideColumn(3); mWagesTreeView->header()->stretchLastSection(); mWagesTreeView->setColumnWidth(1, 200); mWagesTreeView->resizeColumnToContents(2); mWagesTreeView->resizeColumnToContents(1); mWagesTreeView->setEditTriggers(ImpTreeView::NoEditTriggers); connect( mWagesTreeView, SIGNAL(clicked(QModelIndex)), SLOT( slotWageSelected(QModelIndex) ) ); connect( mWagesTreeView, SIGNAL(doubleClicked(QModelIndex)), SLOT(slotEditWage(QModelIndex))); QHBoxLayout *butLay = new QHBoxLayout; butLay->addStretch( 1 ); mUp = new KPushButton( KIcon("arrow-up"), i18n( "Up" )); connect( mUp, SIGNAL( clicked() ), SLOT( slotUp() ) ); butLay->addWidget( mUp ); mUp->setEnabled(false); mDown = new KPushButton( KIcon("arrow-down"), i18n( "Down" )); connect( mDown, SIGNAL( clicked() ), SLOT( slotDown() ) ); butLay->addWidget( mDown ); mDown->setEnabled(false); KPushButton *but = new KPushButton( KIcon("list-add"), i18n( "Add" )); connect( but, SIGNAL( clicked() ), SLOT( slotAddWage() ) ); butLay->addWidget( but ); mEditWage = new KPushButton( KIcon("document-edit"), i18n( "Edit" )); connect( mEditWage, SIGNAL( clicked() ), SLOT( slotEditWage() ) ); butLay->addWidget( mEditWage ); mEditWage->setEnabled(false); mDelWage = new KPushButton( KIcon("list-remove"), i18n( "Remove" ) ); connect( mDelWage, SIGNAL( clicked() ), SLOT( slotDeleteWage() ) ); butLay->addWidget( mDelWage ); mDelWage->setEnabled( false ); vboxLay->addLayout( butLay ); this->setLayout( vboxLay ); }