Exemplo n.º 1
0
WatchersDialog::WatchersDialog(KConfig& cfg, QWidget* parent, const char* name)
    : KDialogBase(parent, name, false, QString::null,
                  Close, ButtonCode(0), true)
    , partConfig(cfg)
{
    QFrame* mainWidget = makeMainWidget();

    QBoxLayout *layout = new QVBoxLayout(mainWidget, 0, spacingHint());

    table = new QTable(mainWidget, "watchersTable");
    table->setNumCols(5);
    table->setSelectionMode(QTable::NoSelection);
    table->setColumnMovingEnabled(false);
    table->setRowMovingEnabled(false);
    table->setReadOnly(true);
    table->setDragEnabled(false);
    table->setSorting(true);
    table->verticalHeader()->hide();
    table->setLeftMargin(0);
    
    QHeader* header = table->horizontalHeader();
    header->setLabel(0, i18n("File"));
    header->setLabel(1, i18n("Watcher"));
    header->setLabel(2, i18n("Edit"));
    header->setLabel(3, i18n("Unedit"));
    header->setLabel(4, i18n("Commit"));
    
    layout->addWidget(table, 1);

    setWFlags(Qt::WDestructiveClose | getWFlags());

    QSize size = configDialogSize(partConfig, "WatchersDialog");
    resize(size);
}
Exemplo n.º 2
0
// Constructor.
qsamplerChannelRoutingTable::qsamplerChannelRoutingTable (
	QWidget *pParent, const char *pszName )
	: QTable(pParent, pszName)
{
	// Set fixed number of columns.
	QTable::setNumCols(2);
	QTable::setShowGrid(false);
	QTable::setSorting(false);
	QTable::setFocusStyle(QTable::FollowStyle);
	QTable::setSelectionMode(QTable::NoSelection);
	// No vertical header.
	QTable::verticalHeader()->hide();
	QTable::setLeftMargin(0);
	// Initialize the fixed table column headings.
	QHeader *pHeader = QTable::horizontalHeader();
	pHeader->setLabel(0, tr("Sampler Channel"));
	pHeader->setLabel(1, tr("Device Channel"));
	// Set read-onlyness of each column
	QTable::setColumnReadOnly(0, true);
//	QTable::setColumnReadOnly(1, false); -- of course not.
	QTable::setColumnStretchable(1, true);
}
Exemplo n.º 3
0
GUITabla::GUITabla(int filas, QStringList encabezado, QWidget *parent, const char *name)
:QTable(parent, name)
{
	QHeader *header = horizontalHeader();
	{	
		header->setMovingEnabled(true);
		setNumCols(encabezado.count());
		setNumRows(filas);
		for(uint i = 0; i < encabezado.count(); i++)
		{ 
			header->setLabel( i, tr(encabezado[i]) );
			adjustColumn(i);
		}
		connect(this, SIGNAL(valueChanged(int,int) ), SLOT(ajustarTamano(int, int)));
		show();
	}
	setReadOnly ( true );
}
Exemplo n.º 4
0
int CarListVisual::Init(const std::map<QString, QString> & mapParams)
{
	if (TableVisualizer::Init(mapParams))
		return 1;

	QDraggingTable * pTable = ((QTableVisualizer *)m_pWidget)->m_pTable;

	pTable->setNumCols(7);

	QHeader * pHHeader = pTable->horizontalHeader();
	pHHeader->setMovingEnabled(false);
	pHHeader->setLabel(0, "");
	pTable->setColumnWidth(0, 32);
	pHHeader->setLabel(1, "Vehicle");
	pTable->setColumnWidth(1, 120);
	pHHeader->setLabel(2, "Type");
	pTable->setColumnWidth(2, 150);
	pHHeader->setLabel(3, "Longitude");
	pTable->setColumnWidth(3, 120);
	pHHeader->setLabel(4, "Latitude");
	pTable->setColumnWidth(4, 120);
	pHHeader->setLabel(5, "Speed");
	pTable->setColumnWidth(5, 70);
	pHHeader->setLabel(6, "Heading");
	pTable->setColumnWidth(6, 90);
	pTable->verticalHeader()->hide();
	pTable->setColumnMovingEnabled(false);
	pTable->setFocusStyle(QTable::FollowStyle);
	pTable->setLeftMargin(0);
	pTable->setReadOnly(true);
	pTable->setRowMovingEnabled(false);
	pTable->setSelectionMode(QTable::SingleRow);
	pTable->setShowGrid(true);
	pTable->setSorting(false);
	pTable->SetDragObjectCreator(CarListVisualDragObjectCreator, this);
	pTable->setDragEnabled(true);
	m_pRightClickMenu = new QPopupMenu(pTable);
	m_pRightClickMenu->insertItem("Send Message...", 0);

	UpdateTable();

	return 0;
}
Exemplo n.º 5
0
void ListViewEditor::setupItems()
{
    itemColumn->setMinValue( 0 );
    itemColumn->setMaxValue( QMAX( numColumns - 1, 0 ) );
    int i = 0;
    QHeader *header = itemsPreview->header();
    for ( QListBoxItem *item = colPreview->firstItem(); item; item = item->next() ) {
	Column *col = findColumn( item );
	if ( !col )
	    continue;
	if ( i >= itemsPreview->columns() )
	    itemsPreview->addColumn( col->text );
	header->setLabel( i, col->pixmap, col->text );
	header->setResizeEnabled( col->resizable, i );
	header->setClickEnabled( col->clickable, i );
	++i;
    }
    while ( itemsPreview->columns() > i )
	itemsPreview->removeColumn( i );

    itemColumn->setValue( QMIN( numColumns - 1, itemColumn->value() ) );
}
Exemplo n.º 6
0
ClsQHarborImpl::ClsQHarborImpl(QWidget* parent, const char* name, bool modal, WFlags fl):
    ClsQHarbor(parent, name,modal, fl)  {
    setAcceptDrops(TRUE);
    QHeader *th = qtableEntries->horizontalHeader();
    th->setLabel( COL_TYPE, "Type" );
    th->setLabel( COL_NAME, "Name" );
    th->setLabel( COL_ID, "ID" );
    th->setLabel( COL_CHILD, "Child" );
    th->setLabel( COL_PARAM_LABEL, "Parameter" );
    th->setLabel( COL_MIN, "Min");
    th->setLabel( COL_MAX, "Max");
    th->setLabel( COL_VALUE, "Value");
    qtableEntries->hideColumn(COL_PARAM_NAME);

    bSimulationRunning = false;
    clsItem = NULL;
    mapParams.clear();

    void ();
    void ();
    void ();

    connect(pbDeleteRow, SIGNAL(clicked()), SLOT(slotDeleteRow()));
    connect(pbSaveConfig, SIGNAL(clicked()), SLOT(slotSaveConfig()));
    connect(pbLoadConfig, SIGNAL(clicked()), SLOT(slotLoadConfig()));

    connect(pbSaveParamSet, SIGNAL(clicked()), SLOT(slotSaveParamSet()));
    connect(pbLoadParamSet, SIGNAL(clicked()), SLOT(slotLoadParamSet()));


    connect(pbRefresh, SIGNAL(clicked()), SLOT(slotRefresh()));

    connect(qtableEntries, SIGNAL(doubleClicked(int, int, int, const QPoint &)), SLOT(slotCellDoubleClicked(int, int, int, const QPoint &)));



}
Exemplo n.º 7
0
TesterReport::TesterReport (QWidget *p) : QWidget (p)
{
  QVBoxLayout *vbox = new QVBoxLayout(this);
  vbox->setMargin(5);
  vbox->setSpacing(5);

  tradeList = new QTable(0, 9, this);
  tradeList->setSelectionMode(QTable::Single);
  tradeList->setSorting(FALSE);
  QHeader *header = tradeList->horizontalHeader();
  header->setLabel(0, tr("Type"), 40);
  header->setLabel(1, tr("Entry"), 90);
  header->setLabel(2, tr("Entry Price"), 60);
  header->setLabel(3, tr("Exit"), 90);
  header->setLabel(4, tr("Exit Price"), 60);
  header->setLabel(5, tr("Signal"), -1);
  header->setLabel(6, tr("Profit"), 60);
  header->setLabel(7, tr("Account"), -1);
  header->setLabel(8, tr("Vol"), 60);
  vbox->addWidget(tradeList);

  int loop;
  for (loop = 0; loop < 9; loop++)
    tradeList->setColumnReadOnly(loop, TRUE);
    
  // test summary
  
  QHBoxLayout *hbox = new QHBoxLayout(vbox);
  hbox->setSpacing(5);

  QVGroupBox *gbox = new QVGroupBox(tr("Test Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  QLabel *label = new QLabel(tr("Account Balance "), gbox);
  summaryBalance = new QLabel(" ", gbox);
  
  label = new QLabel(tr("Net Profit "), gbox);
  summaryNetProfit = new QLabel(" ", gbox);

  label = new QLabel(tr("Net Profit % "), gbox);
  summaryNetPercentage = new QLabel(" ", gbox);

  label = new QLabel(tr("Initial Investment "), gbox);
  summaryInvestment = new QLabel(" ", gbox);

  label = new QLabel(tr("Commissions "), gbox);
  summaryCommission = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest Drawdown "), gbox);
  summaryDrawdown = new QLabel(" ", gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryShortTrades = new QLabel(" ", gbox);
  
  // win summary

  gbox = new QVGroupBox(tr("Win Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryWinTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Profit "), gbox);
  summaryTotalWinTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Average "), gbox);
  summaryAverageWin = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest "), gbox);
  summaryLargestWin = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryWinLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryWinShortTrades = new QLabel(" ", gbox);

  // lose summary

  gbox = new QVGroupBox(tr("Loss Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryLoseTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Profit "), gbox);
  summaryTotalLoseTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Average "), gbox);
  summaryAverageLose = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest "), gbox);
  summaryLargestLose = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryLoseLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryLoseShortTrades = new QLabel(" ", gbox);
}
/*
 *  Constructs a isiTapResults as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
isiTapResults::isiTapResults( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
	QRect rc;
	QHeader *header;

	bExitPossible=false;
    if ( !name )
	setName( "isiTapResults" );

    PushButtonOK = new QPushButton( this, "PushButtonOK" );
    PushButtonOK->setGeometry( QRect( 183, 310, 75, 23 ) );
    PushButtonOK->setFocusPolicy( QPushButton::NoFocus );
    PushButtonOK->setDefault( TRUE );
//	PushButtonOK->setMaximumSize(75,23);

    PushButtonCANCEL = new QPushButton( this, "PushButtonCANCEL" );
    PushButtonCANCEL->setGeometry( QRect( 290, 310, 75, 23 ) );
    PushButtonCANCEL->setFocusPolicy( QPushButton::NoFocus );
	PushButtonCANCEL->hide();
	PushButtonOK->hide();
//	PushButtonCANCEL->setMaximumSize(75,23);

	connect( PushButtonOK, SIGNAL( clicked() ), this,  SLOT(PushButtonOK_clicked())  );
	connect( PushButtonCANCEL, SIGNAL( clicked() ), this,  SLOT(PushButtonCANCEL_clicked())  );

	Layout1 = new QVBoxLayout( this, 0, 6, "Layout1"); 


    IDC_CHAN = new QTable( this, "IDC_CHAN" );
    IDC_CHAN->setGeometry( QRect( 12, 12, 538, 112 ) );
    IDC_CHAN->setNumRows( 0 );
    IDC_CHAN->setNumCols( 5 );

    IDC_CHAN->setSelectionMode( QTable::SingleRow );
	IDC_CHAN->verticalHeader()->hide();
	IDC_CHAN->setLeftMargin(0);

    header = IDC_CHAN->horizontalHeader();
//	GetTextRectangle(header,"99:99:99 99/99/9999", rc);

	header->setLabel( 0, QObject::tr( "Station" ), 75 );
    header->setLabel( 1, QObject::tr( "Channel" ), 75 );
	header->setLabel( 2, QObject::tr( "SpS" ),     75 );
	header->setLabel( 3, QObject::tr( "Tbeg" ),    75 );
	header->setLabel( 4, QObject::tr( "Tend" ),    75 );

	header->adjustHeaderSize();
	adjustTableColumnWidth();




	Layout1->addWidget(IDC_CHAN);




    outputLog = new QLabel( this, "outputLog" );
    outputLog->setGeometry( QRect( 12, 130, 538, 112 ) );
	Layout1->addWidget(outputLog);

//    outputLog->setReadOnly( TRUE );

    progressBar1 = new QProgressBar( this, "progressBar1" );
    progressBar1->setGeometry( QRect( 10, 260, 540, 22 ) );
	Layout1->addWidget(progressBar1);
	Layout1->addWidget(outputLog);

	QGridLayout *gridLayout1 = new QGridLayout( Layout1, 1, 0, 5); 
//	Layout1->addItem(gridLayout1);

	gridLayout1->addWidget(PushButtonOK,0,3);
	gridLayout1->addWidget(PushButtonCANCEL, 0, 4);

    languageChange();
    resize( QSize(556, 354).expandedTo(minimumSizeHint()) );

//	outputLog->adjust();

    clearWState( WState_Polished );
	StartGettingData(this);

}
Exemplo n.º 9
0
KDE_NO_CDTOR_EXPORT KMPlayerPrefBroadcastFormatPage::KMPlayerPrefBroadcastFormatPage (QWidget *parent, FFServerSettingList & ffs) : QFrame (parent, "BroadcastPage"), profiles (ffs)
{
    QHBoxLayout *layout = new QHBoxLayout (this, 5);
    QGridLayout *formatlayout = new QGridLayout (11, 2, 2);
    formatlayout->setAlignment (Qt::AlignTop);
    QVBoxLayout *leftlayout = new QVBoxLayout (15);
    QHBoxLayout *ledlayout = new QHBoxLayout (5);
    format = new QComboBox (this);
    QLabel * label = new QLabel (format, i18n ("Format:"), this);
    format->clear ();
    format->insertItem (QString ("asf"));
    format->insertItem (QString ("avi"));
    format->insertItem (QString ("mpjpeg"));
    format->insertItem (QString ("mpeg"));
    format->insertItem (QString ("rm"));
    format->insertItem (QString ("swf"));
    QWhatsThis::add (format, i18n ("Only avi, mpeg and rm work for mplayer playback"));
    formatlayout->addWidget (label, 0, 0);
    formatlayout->addWidget (format, 0, 1);
    ADDPROPERTY (i18n ("Audio codec:"), audiocodec, formatlayout, 1, this);
    ADDPROPERTY (i18n ("Audio bit rate (kbit):"), audiobitrate, formatlayout, 2, this);
    ADDPROPERTY (i18n ("Audio sample rate (Hz):"), audiosamplerate, formatlayout, 3, this);
    ADDPROPERTY (i18n ("Video codec:"), videocodec, formatlayout, 4, this);
    ADDPROPERTY (i18n ("Video bit rate (kbit):"), videobitrate, formatlayout, 5, this);
    ADDPROPERTY (i18n ("Quality (1-31):"), quality, formatlayout, 6, this);
    ADDPROPERTY (i18n ("Frame rate (Hz):"), framerate, formatlayout, 7, this);
    ADDPROPERTY (i18n ("Gop size:"), gopsize, formatlayout, 8, this);
    ADDPROPERTY (i18n ("Width (pixels):"), moviewidth, formatlayout, 9, this);
    ADDPROPERTY (i18n ("Height (pixels):"), movieheight, formatlayout, 10, this);
    label = new QLabel (i18n ("Allow access from:"), this);
    accesslist = new QTable (40, 1, this);
    accesslist->verticalHeader ()->hide ();
    accesslist->setLeftMargin (0);
    accesslist->setColumnWidth (0, 250);
    QWhatsThis::add (accesslist, i18n ("'Single IP' or 'start-IP end-IP' for IP ranges"));
    QHeader *header = accesslist->horizontalHeader ();
    header->setLabel (0, i18n ("Host/IP or IP Range"));
    QFrame *profileframe = new QFrame (this);
    QGridLayout *profileslayout = new QGridLayout (profileframe, 5, 2, 2);
    profile = new QLineEdit ("", profileframe);
    connect (profile, SIGNAL(textChanged (const QString &)),
             this, SLOT (slotTextChanged (const QString &)));
    profilelist = new QListBox (profileframe);
    for (int i = 0; i < (int) profiles.size (); i++)
        profilelist->insertItem (profiles[i]->name, i);
    connect (profilelist, SIGNAL (selected (int)),
             this, SLOT (slotIndexChanged (int)));
    connect (profilelist, SIGNAL (highlighted (int)),
             this, SLOT (slotItemHighlighted (int)));
    load = new QPushButton (i18n ("Load"), profileframe);
    save = new QPushButton (i18n ("Save"), profileframe);
    del = new QPushButton (i18n ("Delete"), profileframe);
    load->setEnabled (false);
    save->setEnabled (false);
    del->setEnabled (false);
    connect (load, SIGNAL (clicked ()), this, SLOT (slotLoad ()));
    connect (save, SIGNAL (clicked ()), this, SLOT (slotSave ()));
    connect (del, SIGNAL (clicked ()), this, SLOT (slotDelete ()));
    profileslayout->addWidget (profile, 0, 0);
#if (QT_VERSION < 0x030200)
    profileslayout->addRowSpacing (4, 60);
#else
    profileslayout->setRowSpacing (4, 60);
#endif
    profileslayout->addMultiCellWidget (profilelist, 1, 4, 0, 0);
    profileslayout->addWidget (load, 1, 1);
    profileslayout->addWidget (save, 2, 1);
    profileslayout->addWidget (del, 3, 1);
    leftlayout->addWidget (profileframe);
    startbutton = new QPushButton (i18n ("Start"), this);
    serverled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
    feedled = new KLed (Qt::green, KLed::Off, KLed::Raised, KLed::Circular, this);
    ledlayout->addWidget (startbutton);
    ledlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
    ledlayout->addWidget (serverled);
    ledlayout->addWidget (feedled);
    leftlayout->addLayout (ledlayout);
    QFrame * line = new QFrame (this);
    line->setFrameShape (QFrame::HLine);
    leftlayout->addWidget (line);
    leftlayout->addWidget (label);
    leftlayout->addWidget (accesslist);
    leftlayout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
    layout->addLayout (leftlayout);
    line = new QFrame (this);
    line->setFrameShape (QFrame::VLine);
    layout->addWidget (line);
    layout->addLayout (formatlayout);
    layout->addItem (new QSpacerItem (0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
}