EvaListView::EvaListView(TQWidget *parent, const char *name, WFlags f) : TQListView(parent, name, f) { setItemMargin(EVA_LV_LEFT_MARGIN); addColumn("1"); setColumnWidthMode( 0, Manual); // addColumn("2"); // setColumnWidthMode( 1, Manual); header()->hide(); setSorting(0); setRootIsDecorated( false ); setTreeStepSize( 8 ); setDragAutoScroll(true); setHScrollBarMode(TQScrollView::AlwaysOff); setFrameShape( TQFrame::NoFrame ); setAcceptDrops( true ); setSelectionMode( TQListView::Extended ); setSelectionMode(TQListView::Single); m_tooltip = new EvaLVToolTip(this); clearWFlags( WStaticContents ); setWFlags( WNoAutoErase ); static_cast<EvaListView*>(viewport())->clearWFlags( WStaticContents ); static_cast<EvaListView*>(viewport())->setWFlags( WNoAutoErase ); codec = TQTextCodec::codecForName("GB18030"); }
void MozQWidget::setModal(bool modal) { if (modal) setWFlags(Qt::WShowModal); else clearWFlags(Qt::WShowModal); }
void QWidget::erase( const QRegion& reg ) { //this is experimental, I need to test more, but it seems in unclipped mode erasing shouldn't happen???? if ( backgroundMode() == NoBackground || testWFlags(WPaintUnclipped) ) return; bool unclipped = testWFlags( WPaintUnclipped ); clearWFlags( WPaintUnclipped ); QPainter p(this); p.setClipRegion( reg ); if ( extra && extra->bg_pix ) { if ( !extra->bg_pix->isNull() ) { QPoint offset = backgroundOffset(); int xoff = offset.x(); int yoff = offset.y(); p.drawTiledPixmap(rect(),*extra->bg_pix, QPoint(xoff%extra->bg_pix->width(), yoff%extra->bg_pix->height())); } } else { p.fillRect(rect(),bg_col); } if ( unclipped ) setWFlags( WPaintUnclipped ); }
QTitleBar::QTitleBar(QWidget* w, QWidget* parent, const char* name) : QWidget( parent, name, WStyle_Customize | WStyle_NoBorder | WNoAutoErase ) { d = new QTitleBarPrivate(); #ifndef QT_NO_TOOLTIP d->toolTip = new QTitleBarTip( this ); #endif d->window = w; d->buttonDown = QStyle::SC_None; d->act = 0; if ( w ) { setWFlags( ((QTitleBar*)w)->getWFlags() | WNoAutoErase ); if ( w->minimumSize() == w->maximumSize() ) clearWFlags( WStyle_Maximize ); #ifndef QT_NO_WIDGET_TOPEXTRA setCaption( w->caption() ); #endif } else { setWFlags( WStyle_Customize | WNoAutoErase ); } readColors(); setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); setMouseTracking(TRUE); }
void FLReportViewer::exec() { QString fileTemp = "document_"; fileTemp += QDateTime::currentDateTime().toString().replace(":", "").replace(" ", ""); //Esto lo cambiamos por un string con el tiempo fileTemp += ".pdf"; if (!soyGuaca_) /// Si no soy Guaca , me comporto normalmente. { if (loop) { #ifdef FL_DEBUG qWarning(tr("FLReportViewer::exec(): Se ha detectado una llamada recursiva")); #endif return; } QWidget::show(); if (embedInParent_) return; loop = true; QApplication::eventLoop()->enterLoop(); clearWFlags(WShowModal); } else /// de lo contrario, soy Guaca { QClipboard *clipboard = QApplication::clipboard(); reportPrinted_ = rptViewer_->printReportToPDF(guacaFolder_ + fileTemp); clipboard->setText("GUACA_IMPRIME" + fileTemp); /// Pongo en el portapapeles la bandera } }
void fix() { QRect g = geometry(); QColor bg = backgroundColor(); bool mt = hasMouseTracking(); bool hascurs = testWFlags( WCursorSet ); QCursor curs = cursor(); clearWFlags( WState_Created ); clearWFlags( WState_Visible ); create( 0, TRUE, FALSE ); setGeometry(g); setBackgroundColor( bg ); setMouseTracking( mt ); if ( hascurs ) { setCursor( curs ); } }
int K3bInteractionDialog::exec( bool returnOnHide ) { m_exitLoopOnHide = returnOnHide; // the following code is mainly taken from QDialog::exec if( m_inLoop ) { kdError() << "(K3bInteractionDialog::exec) Recursive call detected." << endl; return -1; } bool destructiveClose = testWFlags( WDestructiveClose ); clearWFlags( WDestructiveClose ); bool wasShowModal = testWFlags( WShowModal ); setWFlags( WShowModal ); setResult( 0 ); loadStartupSettings(); show(); if( m_delayedInit ) QTimer::singleShot( 0, this, SLOT(slotDelayedInit()) ); else init(); m_inLoop = true; QApplication::eventLoop()->enterLoop(); if( !wasShowModal ) clearWFlags( WShowModal ); int res = result(); if( destructiveClose ) delete this; return res; }
void FLReportViewer::exec() { if (loop) { #ifdef FL_DEBUG qWarning(tr("FLReportViewer::exec(): Se ha detectado una llamada recursiva")); #endif return; } QWidget::show(); if (embedInParent_) return; loop = true; QApplication::eventLoop()->enterLoop(); clearWFlags(WShowModal); }
/*! Creates a QNPWidget. */ QNPWidget::QNPWidget() : pi(next_pi) { if (!next_pi) { qFatal("QNPWidget must only be created within call to newWindow"); } next_pi->widget = this; next_pi = 0; #ifdef Q_WS_WIN clearWFlags( WStyle_NormalBorder | WStyle_Title | WStyle_MinMax | WStyle_SysMenu ); topData()->ftop = 0; topData()->fright = 0; topData()->fleft = 0; topData()->fbottom = 0; #endif }
/*! For internal use only. */ void QNPWidget::setWindow(bool delold) { saveWId = winId(); // ### Don't need this anymore create((WId)pi->window, FALSE, delold); if ( delold ) { // Make sure they get a show() clearWFlags( WState_Visible ); } #ifdef _WS_X11_ Widget w = XtWindowToWidget (qt_xdisplay(), pi->window); XtAddEventHandler(w, EnterWindowMask, FALSE, enter_event_handler, pi); XtAddEventHandler(w, LeaveWindowMask, FALSE, leave_event_handler, pi); Pixmap bgpm=0; XColor col; XtVaGetValues(w, XtNbackground, &col.pixel, XtNbackgroundPixmap, &bgpm, 0, 0); XQueryColor(qt_xdisplay(), x11Colormap(), &col); setBackgroundColor(QColor(col.red >> 8, col.green >> 8, col.blue >> 8)); if (bgpm) { // ### Need an under-the-hood function here, or we have to // ### rewrite lots of code from QPixmap::convertToImage(). // ### Doesn't matter yet, because Netscape doesn't ever set // ### the background image of the window it gives us. } #endif createNewWindowsForAllChildren(this); //#ifdef _WS_WIN_ //setGeometry( pi->x, pi->y, pi->width, pi->height ); //#else resize( pi->width, pi->height ); //#endif }
OscarEncodingSelectionDialog::OscarEncodingSelectionDialog( QWidget* parent, int initialEncoding ) : KDialogBase( parent, 0, false, i18n( "Select Encoding" ), Ok | Cancel ) { int initialEncodingIndex; clearWFlags( QWidget::WDestructiveClose ); m_encodingUI = new OscarEncodingBaseUI( this ); //fill the encoding combo boxes m_encodings.insert(0, i18n("Default")); m_encodings.insert(2026, i18n("Big5")); m_encodings.insert(2101, i18n("Big5-HKSCS")); m_encodings.insert(18, i18n("euc-JP Japanese")); m_encodings.insert(38, i18n("euc-KR Korean")); m_encodings.insert(57, i18n("GB-2312 Chinese")); m_encodings.insert(113, i18n("GBK Chinese")); m_encodings.insert(114, i18n("GB18030 Chinese")); m_encodings.insert(16, i18n("JIS Japanese")); m_encodings.insert(17, i18n("Shift-JIS Japanese")); m_encodings.insert(2084, i18n("KOI8-R Russian")); m_encodings.insert(2088, i18n("KOI8-U Ukrainian")); m_encodings.insert(4, i18n("ISO-8859-1 Western")); m_encodings.insert(5, i18n("ISO-8859-2 Central European")); m_encodings.insert(6, i18n("ISO-8859-3 Central European")); m_encodings.insert(7, i18n("ISO-8859-4 Baltic")); m_encodings.insert(8, i18n("ISO-8859-5 Cyrillic")); m_encodings.insert(9, i18n("ISO-8859-6 Arabic")); m_encodings.insert(10, i18n("ISO-8859-7 Greek")); m_encodings.insert(11, i18n("ISO-8859-8 Hebrew, visually ordered")); m_encodings.insert(85, i18n("ISO-8859-8-I Hebrew, logically ordered")); m_encodings.insert(12, i18n("ISO-8859-9 Turkish")); m_encodings.insert(13, i18n("ISO-8859-10")); m_encodings.insert(109, i18n("ISO-8859-13")); m_encodings.insert(110, i18n("ISO-8859-14")); m_encodings.insert(111, i18n("ISO-8859-15 Western")); m_encodings.insert(2250, i18n("Windows-1250 Central European")); m_encodings.insert(2251, i18n("Windows-1251 Cyrillic")); m_encodings.insert(2252, i18n("Windows-1252 Western")); m_encodings.insert(2253, i18n("Windows-1253 Greek")); m_encodings.insert(2254, i18n("Windows-1254 Turkish")); m_encodings.insert(2255, i18n("Windows-1255 Hebrew")); m_encodings.insert(2256, i18n("Windows-1256 Arabic")); m_encodings.insert(2257, i18n("Windows-1257 Baltic")); m_encodings.insert(2258, i18n("Windows-1258 Viet Nam")); m_encodings.insert(2009, i18n("IBM 850")); m_encodings.insert(2085, i18n("IBM 866")); m_encodings.insert(2259, i18n("TIS-620 Thai")); m_encodings.insert(106, i18n("UTF-8 Unicode")); m_encodings.insert(1015, i18n("UTF-16 Unicode")); m_encodingUI->encodingCombo->insertStringList( m_encodings.values() ); if( (initialEncodingIndex = m_encodings.keys().findIndex(initialEncoding)) == -1 ) { kdWarning() << k_funcinfo << "Requested encoding mib " << initialEncoding << " not in encoding list - defaulting to first encoding item" << " in list to be shown in combobox initially" << endl; /* initialEncodingIndex = position in combobox, value 0 currently * corresponds to ISO-8859-1, generally to the first item in combobox, * which usually is the default */ initialEncodingIndex = 0; } m_encodingUI->encodingCombo->setCurrentItem( initialEncodingIndex ); setMainWidget( m_encodingUI ); }
KstApp::KstApp(QWidget *parent, const char* name) : KMainWindow(parent, name) { clearWFlags(WDestructiveClose); stopping = false; config = kapp->config(); initStatusBar(); initDocument(); initView(); /* create dialogs */ debugDialog = new KstDebugDialogI(this); plotDialog = new KstPlotDialogI(doc, this); dataManager = new KstDataManagerI(doc, this); filterListEditor = new FilterListEditor(this); viewScalarsDialog = new KstViewScalarsDialogI(this); viewVectorsDialog = new KstViewVectorsDialogI(this); changeFileDialog = new KstChangeFileDialogI(this); changeNptsDialog = new KstChangeNptsDialogI(this); quickCurvesDialog = new KstQuickCurvesDialogI(this); quickPSDDialog = new KstQuickPSDDialogI(this); graphFileDialog = new KstGraphFileDialogI(this); vectorSaveDialog = new VectorSaveDialog(this); connect(KstVectorDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); connect(KstCurveDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); connect(KstEqDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); connect(KstHsDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); connect(KstPsdDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); connect(KstPluginDialogI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); connect(KstEventMonitorI::globalInstance(), SIGNAL(modified()), doc, SLOT(wasModified())); initActions(); readOptions(); _updateThread = new UpdateThread(doc); _updateThread->setUpdateTime(KstSettings::globalSettings()->plotUpdateTimer); _updateThread->start(); connect(doc, SIGNAL(newFrameMsg(int)), this, SLOT(slotUpdateFrameMsg(int))); connect(view, SIGNAL(newStatusMsg(const QString &)), this, SLOT(slotUpdateStatusMsg(const QString &))); connect(view, SIGNAL(newDataMsg(const QString &)), this, SLOT(slotUpdateDataMsg(const QString &))); /*** Plot Dialog signals */ connect(changeFileDialog, SIGNAL(docChanged()), this, SLOT(registerDocChange())); connect(changeNptsDialog, SIGNAL(docChanged()), this, SLOT(registerDocChange())); connect(quickCurvesDialog,SIGNAL(docChanged()), this, SLOT(registerDocChange())); connect(quickPSDDialog, SIGNAL(docChanged()), this, SLOT(registerDocChange())); connect(filterListEditor, SIGNAL(docChanged()), this, SLOT(registerDocChange())); connect(graphFileDialog, SIGNAL(graphFileReq(const QString &,int,int)), view, SLOT(printToGraphicsFile(const QString &,int,int))); /*** label dialog ***/ connect(view->labelDialog, SIGNAL(applied()), this, SLOT(registerDocChange())); /*** plot dialog ***/ connect(plotDialog, SIGNAL(docChanged()), this, SLOT(registerDocChange())); /*** ***/ connect(doc, SIGNAL(dataChanged()), this, SLOT(updateDialogs())); connect(dataManager, SIGNAL(editDataVector(const QString &)), KstVectorDialogI::globalInstance(), SLOT(show_I(const QString &))); connect(dataManager->OpenPlotDialog, SIGNAL(clicked()), this, SLOT(showPlotDialog())); setAutoSaveSettings("KST-KMainWindow", true); _dcopIface = new KstIfaceImpl(doc, this); view->forceUpdate(); connect(this, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged())); QTimer::singleShot(0, this, SLOT(updateActions())); // Load any extensions ExtensionMgr *mgr = ExtensionMgr::self(); mgr->setWindow(this); KService::List sl = KServiceType::offers("Kst Extension"); for (KService::List::ConstIterator it = sl.begin(); it != sl.end(); ++it) { KService::Ptr service = *it; QString name = service->property("Name").toString(); if (!mgr->enabled(name) && !service->property("X-Kst-Enabled").toBool()) { continue; } mgr->loadExtension(service); } }