コード例 #1
0
SettingsPageUnits::SettingsPageUnits(QWidget *parent) : QWidget(parent)
{
  setObjectName("SettingsPageUnits");
  setWindowFlags( Qt::Tool );
  setWindowModality( Qt::WindowModal );
  setAttribute(Qt::WA_DeleteOnClose);
  setWindowTitle( tr("Settings - Units") );

  if( parent )
    {
      resize( parent->size() );
    }

  // Layout used by scroll area
  QHBoxLayout *sal = new QHBoxLayout;

  // new widget used as container for the dialog layout.
  QWidget* sw = new QWidget;

  // Scroll area
  QScrollArea* sa = new QScrollArea;
  sa->setWidgetResizable( true );
  sa->setFrameStyle( QFrame::NoFrame );
  sa->setWidget( sw );

#ifdef ANDROID
  QScrollBar* lvsb = sa->verticalScrollBar();
  lvsb->setStyleSheet( Layout::getCbSbStyle() );
#endif

#ifdef QSCROLLER
  QScroller::grabGesture( sa->viewport(), QScroller::LeftMouseButtonGesture );
#endif

#ifdef QTSCROLLER
  QtScroller::grabGesture( sa->viewport(), QtScroller::LeftMouseButtonGesture );
#endif

  // Add scroll area to its own layout
  sal->addWidget( sa );

  QHBoxLayout *contentLayout = new QHBoxLayout;
  setLayout(contentLayout);

  // Pass scroll area layout to the content layout.
  contentLayout->addLayout( sal, 10 );

  // The parent of the layout is the scroll widget
  QGridLayout *topLayout = new QGridLayout(sw);

  int row=0;

  QLabel *label = new QLabel(tr("Altitude:"), this);
  topLayout->addWidget(label, row, 0);
  UnitAlt = new QComboBox(this);
  UnitAlt->setObjectName("UnitAlt");
  UnitAlt->setEditable(false);
  topLayout->addWidget(UnitAlt,row++,1);
  UnitAlt->addItem(tr("meters"));
  UnitAlt->addItem(tr("feet"));
  altitudes[0] = int(Altitude::meters);
  altitudes[1] = int(Altitude::feet);

  label = new QLabel(tr("Speed:"), this);
  topLayout->addWidget(label, row, 0);
  UnitSpeed = new QComboBox(this);
  UnitSpeed->setObjectName("UnitSpeed");
  UnitSpeed->setEditable(false);
  topLayout->addWidget(UnitSpeed,row++,1);
  UnitSpeed->addItem(tr("meters per second"));
  UnitSpeed->addItem(tr("kilometers per hour"));
  UnitSpeed->addItem(tr("knots"));
  UnitSpeed->addItem(tr("miles per hour"));
  speeds[0] = Speed::metersPerSecond;
  speeds[1] = Speed::kilometersPerHour;
  speeds[2] = Speed::knots;
  speeds[3] = Speed::milesPerHour;

  label = new QLabel(tr("Distance:"), this);
  topLayout->addWidget(label, row, 0);
  UnitDistance = new QComboBox(this);
  UnitDistance->setObjectName("UnitDistance");
  UnitDistance->setEditable(false);
  topLayout->addWidget(UnitDistance,row++,1);
  UnitDistance->addItem(tr("kilometers"));
  UnitDistance->addItem(tr("statute miles"));
  UnitDistance->addItem(tr("nautical miles"));
  distances[0] = Distance::kilometers;
  distances[1] = Distance::miles;
  distances[2] = Distance::nautmiles;

  label = new QLabel(tr("Vario:"), this);
  topLayout->addWidget(label, row, 0);
  UnitVario = new QComboBox(this);
  UnitVario->setObjectName("UnitVario");
  UnitVario->setEditable(false);
  topLayout->addWidget(UnitVario,row++,1);
  UnitVario->addItem(tr("meters per second"));
  UnitVario->addItem(tr("feet per minute"));
  UnitVario->addItem(tr("knots"));
  varios[0] = Speed::metersPerSecond;
  varios[1] = Speed::feetPerMinute;
  varios[2] = Speed::knots;

  label = new QLabel(tr("Wind:"), this);
  topLayout->addWidget(label, row, 0);
  UnitWind = new QComboBox(this);
  UnitWind->setObjectName("UnitWind");
  UnitWind->setEditable(false);
  topLayout->addWidget(UnitWind,row++,1);
  UnitWind->addItem(tr("meters per second"));
  UnitWind->addItem(tr("kilometers per hour"));
  UnitWind->addItem(tr("knots"));
  UnitWind->addItem(tr("miles per hour"));
  winds[0] = Speed::metersPerSecond;
  winds[1] = Speed::kilometersPerHour;
  winds[2] = Speed::knots;
  winds[3] = Speed::milesPerHour;

  label = new QLabel(tr("Position:"), this);
  topLayout->addWidget(label, row, 0);
  UnitPosition = new QComboBox(this);
  UnitPosition->setObjectName("UnitPosition");
  UnitPosition->setEditable(false);
  topLayout->addWidget(UnitPosition,row++,1);
  UnitPosition->addItem(QString("ddd") + Qt::Key_degree + "mm'ss\"");
  UnitPosition->addItem(QString("ddd") + Qt::Key_degree + "mm.mmm'");
  UnitPosition->addItem(QString("ddd.ddddd") + Qt::Key_degree);
  positions[0] = WGSPoint::DMS;
  positions[1] = WGSPoint::DDM;
  positions[2] = WGSPoint::DDD;

  label = new QLabel(tr("Time:"), this);
  topLayout->addWidget(label, row, 0);
  UnitTime = new QComboBox(this);
  UnitTime->setObjectName("UnitTime");
  UnitTime->setEditable(false);
  topLayout->addWidget(UnitTime,row++,1);
  UnitTime->addItem(tr("UTC"));
  UnitTime->addItem(tr("Local"));
  times[0] = Time::utc;
  times[1] = Time::local;

  label = new QLabel(tr("Temperature:"), this);
  topLayout->addWidget(label, row, 0);
  UnitTemperature = new QComboBox(this);
  UnitTemperature->setObjectName("UnitTemperature");
  UnitTemperature->setEditable(false);
  topLayout->addWidget(UnitTemperature,row++,1);
  UnitTemperature->addItem(tr("Celsius"));
  UnitTemperature->addItem(tr("Fahrenheit"));
  temperature[0] = GeneralConfig::Celsius;
  temperature[1] = GeneralConfig::Fahrenheit;

  label = new QLabel(tr("Air Pressure:"), this);
  topLayout->addWidget(label, row, 0);
  UnitAirPressure = new QComboBox(this);
  UnitAirPressure->setObjectName("UnitAirPressure");
  UnitAirPressure->setEditable(false);
  topLayout->addWidget(UnitAirPressure,row++,1);
  UnitAirPressure->addItem(tr("hPa"));
  UnitAirPressure->addItem(tr("inHg"));
  airPressure[0] = GeneralConfig::hPa;
  airPressure[1] = GeneralConfig::inHg;

  topLayout->setRowStretch(row++, 10);
  topLayout->setColumnStretch(2, 10);

  QPushButton *help = new QPushButton(this);
  help->setIcon(QIcon(GeneralConfig::instance()->loadPixmap("help32.png")));
  help->setIconSize(QSize(Layout::getButtonSize(12), Layout::getButtonSize(12)));
  help->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::QSizePolicy::Preferred);

  QPushButton *cancel = new QPushButton(this);
  cancel->setIcon(QIcon(GeneralConfig::instance()->loadPixmap("cancel.png")));
  cancel->setIconSize(QSize(Layout::getButtonSize(12), Layout::getButtonSize(12)));
  cancel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::QSizePolicy::Preferred);

  QPushButton *ok = new QPushButton(this);
  ok->setIcon(QIcon(GeneralConfig::instance()->loadPixmap("ok.png")));
  ok->setIconSize(QSize(Layout::getButtonSize(12), Layout::getButtonSize(12)));
  ok->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::QSizePolicy::Preferred);

  QLabel *titlePix = new QLabel(this);
  titlePix->setAlignment( Qt::AlignCenter );
  titlePix->setPixmap(GeneralConfig::instance()->loadPixmap("setup.png"));

  connect(help, SIGNAL(pressed()), this, SLOT(slotHelp()));
  connect(ok, SIGNAL(pressed()), this, SLOT(slotAccept()));
  connect(cancel, SIGNAL(pressed()), this, SLOT(slotReject()));

  QVBoxLayout *buttonBox = new QVBoxLayout;
  buttonBox->setSpacing(0);
  buttonBox->addWidget(help, 1);
  buttonBox->addStretch(2);
  buttonBox->addWidget(cancel, 1);
  buttonBox->addSpacing(30);
  buttonBox->addWidget(ok, 1);
  buttonBox->addStretch(2);
  buttonBox->addWidget(titlePix);
  contentLayout->addLayout(buttonBox);

  load();
}
コード例 #2
0
ファイル: SharedFilesWindow.cpp プロジェクト: kartagis/KVIrc
SharedFileEditDialog::SharedFileEditDialog(QWidget * par,KviSharedFile * f)
: QDialog(par)//,"shared_file_editor",true)
{
	setModal(true);
	setObjectName("shared_file_editor");

	QGridLayout * g = new QGridLayout(this);

	setWindowTitle(__tr2qs_ctx("Edit Shared File - KVIrc","sharedfileswindow"));

	QLabel * l = new QLabel(__tr2qs_ctx("Share name:","sharedfileswindow"),this);
	g->addWidget(l, 0, 0 );

	m_pShareNameEdit = new QLineEdit(this);
	g->addWidget(m_pShareNameEdit,0,1,1,3);
	//g->addMultiCellWidget( m_pShareNameEdit, 0, 0, 1, 3 );

	l = new QLabel(__tr2qs_ctx("File path:","sharedfileswindow"),this);
	g->addWidget(l, 1, 0 );

	m_pFilePathEdit = new QLineEdit(this);
	g->addWidget(m_pFilePathEdit,1,1,1,2);
	//g->addMultiCellWidget( m_pFilePathEdit, 1, 1, 1, 2 );

	m_pBrowseButton = new QPushButton(__tr2qs_ctx("&Browse...","sharedfileswindow"),this);
	g->addWidget( m_pBrowseButton, 1, 3 );
	connect(m_pBrowseButton,SIGNAL(clicked()),this,SLOT(browse()));

	l = new QLabel(__tr2qs_ctx("User mask:","sharedfileswindow"),this);
	g->addWidget(l, 2, 0 );

	m_pUserMaskEdit = new QLineEdit(this);
	g->addWidget(m_pUserMaskEdit,2,1,1,3);
//	g->addMultiCellWidget( m_pUserMaskEdit, 2, 2, 1, 3 );

	m_pExpireCheckBox = new QCheckBox(__tr2qs_ctx("Expire at:","sharedfileswindow"),this);
	g->addWidget(m_pExpireCheckBox,3,0);

	m_pExpireDateTimeEdit = new QDateTimeEdit(this);
	g->addWidget(m_pExpireDateTimeEdit,3,1,1,3);
	//g->addMultiCellWidget(m_pExpireDateTimeEdit, 3, 3, 1, 3 );

	connect(m_pExpireCheckBox,SIGNAL(toggled(bool)),m_pExpireDateTimeEdit,SLOT(setEnabled(bool)));

	QPushButton * pb;

	pb = new QPushButton(__tr2qs_ctx("&OK","sharedfileswindow"),this);
	connect(pb,SIGNAL(clicked()),this,SLOT(okClicked()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)));
	g->addWidget(pb,5,2);
	pb = new QPushButton(__tr2qs_ctx("Cancel","sharedfileswindow"),this);
	connect(pb,SIGNAL(clicked()),this,SLOT(reject()));
	pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)));
	g->addWidget(pb,5,3);

	g->setRowStretch(4,1);
	g->setColumnStretch(0,1);

	if(f)
	{
		m_pShareNameEdit->setText(f->name());
		m_pFilePathEdit->setText(f->absFilePath());
		m_pUserMaskEdit->setText(f->userMask());
		QDateTime dt;
		dt.setTime_t(f->expireTime());
		m_pExpireDateTimeEdit->setDateTime(dt);
		m_pExpireCheckBox->setChecked(f->expires());
		m_pExpireDateTimeEdit->setEnabled(f->expires());
	} else {
		m_pExpireCheckBox->setChecked(false);
		m_pExpireDateTimeEdit->setDateTime(QDateTime::currentDateTime());
		m_pExpireDateTimeEdit->setEnabled(false);
	}

}
コード例 #3
0
int32_t main(int32_t argc, char *argv[]) {

  int32_t  lc=0;             /**< line counter */
  char     title[MNCIPP];    /**< Window title */
  double   t0,t1,t;          /**< (start) timestamp */
  int32_t  i,j,k;
  int32_t  chn_cnt=0;        /**< active channel count */
  int32_t  plot_per_row=3;   /**< number of plots per row */
  
  parse_cmd(argc,argv);

  // start the biodata collection in a separate thread
  boost::thread thread_data( boost::bind(plot_samples, argc, argv) );

  // start the ui application
  main_app = new QApplication(argc,argv);
 
  /* Build UI */
  for (j=0; j<NR_OF_CHANNELS; j++) {
    plot[j] = new CBioPlot( 1, window_len[j], edfChnName[j] );
  }

  QGridLayout *myLayout = new QGridLayout;
  myLayout->setHorizontalSpacing( 16 );
  myLayout->setVerticalSpacing  (  6 );
  myLayout->setContentsMargins(0,0,0,0);

  /* count active channels */
  chn_cnt=0;
  for (j=0; j<NR_OF_CHANNELS; j++) {
    if (chn&(1<<j)) { chn_cnt++; }
  } 
  fprintf(stderr,"# chn 0x%04X chn_cnt %d\n", chn, chn_cnt);
  
  if (chn_cnt<5) { plot_per_row=2; } else { plot_per_row=3; }
  /* Add only wanted channel to myLayout */
  i=0; k=0;
  for (j=0; j<NR_OF_CHANNELS; j++) {
    if (chn&(1<<j)) {
      myLayout->addWidget( plot[j], k, i );
      i++; if (i==plot_per_row) { i=0; k++; }
    }
  } 

  myLayout->setRowStretch( 0, 1 );
  if (chn_cnt>3) { myLayout->setRowStretch( 1, 1 ); }
  if (chn_cnt>6) { myLayout->setRowStretch( 2, 1 ); }

  QFrame * my_frame = new QFrame();
  my_frame->setLayout( myLayout );

  main_window = new QMainWindow();
  main_window->resize(1000,800);
  main_window->setCentralWidget( my_frame );
  main_window->show();
  //main_window->showMaximized();
  snprintf(title,sizeof(title)-1,"%s: IP %s port %d","Nexus IP Viewer",ipname,port);
  main_window->setWindowTitle(title);
 
  main_app->exec();

  // clean up the UI part
  delete main_app;

  // stop the hal data collection process
  pressed_CtrlC = 1;

  thread_data.join();

  return(0);
}
コード例 #4
0
ファイル: PageRecord.cpp プロジェクト: KarolS/ssr
PageRecord::PageRecord(MainWindow* main_window)
	: QWidget(main_window->centralWidget()) {

	m_main_window = main_window;

	m_page_started = false;
	m_input_started = false;
	m_output_started = false;
	m_previewing = false;

	QGroupBox *group_recording = new QGroupBox(tr("Recording"), this);
	{
		m_pushbutton_start_pause = new QPushButton(group_recording);

		m_checkbox_hotkey_enable = new QCheckBox(tr("Enable recording hotkey"), group_recording);
		QLabel *label_hotkey = new QLabel(tr("Hotkey:"), group_recording);
		m_checkbox_hotkey_ctrl = new QCheckBox(tr("Ctrl +"), group_recording);
		m_checkbox_hotkey_shift = new QCheckBox(tr("Shift +"), group_recording);
		m_checkbox_hotkey_alt = new QCheckBox(tr("Alt +"), group_recording);
		m_checkbox_hotkey_super = new QCheckBox(tr("Super +"), group_recording);
		m_combobox_hotkey_key = new QComboBox(group_recording);
		m_combobox_hotkey_key->setToolTip(tr("The key that you have to press (combined with the given modifiers) to start or pause recording.\n"
											 "The program that you are recording will not receive the key press."));
		// Note: The choice of keys is currently rather limited, because capturing key presses session-wide is a bit harder than it looks.
		// For example, applications are not allowed to capture the F1-F12 keys (on Ubuntu at least). The A-Z keys don't have this limitation apparently.
		for(unsigned int i = 0; i < 26; ++i) {
			m_combobox_hotkey_key->addItem(QString('A' + i));
		}

		connect(m_pushbutton_start_pause, SIGNAL(clicked()), this, SLOT(OnRecordStartPause()));
		connect(m_checkbox_hotkey_enable, SIGNAL(clicked()), this, SLOT(OnUpdateHotkeyFields()));
		connect(m_checkbox_hotkey_ctrl, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_checkbox_hotkey_shift, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_checkbox_hotkey_alt, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_checkbox_hotkey_super, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_combobox_hotkey_key, SIGNAL(activated(int)), this, SLOT(OnUpdateHotkey()));

		QVBoxLayout *layout = new QVBoxLayout(group_recording);
		layout->addWidget(m_pushbutton_start_pause);
		layout->addWidget(m_checkbox_hotkey_enable);
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(label_hotkey);
			layout2->addWidget(m_checkbox_hotkey_ctrl);
			layout2->addWidget(m_checkbox_hotkey_shift);
			layout2->addWidget(m_checkbox_hotkey_alt);
			layout2->addWidget(m_checkbox_hotkey_super);
			layout2->addWidget(m_combobox_hotkey_key);
		}
	}
	QSplitter *splitter_vertical = new QSplitter(Qt::Vertical, this);
	{
		QSplitter *splitter_horizontal = new QSplitter(Qt::Horizontal, splitter_vertical);
		{
			QGroupBox *group_information = new QGroupBox(tr("Information"), splitter_horizontal);
			{
				QLabel *label_total_time = new QLabel(tr("Total time:"), group_information);
				m_label_info_total_time = new QLabel(group_information);
				QLabel *label_frame_rate_in = new QLabel(tr("FPS in:"), group_information);
				m_label_info_frame_rate_in = new QLabel(group_information);
				QLabel *label_frame_rate_out = new QLabel(tr("FPS out:"), group_information);
				m_label_info_frame_rate_out = new QLabel(group_information);
				QLabel *label_size_in = new QLabel(tr("Size in:"), group_information);
				m_label_info_size_in = new QLabel(group_information);
				QLabel *label_size_out = new QLabel(tr("Size out:"), group_information);
				m_label_info_size_out = new QLabel(group_information);
				QLabel *label_file_name = new QLabel(tr("File name:"), group_information);
				m_label_info_file_name = new ElidedLabel(QString(), Qt::ElideMiddle, group_information);
				m_label_info_file_name->setMinimumWidth(100);
				QLabel *label_file_size = new QLabel(tr("File size:"), group_information);
				m_label_info_file_size = new QLabel(group_information);
				QLabel *label_bit_rate = new QLabel(tr("Bit rate:"), group_information);
				m_label_info_bit_rate = new QLabel(group_information);

				QGridLayout *layout = new QGridLayout(group_information);
				layout->addWidget(label_total_time, 0, 0);
				layout->addWidget(m_label_info_total_time, 0, 1);
				layout->addWidget(label_frame_rate_in, 1, 0);
				layout->addWidget(m_label_info_frame_rate_in, 1, 1);
				layout->addWidget(label_frame_rate_out, 2, 0);
				layout->addWidget(m_label_info_frame_rate_out, 2, 1);
				layout->addWidget(label_size_in, 3, 0);
				layout->addWidget(m_label_info_size_in, 3, 1);
				layout->addWidget(label_size_out, 4, 0);
				layout->addWidget(m_label_info_size_out, 4, 1);
				layout->addWidget(label_file_name, 5, 0);
				layout->addWidget(m_label_info_file_name, 5, 1);
				layout->addWidget(label_file_size, 6, 0);
				layout->addWidget(m_label_info_file_size, 6, 1);
				layout->addWidget(label_bit_rate, 7, 0);
				layout->addWidget(m_label_info_bit_rate, 7, 1);
				layout->setColumnStretch(1, 1);
				layout->setRowStretch(8, 1);
			}
			QGroupBox *group_preview = new QGroupBox(tr("Preview"), splitter_horizontal);
			{
				m_preview_page1 = new QWidget(group_preview);
				{
					QLabel *label_preview_frame_rate = new QLabel(tr("Preview frame rate:"), m_preview_page1);
					m_spinbox_preview_frame_rate = new QSpinBox(m_preview_page1);
					m_spinbox_preview_frame_rate->setRange(1, 1000);
					m_spinbox_preview_frame_rate->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
					QLabel *label_preview_note = new QLabel(tr("Note: Previewing requires extra CPU time (especially at high frame rates)."), m_preview_page1);
					label_preview_note->setWordWrap(true);
					label_preview_note->setAlignment(Qt::AlignLeft | Qt::AlignTop);
					label_preview_note->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);

					QGridLayout *layout = new QGridLayout(m_preview_page1);
					layout->setMargin(0);
					layout->addWidget(label_preview_frame_rate, 0, 0);
					layout->addWidget(m_spinbox_preview_frame_rate, 0, 1);
					layout->addWidget(label_preview_note, 1, 0, 1, 2);
				}
				m_preview_page2 = new QWidget(group_preview);
				{
					m_video_previewer = new VideoPreviewer(m_preview_page2);
					m_label_mic_icon = new QLabel(m_preview_page2);
					m_label_mic_icon->setPixmap(QIcon::fromTheme("audio-input-microphone").pixmap(24, 24));
					m_audio_previewer = new AudioPreviewer(m_preview_page2);

					QVBoxLayout *layout = new QVBoxLayout(m_preview_page2);
					layout->setMargin(0);
					layout->addWidget(m_video_previewer);
					{
						QHBoxLayout *layout2 = new QHBoxLayout();
						layout->addLayout(layout2);
						layout2->addStretch();
						layout2->addWidget(m_label_mic_icon);
						layout2->addWidget(m_audio_previewer);
						layout2->addStretch();
					}
				}
				m_pushbutton_preview_start_stop = new QPushButton(group_preview);

				connect(m_pushbutton_preview_start_stop, SIGNAL(clicked()), this, SLOT(OnPreviewStartStop()));

				QVBoxLayout *layout = new QVBoxLayout(group_preview);
				{
					m_stacked_layout_preview = new QStackedLayout();
					layout->addLayout(m_stacked_layout_preview);
					m_stacked_layout_preview->addWidget(m_preview_page1);
					m_stacked_layout_preview->addWidget(m_preview_page2);
				}
				layout->addWidget(m_pushbutton_preview_start_stop);
			}

			splitter_horizontal->addWidget(group_information);
			splitter_horizontal->addWidget(group_preview);
			splitter_horizontal->setStretchFactor(0, 1);
			splitter_horizontal->setStretchFactor(1, 3);
		}
		QGroupBox *group_log = new QGroupBox(tr("Log"), splitter_vertical);
		{
			m_textedit_log = new QTextEditSmall(group_log);
			m_textedit_log->setReadOnly(true);

			QVBoxLayout *layout = new QVBoxLayout(group_log);
			layout->addWidget(m_textedit_log);
		}

		splitter_vertical->addWidget(splitter_horizontal);
		splitter_vertical->addWidget(group_log);
		splitter_vertical->setStretchFactor(0, 3);
		splitter_vertical->setStretchFactor(1, 1);
	}

	QPushButton *button_cancel = new QPushButton(QIcon::fromTheme("process-stop"), tr("Cancel recording"), this);
	QPushButton *button_save = new QPushButton(QIcon::fromTheme("document-save"), tr("Save recording"), this);

	m_systray_icon = new QSystemTrayIcon(m_main_window);
	{
		QMenu *menu = new QMenu(m_main_window);
		m_systray_action_start_pause = menu->addAction(QString(), this, SLOT(OnRecordStartPause()));
		m_systray_action_save = menu->addAction(tr("Save recording"), this, SLOT(OnSave()));
		m_systray_action_cancel = menu->addAction(tr("Cancel recording"), this, SLOT(OnCancel()));
		menu->addSeparator();
		menu->addAction("Quit", m_main_window, SLOT(close()));
		m_systray_icon->setContextMenu(menu);
	}

	connect(button_cancel, SIGNAL(clicked()), this, SLOT(OnCancel()));
	connect(button_save, SIGNAL(clicked()), this, SLOT(OnSave()));
	connect(m_systray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(OnSysTrayActivated(QSystemTrayIcon::ActivationReason)));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(group_recording);
	layout->addWidget(splitter_vertical);
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addWidget(button_cancel);
		layout2->addWidget(button_save);
	}

	UpdateSysTray();
	UpdateRecordPauseButton();
	UpdatePreview();

	m_info_timer = new QTimer(this);
	m_glinject_event_timer = new QTimer(this);
	connect(m_info_timer, SIGNAL(timeout()), this, SLOT(OnUpdateInformation()));
	connect(m_glinject_event_timer, SIGNAL(timeout()), this, SLOT(OnCheckGLInjectEvents()));
	connect(&g_hotkey_listener, SIGNAL(Triggered()), this, SLOT(OnRecordStartPause()));
	connect(Logger::GetInstance(), SIGNAL(NewLine(Logger::enum_type,QString)), this, SLOT(OnNewLogLine(Logger::enum_type,QString)), Qt::QueuedConnection);

	m_systray_icon->show();

}
コード例 #5
0
ファイル: roweditor.cpp プロジェクト: jmbowman/portabase
/**
 * Populate this dialog with the appropriate field editor widgets for the
 * database's columns, and set them to match the data in the specified row.
 *
 * @param rowId The data row to be edited or copied
 */
void RowEditor::addContent(int rowId)
{
    QScrollArea *sa = new QScrollArea(this);
    vbox->addWidget(sa);
    QWidget *grid = new QWidget();
    sa->setWidgetResizable(true);
    colNames = db->listColumns();
    int count = colNames.count();
    QGridLayout *layout = Factory::gridLayout(grid, true);
    QStringList values;
    if (rowId != -1) {
        values = db->getRow(rowId);
    }
    else {
        for (int i = 0; i < count; i++) {
            values.append(db->getDefault(colNames[i]));
        }
    }
    initialFocus = 0;
    colTypes = db->listTypes();
    for (int i = 0; i < count; i++) {
        QString name = colNames[i];
        int type = colTypes[i];
        layout->addWidget(new QLabel(name + " ", grid), i, 0);
        if (type == BOOLEAN) {
            QCheckBox *box = new QCheckBox(grid);
            layout->addWidget(box, i, 1);
            if (values[i].toInt()) {
                box->setChecked(true);
            }
            checkBoxes.append(box);
        }
        else if (type == INTEGER || type == FLOAT) {
            NumberWidget *widget = new NumberWidget(type, grid);
            layout->addWidget(widget, i, 1);
            widget->setValue(values[i]);
            numberWidgets.append(widget);
            if (!initialFocus) {
                initialFocus = widget;
            }
        }
        else if (type == NOTE) {
            NoteButton *button = new NoteButton(name, grid);
            layout->addWidget(button, i, 1);
            button->setContent(values[i]);
            noteButtons.append(button);
        }
        else if (type == DATE) {
            DateWidget *widget = new DateWidget(grid);
            layout->addWidget(widget, i, 1);
            widget->setDate(values[i].toInt());
            dateWidgets.append(widget);
        }
        else if (type == TIME) {
            TimeWidget *widget = new TimeWidget(grid);
            layout->addWidget(widget, i, 1);
            int defaultTime = values[i].toInt();
            if (defaultTime == 0) {
                defaultTime = -2;
            }
            widget->setTime(defaultTime);
            timeWidgets.append(widget);
        }
        else if (type == CALC) {
            CalcWidget *widget = new CalcWidget(db, name, colNames, this, grid);
            layout->addWidget(widget, i, 1);
            widget->setValue(values[i]);
            calcWidgets.append(widget);
        }
        else if (type == SEQUENCE) {
            QLabel *label = new QLabel(values[i], grid);
            layout->addWidget(label, i, 1);
            sequenceLabels.append(label);
        }
        else if (type == IMAGE) {
            ImageSelector *widget = new ImageSelector(db, grid);
            layout->addWidget(widget, i, 1);
            widget->setField(rowId, name);
            widget->setFormat(values[i]);
            imageSelectors.append(widget);
        }
        else if (type >= FIRST_ENUM) {
            QComboBox *combo = new QComboBox(grid);
            layout->addWidget(combo, i, 1);
            QStringList options = db->listEnumOptions(type);
            combo->addItems(options);
            int index = options.indexOf(values[i]);
            combo->setCurrentIndex(index);
            comboBoxes.append(combo);
        }
        else {
            DynamicEdit *edit = new DynamicEdit(grid);
            layout->addWidget(edit, i, 1);
            edit->setPlainText(values[i]);
            dynamicEdits.append(edit);
            if (!initialFocus) {
                initialFocus = edit;
            }
        }
    }
    layout->addWidget(new QWidget(grid), count, 0, 1, 2);
    layout->setRowStretch(count, 1);
    sa->setWidget(grid);

    finishLayout(true, true, 400, 400);
}
コード例 #6
0
ファイル: sequence_number.cpp プロジェクト: cwarden/quasar
SequenceNumber::SequenceNumber(MainWindow* main)
    : QuasarWindow(main, "SequenceNumber")
{
    _helpSource = "seq_number.html";

    QFrame* frame = new QFrame(this);
    QScrollView* sv = new QScrollView(frame);
    _nums = new QButtonGroup(4, Horizontal, tr("Seq Numbers"), sv->viewport());

    new QLabel("Type", _nums);
    new QLabel("Minimum", _nums);
    new QLabel("Maximum", _nums);
    new QLabel("Next", _nums);

    addIdEdit(tr("Data Object:"), "data_object", "object_id");
    addIdEdit(tr("Journal Entry:"), "gltx", "Journal Entry");
    addIdEdit(tr("Ledger Transfer:"), "gltx", "Ledger Transfer");
    addIdEdit(tr("Card Adjustment:"), "gltx", "Card Adjustment");
    addIdEdit(tr("Customer Invoice:"), "gltx", "Customer Invoice");
    addIdEdit(tr("Customer Return:"), "gltx", "Customer Return");
    addIdEdit(tr("Customer Payment:"), "gltx", "Customer Payment");
    addIdEdit(tr("Customer Quote:"), "quote", "number");
    addIdEdit(tr("Vendor Invoice:"), "gltx", "Vendor Invoice");
    addIdEdit(tr("Vendor Claim:"), "gltx", "Vendor Claim");
    addIdEdit(tr("Purchase Order:"), "porder", "number");
    addIdEdit(tr("Packing Slip:"), "slip", "number");
    addIdEdit(tr("Nosale:"), "gltx", "Nosale");
    addIdEdit(tr("Payout:"), "gltx", "Payout");
    addIdEdit(tr("Withdraw:"), "gltx", "Withdraw");
    addIdEdit(tr("Shift:"), "gltx", "Shift");
    addIdEdit(tr("Item Adjustment:"), "gltx", "Item Adjustment");
    addIdEdit(tr("Item Transfer:"), "gltx", "Item Transfer");
    addIdEdit(tr("Physical Count:"), "pcount", "number");
    addIdEdit(tr("Label Batch:"), "label_batch", "number");
    addIdEdit(tr("Price Batch:"), "price_batch", "number");
    addIdEdit(tr("Promo Batch:"), "promo_batch", "number");
    addIdEdit(tr("Company Number:"), "company", "number");
    addIdEdit(tr("Store Number:"), "store", "number");
    addIdEdit(tr("Station Number:"), "station", "number");
    addIdEdit(tr("Tender Count #:"), "tender_count", "number");
    addIdEdit(tr("Tender Menu #:"), "tender", "menu_num");

    QFrame* buttons = new QFrame(frame);
    QPushButton* ok = new QPushButton(tr("&OK"), buttons);
    QPushButton* quit = new QPushButton(tr("&Close"), buttons);

    connect(ok, SIGNAL(clicked()), SLOT(slotOk()));
    connect(quit, SIGNAL(clicked()), SLOT(close()));

    QGridLayout* buttonGrid = new QGridLayout(buttons);
    buttonGrid->setSpacing(3);
    buttonGrid->setMargin(3);
    buttonGrid->setColStretch(0, 1);
    buttonGrid->addWidget(ok, 0, 1);
    buttonGrid->addWidget(quit, 0, 2);

    _nums->resize(_nums->sizeHint());
    sv->setVScrollBarMode(QScrollView::AlwaysOn);
    sv->resizeContents(_nums->width() + 20, _nums->height());

    QGridLayout* grid = new QGridLayout(frame);
    grid->setSpacing(6);
    grid->setMargin(6);
    grid->setRowStretch(0, 1);
    grid->addWidget(sv, 0, 0);
    grid->addWidget(buttons, 1, 0);

    for (unsigned int i = 0; i < _ids.size(); ++i) {
	IdInfo& info = _ids[i];
	_quasar->db()->getSequence(info.seq);
	info.minNum->setFixed(info.seq.minNumber());
	info.maxNum->setFixed(info.seq.maxNumber());
	info.nextNum->setFixed(info.seq.nextNumber());
    }

    statusBar()->hide();
    setCentralWidget(frame);
    setCaption(tr("Sequence Numbers"));
    finalize();

    if (!allowed("View")) {
	QTimer::singleShot(50, this, SLOT(slotNotAllowed()));
	return;
    }
}
コード例 #7
0
SubSurfaceInspectorView::SubSurfaceInspectorView(bool isIP, const openstudio::model::Model& model, QWidget * parent )
  : ModelObjectInspectorView(model, true, parent)
{
  m_isIP = isIP;

  QWidget* hiddenWidget = new QWidget();
  this->stackedWidget()->insertWidget(0, hiddenWidget);

  QWidget* visibleWidget = new QWidget();
  this->stackedWidget()->insertWidget(1, visibleWidget);

  this->stackedWidget()->setCurrentIndex(0);

  QGridLayout* mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7,7,7,7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  // name
  QVBoxLayout* vLayout = new QVBoxLayout();

  QLabel* label = new QLabel();
  label->setText("Name: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_nameEdit = new OSLineEdit();
  vLayout->addWidget(m_nameEdit);

  mainGridLayout->addLayout(vLayout,0,0,1,2, Qt::AlignTop|Qt::AlignLeft);

  // subsurface type
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Sub Surface Type: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_subSurfaceType = new OSComboBox();
  vLayout->addWidget(m_subSurfaceType);

  vLayout->addStretch();

  mainGridLayout->addLayout(vLayout,1,0);

  // construction 
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Construction: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_constructionVectorController = new SubSurfaceConstructionVectorController();
  m_constructionDropZone = new OSDropZone(m_constructionVectorController);
  m_constructionDropZone->setMinItems(0);
  m_constructionDropZone->setMaxItems(1);
  m_constructionDropZone->setItemsAcceptDrops(true);
  vLayout->addWidget(m_constructionDropZone);

  vLayout->addStretch();

  mainGridLayout->addLayout(vLayout,1,1);

  // outside boundary condition object
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Outside Boundary Condition Object: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_outsideBoundaryConditionObjectVectorController = new SubSurfaceOutsideBoundaryConditionObjectVectorController();
  m_outsideBoundaryConditionObjectDropZone = new OSDropZone(m_outsideBoundaryConditionObjectVectorController);
  m_outsideBoundaryConditionObjectDropZone->setMinItems(0);
  m_outsideBoundaryConditionObjectDropZone->setMaxItems(1);
  m_outsideBoundaryConditionObjectDropZone->setItemsAcceptDrops(true);
  vLayout->addWidget(m_outsideBoundaryConditionObjectDropZone);

  vLayout->addStretch();

  mainGridLayout->addLayout(vLayout,2,0);

  // multiplier
  vLayout = new QVBoxLayout();

  label = new QLabel();
  label->setText("Multiplier: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  m_multiplier = new OSDoubleEdit();
  vLayout->addWidget(m_multiplier);

  vLayout->addStretch();

  mainGridLayout->addLayout(vLayout,3,0);

  // separator
  vLayout = new QVBoxLayout();

  QWidget * hLine = new QWidget();
  hLine->setObjectName("HLine");
  hLine->setStyleSheet("QWidget#HLine { background: #445051;}");
  hLine->setFixedHeight(2);
  vLayout->addWidget(hLine);

  label = new QLabel();
  label->setText("Vertices: ");
  label->setStyleSheet("QLabel { font: bold; }");
  vLayout->addWidget(label);

  mainGridLayout->addWidget(hLine,4,0,1,2);

  // planar surface widget
  m_planarSurfaceWidget = new PlanarSurfaceWidget(m_isIP);
  bool isConnected = connect(this, SIGNAL(toggleUnitsClicked(bool)), m_planarSurfaceWidget, SLOT(toggleUnits(bool)));
  OS_ASSERT(isConnected);

  mainGridLayout->addWidget(m_planarSurfaceWidget,5,0,1,2);

  mainGridLayout->setColumnMinimumWidth(0, 80);
  mainGridLayout->setColumnMinimumWidth(1, 80);
  mainGridLayout->setColumnStretch(2,1);
  mainGridLayout->setRowMinimumHeight(0, 30);
  mainGridLayout->setRowMinimumHeight(1, 30);
  mainGridLayout->setRowMinimumHeight(2, 30);
  mainGridLayout->setRowMinimumHeight(3, 30);
  mainGridLayout->setRowMinimumHeight(4, 30);
  mainGridLayout->setRowMinimumHeight(5, 30);
  mainGridLayout->setRowStretch(6,1);
}
コード例 #8
0
ファイル: diffdialog.cpp プロジェクト: KDE/cervisia
DiffDialog::DiffDialog(KConfig& cfg, QWidget *parent, bool modal)
    : QDialog(parent)
    , partConfig(cfg)
{
    markeditem = -1;
    setModal(modal);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Close);
    connect(buttonBox, &QDialogButtonBox::helpRequested, this, &DiffDialog::slotHelp);

    QPushButton *user1Button = new QPushButton;
    buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    KGuiItem::assign(user1Button, KStandardGuiItem::saveAs());

    QGridLayout *pairlayout = new QGridLayout();
    mainLayout->addLayout(pairlayout);
    pairlayout->setRowStretch(0, 0);
    pairlayout->setRowStretch(1, 1);
    pairlayout->setColumnStretch(1, 0);
    pairlayout->addItem(new QSpacerItem(16, 0), 0, 1);
    pairlayout->setColumnStretch(0, 10);
    pairlayout->setColumnStretch(2, 10);

    revlabel1 = new QLabel;
    pairlayout->addWidget(revlabel1, 0, 0);

    revlabel2 = new QLabel;
    pairlayout->addWidget(revlabel2, 0, 2);

    diff1 = new DiffView(cfg, true, false, this);
    diff2 = new DiffView(cfg, true, true, this);
    DiffZoomWidget *zoom = new DiffZoomWidget(this);
    zoom->setDiffView(diff2);

    pairlayout->addWidget(diff1, 1, 0);
    pairlayout->addWidget(zoom,  1, 1);
    pairlayout->addWidget(diff2, 1, 2);

    diff1->setPartner(diff2);
    diff2->setPartner(diff1);

    syncbox = new QCheckBox(i18n("Synchronize scroll bars"));
    syncbox->setChecked(true);
    connect(syncbox, SIGNAL(toggled(bool)), this, SLOT(toggleSynchronize(bool)));

    itemscombo = new KComboBox;
    itemscombo->addItem(QString());
    connect(itemscombo, SIGNAL(activated(int)), this, SLOT(comboActivated(int)));

    nofnlabel = new QLabel;
    // avoids auto resize when the text is changed
    nofnlabel->setMinimumWidth(fontMetrics().width(i18np("%1 difference", "%1 differences", 10000)));

    backbutton = new QPushButton(QLatin1String("&<<"));
    connect(backbutton, SIGNAL(clicked()), SLOT(backClicked()));

    forwbutton = new QPushButton(QLatin1String("&>>"));
    connect(forwbutton, SIGNAL(clicked()), SLOT(forwClicked()));

    connect(user1Button, SIGNAL(clicked()), SLOT(saveAsClicked()));

    QBoxLayout *buttonlayout = new QHBoxLayout();
    mainLayout->addLayout(buttonlayout);
    buttonlayout->addWidget(syncbox, 0);
    buttonlayout->addStretch(4);
    buttonlayout->addWidget(itemscombo);
    buttonlayout->addStretch(1);
    buttonlayout->addWidget(nofnlabel);
    buttonlayout->addStretch(1);
    buttonlayout->addWidget(backbutton);
    buttonlayout->addWidget(forwbutton);

    mainLayout->addWidget(buttonBox);
    buttonBox->button(QDialogButtonBox::Close)->setDefault(true);

    setAttribute(Qt::WA_DeleteOnClose, true);

    KConfigGroup cg(&partConfig, "DiffDialog");
    syncbox->setChecked(cg.readEntry("Sync",false));
    restoreGeometry(cg.readEntry<QByteArray>("geometry", QByteArray()));
}
コード例 #9
0
ファイル: k3badvancedoptiontab.cpp プロジェクト: KDE/k3b
void K3b::AdvancedOptionTab::setupGui()
{
    QGridLayout* groupAdvancedLayout = new QGridLayout( this );
    groupAdvancedLayout->setAlignment( Qt::AlignTop );
    groupAdvancedLayout->setContentsMargins( 0, 0, 0, 0 );


    QGroupBox* groupWritingApp = new QGroupBox( i18n("Burning"), this );
    QGridLayout* bufferLayout = new QGridLayout( groupWritingApp );

    m_checkBurnfree = K3b::StdGuiItems::burnproofCheckbox( groupWritingApp );
    m_checkOverburn = new QCheckBox( i18n("Allow &overburning"), groupWritingApp );
    m_checkForceUnsafeOperations = new QCheckBox( i18n("&Force unsafe operations"), groupWritingApp );
    m_checkManualWritingBufferSize = new QCheckBox( i18n("&Manual writing buffer size") + ':', groupWritingApp );
    m_editWritingBufferSize = new QSpinBox( groupWritingApp );
    m_editWritingBufferSize->setRange( 1, 100 );
    m_editWritingBufferSize->setValue( 4 );
    m_editWritingBufferSize->setSuffix( ' ' + i18n("MB") );
    m_checkShowForceGuiElements = new QCheckBox( i18n("Show &advanced GUI elements"), groupWritingApp );
    bufferLayout->addWidget( m_checkBurnfree, 0, 0, 1, 3 );
    bufferLayout->addWidget( m_checkOverburn, 1, 0, 1, 2 );
    bufferLayout->addWidget( m_checkForceUnsafeOperations, 2, 0, 1, 3 );
    bufferLayout->addWidget( m_checkManualWritingBufferSize, 3, 0 );
    bufferLayout->addWidget( m_editWritingBufferSize, 3, 1 );
    bufferLayout->addWidget( m_checkShowForceGuiElements, 4, 0, 1, 3 );
    bufferLayout->setColumnStretch( 2, 1 );

    QGroupBox* groupMisc = new QGroupBox( i18n("Miscellaneous"), this );
    QVBoxLayout* groupMiscLayout = new QVBoxLayout( groupMisc );
    m_checkEject = new QCheckBox( i18n("Do not &eject medium after write process"), groupMisc );
    groupMiscLayout->addWidget( m_checkEject );
    m_checkAutoErasingRewritable = new QCheckBox( i18n("Automatically erase CD-RWs and DVD-RWs"), groupMisc );
    groupMiscLayout->addWidget( m_checkAutoErasingRewritable );

    groupAdvancedLayout->addWidget( groupWritingApp, 0, 0 );
    groupAdvancedLayout->addWidget( groupMisc, 1, 0 );
    groupAdvancedLayout->setRowStretch( 2, 1 );


    connect( m_checkManualWritingBufferSize, SIGNAL(toggled(bool)),
             m_editWritingBufferSize, SLOT(setEnabled(bool)) );
    connect( m_checkManualWritingBufferSize, SIGNAL(toggled(bool)),
             this, SLOT(slotSetDefaultBufferSizes(bool)) );


    m_editWritingBufferSize->setDisabled( true );
    // -----------------------------------------------------------------------


    m_checkOverburn->setToolTip( i18n("Allow burning more than the official media capacities") );
    m_checkShowForceGuiElements->setToolTip( i18n("Show advanced GUI elements like allowing to choose between cdrecord and cdrdao") );
    m_checkAutoErasingRewritable->setToolTip( i18n("Automatically erase CD-RWs and DVD-RWs without asking") );
    m_checkEject->setToolTip( i18n("Do not eject the burn medium after a completed burn process") );
    m_checkForceUnsafeOperations->setToolTip( i18n("Force K3b to continue some operations otherwise deemed as unsafe") );

    m_checkShowForceGuiElements->setWhatsThis( i18n("<p>If this option is checked additional GUI "
                                                    "elements which allow one to influence the behavior of K3b are shown. "
                                                    "This includes the manual selection of the used burning tool. "
                                                    "(Choose between cdrecord and cdrdao when writing a CD or between "
                                                    "cdrecord and growisofs when writing a DVD/BD.)"
                                                    "<p><b>Be aware that K3b does not support all possible tools "
                                                    "in all project types and actions.</b>") );

    m_checkOverburn->setWhatsThis( i18n("<p>Each medium has an official maximum capacity which is stored in a read-only "
                                        "area of the medium and is guaranteed by the vendor. However, this official "
                                        "maximum is not always the actual maximum. Many media have an "
                                        "actual total capacity that is slightly larger than the official amount."
                                        "<p>If this option is checked K3b will disable a safety check that prevents "
                                        "burning beyond the official capacity."
                                        "<p><b>Caution:</b> Enabling this option can cause failures in the end of the "
                                        "burning process if K3b attempts to write beyond the official capacity. It "
                                        "makes sense to first determine the actual maximum capacity of the media brand "
                                        "with a simulated burn.") );

    m_checkAutoErasingRewritable->setWhatsThis( i18n("<p>If this option is checked K3b will automatically "
                                                     "erase CD-RWs and format DVD-RWs if one is found instead "
                                                     "of an empty media before writing.") );

    m_checkManualWritingBufferSize->setWhatsThis( i18n("<p>K3b uses a software buffer during the burning process to "
                                                       "avoid gaps in the data stream due to high system load. The default "
                                                       "sizes used are %1 MB for CD and %2 MB for DVD burning."
                                                       "<p>If this option is checked the value specified will be used for both "
                                                       "CD and DVD burning.", 4, 32) );

    m_checkEject->setWhatsThis( i18n("<p>If this option is checked K3b will not eject the medium once the burn process "
                                     "finishes. This can be helpful in case one leaves the computer after starting the "
                                     "burning and does not want the tray to be open all the time."
                                     "<p>However, on Linux systems a freshly burned medium has to be reloaded. Otherwise "
                                     "the system will not detect the changes and still treat it as an empty medium.") );

    m_checkForceUnsafeOperations->setWhatsThis( i18n("<p>If this option is checked K3b will continue in some situations "
                                                     "which would otherwise be deemed as unsafe."
                                                     "<p>This setting for example disables the check for medium speed "
                                                     "verification. Thus, one can force K3b to burn a high speed medium on "
                                                     "a low speed writer."
                                                     "<p><b>Caution:</b> Enabling this option may result in damaged media.") );
}
コード例 #10
0
MatrixSizeDialog::MatrixSizeDialog( Matrix *m, QWidget* parent, Qt::WFlags fl )
	: QDialog( parent, fl ),
	d_matrix(m)
{
	setWindowTitle(tr("QtiPlot - Matrix Dimensions"));
	setAttribute(Qt::WA_DeleteOnClose);
	setSizeGripEnabled(true);

	groupBox1 = new QGroupBox(tr("Dimensions"));
	QHBoxLayout *topLayout = new QHBoxLayout(groupBox1);
	topLayout->addWidget( new QLabel(tr( "Rows" )) );
	boxRows = new QSpinBox();
	boxRows->setRange(1, INT_MAX);
	topLayout->addWidget(boxRows);
	topLayout->addStretch();
	topLayout->addWidget( new QLabel(tr( "Columns" )) );
	boxCols = new QSpinBox();
	boxCols->setRange(1, INT_MAX);
	topLayout->addWidget(boxCols);

	groupBox2 = new QGroupBox(tr("Coordinates"));
	QGridLayout *centerLayout = new QGridLayout(groupBox2);
	centerLayout->addWidget( new QLabel(tr( "X (Columns)" )), 0, 1 );
	centerLayout->addWidget( new QLabel(tr( "Y (Rows)" )), 0, 2 );

	centerLayout->addWidget( new QLabel(tr( "First" )), 1, 0 );

	QLocale locale = m->locale();
	boxXStart = new DoubleSpinBox();
	boxXStart->setLocale(locale);
	centerLayout->addWidget( boxXStart, 1, 1 );

	boxYStart = new DoubleSpinBox();
	boxYStart->setLocale(locale);
	centerLayout->addWidget( boxYStart, 1, 2 );

	centerLayout->addWidget( new QLabel(tr( "Last" )), 2, 0 );
	boxXEnd = new DoubleSpinBox();
	boxXEnd->setLocale(locale);
	centerLayout->addWidget( boxXEnd, 2, 1 );

	boxYEnd = new DoubleSpinBox();
	boxYEnd->setLocale(locale);
	centerLayout->addWidget( boxYEnd, 2, 2 );
	centerLayout->setRowStretch(3, 1);

	QHBoxLayout *bottomLayout = new QHBoxLayout();
	bottomLayout->addStretch();
	buttonApply = new QPushButton(tr("&Apply"));
	buttonApply->setDefault( true );
	bottomLayout->addWidget(buttonApply);
	buttonOk = new QPushButton(tr("&OK"));
	bottomLayout->addWidget( buttonOk );
	buttonCancel = new QPushButton(tr("&Cancel"));
	bottomLayout->addWidget( buttonCancel );

	QVBoxLayout * mainLayout = new QVBoxLayout( this );
	mainLayout->addWidget(groupBox1);
	mainLayout->addWidget(groupBox2);
	mainLayout->addLayout(bottomLayout);

	boxRows->setValue(m->numRows());
	boxCols->setValue(m->numCols());

	boxXStart->setValue(m->xStart());
	boxYStart->setValue(m->yStart());
	boxXEnd->setValue(m->xEnd());
	boxYEnd->setValue(m->yEnd());

	connect( buttonApply, SIGNAL(clicked()), this, SLOT(apply()));
	connect( buttonOk, SIGNAL(clicked()), this, SLOT(accept() ));
	connect( buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
コード例 #11
0
medResliceViewer::medResliceViewer(medAbstractView * view,QWidget * parent): medAbstractView(parent)
{
    int * imageDims;
    vtkImageView3D * view3d;
    if (!view)
        return;

    inputData = static_cast<medAbstractLayeredView*>(view)->layerData(0);

    view3d = static_cast<medVtkViewBackend*>(view->backend())->view3D;

    vtkViewData = vtkSmartPointer<vtkImageData>::New();
    vtkViewData->DeepCopy(view3d->GetInput());
    imageDims = vtkViewData->GetDimensions();

    viewBody = new QWidget(parent);
    for (int i = 0; i < 3; i++)
    {
        riw[i] = vtkSmartPointer<vtkResliceImageViewer>::New();
        frames[i] = new QVTKFrame(viewBody);
        views[i] = frames[i]->getView();
        views[i]->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Minimum );
        if (i==0)
            frames[i]->setStyleSheet("* {border : 1px solid #FF0000;}");
        else if (i==1)
            frames[i]->setStyleSheet("* {border : 1px solid #00FF00;}");
        else if (i==2)
            frames[i]->setStyleSheet("* {border : 1px solid #0000FF;}");
        views[i]->installEventFilter(this);
    }
    frames[3] = new QVTKFrame(viewBody);
    views[3] = frames[3]->getView();
    views[3]->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Minimum );
    QGridLayout * gridLayout = new QGridLayout(parent);
    gridLayout->addWidget(frames[2],0,0);
    gridLayout->addWidget(frames[3],0,1);
    gridLayout->addWidget(frames[1],1,0);
    gridLayout->addWidget(frames[0],1,1);

    gridLayout->setColumnStretch ( 0, 0 );
    gridLayout->setColumnStretch ( 1, 0 );
    gridLayout->setRowStretch ( 0, 0 );
    gridLayout->setRowStretch ( 1, 0 );

    viewBody->setLayout(gridLayout);
    
    views[0]->SetRenderWindow(riw[0]->GetRenderWindow()); 
    riw[0]->SetupInteractor(views[0]->GetRenderWindow()->GetInteractor());


    views[1]->SetRenderWindow(riw[1]->GetRenderWindow());
    riw[1]->SetupInteractor(views[1]->GetRenderWindow()->GetInteractor());

    views[2]->SetRenderWindow(riw[2]->GetRenderWindow());
    riw[2]->SetupInteractor(views[2]->GetRenderWindow()->GetInteractor());

    for (int i = 0; i < 3; i++)
    {
        // make them all share the same reslice cursor object.

        vtkResliceCursorLineRepresentation *rep = vtkResliceCursorLineRepresentation::SafeDownCast(
                    riw[i]->GetResliceCursorWidget()->GetRepresentation());
        riw[i]->SetResliceCursor(riw[2]->GetResliceCursor());

        rep->GetResliceCursorActor()->GetCursorAlgorithm()->SetReslicePlaneNormal(i);

        riw[i]->SetInput(vtkViewData); 
        riw[i]->SetSliceOrientation(i);
        riw[i]->SetResliceModeToOblique();
    }

    vtkViewData->GetSpacing(outputSpacing);

    vtkSmartPointer<vtkCellPicker> picker = vtkSmartPointer<vtkCellPicker>::New();
    picker->SetTolerance(0.005);

    vtkSmartPointer<vtkProperty> ipwProp = vtkSmartPointer<vtkProperty>::New();

    vtkSmartPointer< vtkRenderer > ren = vtkSmartPointer< vtkRenderer >::New();

    views[3]->GetRenderWindow()->AddRenderer(ren);
    vtkRenderWindowInteractor *iren = views[3]->GetInteractor();


    for (int i = 0; i < 3; i++)
    {
        planeWidget[i] = vtkSmartPointer<vtkImagePlaneWidget>::New();
        planeWidget[i]->SetInteractor( iren );
        planeWidget[i]->SetPicker(picker);
        planeWidget[i]->RestrictPlaneToVolumeOn();
        double color[3] = {0, 0, 0};
        color[i] = 1;
        planeWidget[i]->GetPlaneProperty()->SetColor(color);

        color[0] /= 4.0;
        color[1] /= 4.0;
        color[2] /= 4.0;
        riw[i]->GetRenderer()->SetBackground( 0,0,0 );

        planeWidget[i]->SetTexturePlaneProperty(ipwProp);
        planeWidget[i]->TextureInterpolateOff();
        planeWidget[i]->SetResliceInterpolateToLinear();
        planeWidget[i]->SetInput(vtkViewData);
        planeWidget[i]->SetPlaneOrientation(i);
        planeWidget[i]->SetSliceIndex(imageDims[i]/2);
        planeWidget[i]->DisplayTextOn();
        planeWidget[i]->SetDefaultRenderer(ren);
        planeWidget[i]->On();
        planeWidget[i]->InteractionOn();
    }

    vtkSmartPointer<medResliceCursorCallback> cbk = vtkSmartPointer<medResliceCursorCallback>::New();
    cbk->reformatViewer = this;

    for (int i = 0; i < 3; i++)
    {
        riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::ResliceAxesChangedEvent, cbk);
        riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::WindowLevelEvent, cbk);
        riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::ResliceThicknessChangedEvent, cbk);
        riw[i]->GetResliceCursorWidget()->AddObserver(vtkResliceCursorWidget::ResetCursorEvent, cbk);
        riw[i]->GetInteractorStyle()->AddObserver(vtkCommand::WindowLevelEvent, cbk);
        riw[i]->GetInteractorStyle()->AddObserver(vtkCommand::MouseMoveEvent, cbk);

        // Make them all share the same color map.
        riw[i]->SetLookupTable(riw[2]->GetLookupTable());
        riw[i]->SetColorLevel(view3d->GetColorLevel());
        riw[i]->SetColorWindow(view3d->GetColorWindow());

        planeWidget[i]->GetColorMap()->SetLookupTable(riw[2]->GetLookupTable());
        planeWidget[i]->SetColorMap(riw[i]->GetResliceCursorWidget()->GetResliceCursorRepresentation()->GetColorMap());

    }

    resetViews();
    applyRadiologicalConvention();
    updatePlaneNormals();

    planeWidget[0]->GetCurrentRenderer()->ResetCamera();
    planeWidget[0]->GetCurrentRenderer()->GetActiveCamera()->Azimuth(180);
    planeWidget[0]->GetCurrentRenderer()->GetActiveCamera()->Roll(180);

    views[0]->show();
    views[1]->show();
    views[2]->show();

    selectedView = 2;

    this->initialiseNavigators();
}
コード例 #12
0
ファイル: raindroptool.cpp プロジェクト: UIKit0/digikam
RainDropTool::RainDropTool(QObject* parent)
    : EditorToolThreaded(parent),
      d(new RainDropToolPriv)
{
    setObjectName("raindrops");
    setToolName(i18n("Raindrops"));
    setToolIcon(SmallIcon("raindrop"));

    d->previewWidget = new ImageGuideWidget(0, false, ImageGuideWidget::HVGuideMode);
    d->previewWidget->setWhatsThis(i18n("This is the preview of the Raindrop effect."
                                        "<p>Note: if you have previously selected an area in the editor, "
                                        "this will be unaffected by the filter. You can use this method to "
                                        "disable the Raindrops effect on a human face, for example.</p>"));

    setToolView(d->previewWidget);
    setPreviewModeMask(PreviewToolBar::AllPreviewModes);

    // -------------------------------------------------------------

    d->gboxSettings = new EditorToolSettings;
    d->gboxSettings->setButtons(EditorToolSettings::Default|
                                EditorToolSettings::Ok|
                                EditorToolSettings::Try|
                                EditorToolSettings::Cancel);


    // -------------------------------------------------------------

    QLabel* label1 = new QLabel(i18n("Drop size:"));
    d->dropInput   = new RIntNumInput;
    d->dropInput->setRange(0, 200, 1);
    d->dropInput->setSliderEnabled(true);
    d->dropInput->setDefaultValue(80);
    d->dropInput->setWhatsThis( i18n("Set here the raindrops' size."));

    // -------------------------------------------------------------

    QLabel* label2 = new QLabel(i18n("Number:"));
    d->amountInput = new RIntNumInput;
    d->amountInput->setRange(1, 500, 1);
    d->amountInput->setSliderEnabled(true);
    d->amountInput->setDefaultValue(150);
    d->amountInput->setWhatsThis( i18n("This value controls the maximum number of raindrops."));

    // -------------------------------------------------------------

    QLabel* label3 = new QLabel(i18n("Fish eyes:"));
    d->coeffInput  = new RIntNumInput;
    d->coeffInput->setRange(1, 100, 1);
    d->coeffInput->setSliderEnabled(true);
    d->coeffInput->setDefaultValue(30);
    d->coeffInput->setWhatsThis( i18n("This value is the fish-eye-effect optical "
                                      "distortion coefficient."));

    // -------------------------------------------------------------

    QGridLayout* mainLayout = new QGridLayout;
    mainLayout->addWidget(label1,         0, 0, 1, 3);
    mainLayout->addWidget(d->dropInput,   1, 0, 1, 3);
    mainLayout->addWidget(label2,         2, 0, 1, 3);
    mainLayout->addWidget(d->amountInput, 3, 0, 1, 3);
    mainLayout->addWidget(label3,         4, 0, 1, 3);
    mainLayout->addWidget(d->coeffInput,  5, 0, 1, 3);
    mainLayout->setRowStretch(6, 10);
    mainLayout->setMargin(d->gboxSettings->spacingHint());
    mainLayout->setSpacing(d->gboxSettings->spacingHint());
    d->gboxSettings->plainPage()->setLayout(mainLayout);

    // -------------------------------------------------------------

    setToolSettings(d->gboxSettings);
    init();
}
コード例 #13
0
ファイル: commitdialog.cpp プロジェクト: ShermanHuang/kdesdk
HgCommitDialog::HgCommitDialog(QWidget *parent):
    KDialog(parent, Qt::Dialog)
{
    // dialog properties
    this->setCaption(i18nc("@title:window", 
                "<application>Hg</application> Commit"));
    this->setButtons(KDialog::Ok | KDialog::Cancel);
    this->setDefaultButton(KDialog::Ok);
    this->setButtonText(KDialog::Ok, i18nc("@action:button", "Commit"));
    this->enableButtonOk(false); // since commit message is empty when loaded

    // To show diff between commit
    KTextEditor::Editor *editor = KTextEditor::EditorChooser::editor();
    if (!editor) {
        KMessageBox::error(this, 
                i18n("A KDE text-editor component could not be found;"
                     "\nplease check your KDE installation."));
        return;
    }
    m_fileDiffDoc = editor->createDocument(0);
    m_fileDiffView = qobject_cast<KTextEditor::View*>(m_fileDiffDoc->createView(this));
    m_fileDiffDoc->setReadWrite(false);

    // Setup actions
    m_useCurrentBranch= new KAction(this);
    m_useCurrentBranch->setCheckable(true);
    m_useCurrentBranch->setText(i18nc("@action:inmenu",
                               "Commit to current branch"));

    m_newBranch = new KAction(this);
    m_newBranch->setCheckable(true);
    m_newBranch->setText(i18nc("@action:inmenu",
                               "Create new branch"));

    m_closeBranch = new KAction(this);
    m_closeBranch->setCheckable(true);
    m_closeBranch->setText(i18nc("@action:inmenu",
                                 "Close current branch"));

    m_branchMenu = new KMenu(this);
    m_branchMenu->addAction(m_useCurrentBranch);
    m_branchMenu->addAction(m_newBranch);
    m_branchMenu->addAction(m_closeBranch);

    QActionGroup *branchActionGroup = new QActionGroup(this);
    branchActionGroup->addAction(m_useCurrentBranch);
    branchActionGroup->addAction(m_newBranch);
    branchActionGroup->addAction(m_closeBranch);
    m_useCurrentBranch->setChecked(true);
    connect(branchActionGroup, SIGNAL(triggered(QAction *)),
            this, SLOT(slotBranchActions(QAction *)));


    //////////////
    // Setup UI //
    //////////////

    // Top bar of buttons
    QHBoxLayout *topBarLayout = new QHBoxLayout;
    m_copyMessageButton = new KPushButton(i18n("Copy Message"));
    m_branchButton = new KPushButton(i18n("Branch"));

    m_copyMessageMenu = new KMenu(this);
    createCopyMessageMenu();

    topBarLayout->addWidget(new QLabel(getParentForLabel()));
    topBarLayout->addStretch();
    topBarLayout->addWidget(m_branchButton);
    topBarLayout->addWidget(m_copyMessageButton);
    m_branchButton->setMenu(m_branchMenu);
    m_copyMessageButton->setMenu(m_copyMessageMenu);

    // the commit box itself
    QGroupBox *messageGroupBox = new QGroupBox;
    QVBoxLayout *commitLayout = new QVBoxLayout;
    m_commitMessage = new QPlainTextEdit;
    commitLayout->addWidget(m_commitMessage);
    messageGroupBox->setTitle(i18nc("@title:group", "Commit Message"));
    messageGroupBox->setLayout(commitLayout);

    // Show diff here
    QGroupBox *diffGroupBox = new QGroupBox;
    QVBoxLayout *diffLayout = new QVBoxLayout(diffGroupBox);
    diffLayout->addWidget(m_fileDiffView);
    diffGroupBox->setTitle(i18nc("@title:group", "Diff/Content"));
    diffGroupBox->setLayout(diffLayout);

    // Set up layout for Status, Commit and Diff boxes
    QGridLayout *bodyLayout = new QGridLayout;
    m_statusList = new HgStatusList;
    bodyLayout->addWidget(m_statusList, 0, 0, 0, 1);
    bodyLayout->addWidget(messageGroupBox, 0, 1);
    bodyLayout->addWidget(diffGroupBox, 1, 1);
    bodyLayout->setColumnStretch(0, 1);
    bodyLayout->setColumnStretch(1, 2);
    bodyLayout->setRowStretch(0, 1);
    bodyLayout->setRowStretch(1, 1);

    // Set up layout and container for main dialog
    QFrame *frame = new QFrame;
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(topBarLayout);
    mainLayout->addLayout(bodyLayout);
    frame->setLayout(mainLayout);
    setMainWidget(frame);

    slotBranchActions(m_useCurrentBranch);
    slotInitDiffOutput(); // initialise with whole repo diff

    // Load saved settings
    FileViewHgPluginSettings *settings = FileViewHgPluginSettings::self();
    this->setInitialSize(QSize(settings->commitDialogWidth(),
                               settings->commitDialogHeight()));
    //
    connect(m_statusList, SIGNAL(itemSelectionChanged(const char, const QString &)),
        this, SLOT(slotItemSelectionChanged(const char, const QString &)));
    connect(m_commitMessage, SIGNAL(textChanged()),
         this, SLOT(slotMessageChanged()));
    connect(this, SIGNAL(finished()), this, SLOT(saveGeometry()));
}
コード例 #14
0
ファイル: PageRecord.cpp プロジェクト: MaartenBaert/ssr
PageRecord::PageRecord(MainWindow* main_window)
	: QWidget(main_window->centralWidget()) {

	m_main_window = main_window;

	m_page_started = false;
	m_input_started = false;
	m_output_started = false;
	m_previewing = false;

#if SSR_USE_ALSA
	m_last_error_sound = std::numeric_limits<int64_t>::min();
#endif

	QGroupBox *groupbox_recording = new QGroupBox(tr("Recording"), this);
	{
		m_pushbutton_start_pause = new QPushButton(groupbox_recording);

		m_checkbox_hotkey_enable = new QCheckBox(tr("Enable recording hotkey"), groupbox_recording);
		m_checkbox_hotkey_enable->setToolTip(tr("The recording hotkey is a global keyboard shortcut that can be used to start or pause the recording at any time,\n"
												"even when the SimpleScreenRecorder window is not visible. This way you can create recordings without having the\n"
												"SimpleScreenRecorder window show up in the final video."));
#if SSR_USE_ALSA
		m_checkbox_sound_notifications_enable = new QCheckBox(tr("Enable sound notifications"), groupbox_recording);
		m_checkbox_sound_notifications_enable->setToolTip(tr("When enabled, a sound will be played when the recording is started or paused, or when an error occurs."));
#endif
		QLabel *label_hotkey = new QLabel(tr("Hotkey:"), groupbox_recording);
		m_checkbox_hotkey_ctrl = new QCheckBox(tr("Ctrl +"), groupbox_recording);
		m_checkbox_hotkey_shift = new QCheckBox(tr("Shift +"), groupbox_recording);
		m_checkbox_hotkey_alt = new QCheckBox(tr("Alt +"), groupbox_recording);
		m_checkbox_hotkey_super = new QCheckBox(tr("Super +"), groupbox_recording);
		m_combobox_hotkey_key = new QComboBox(groupbox_recording);
		m_combobox_hotkey_key->setToolTip(tr("The key that you have to press (combined with the given modifiers) to start or pause recording.\n"
											 "The program that you are recording will not receive the key press."));
		// Note: The choice of keys is currently rather limited, because capturing key presses session-wide is a bit harder than it looks.
		// For example, applications are not allowed to capture the F1-F12 keys (on Ubuntu at least). The A-Z keys don't have this limitation apparently.
		for(unsigned int i = 0; i < 26; ++i) {
			m_combobox_hotkey_key->addItem(QString('A' + i));
		}

		connect(m_pushbutton_start_pause, SIGNAL(clicked()), this, SLOT(OnRecordStartPause()));
		connect(m_checkbox_hotkey_enable, SIGNAL(clicked()), this, SLOT(OnUpdateHotkeyFields()));
#if SSR_USE_ALSA
		connect(m_checkbox_sound_notifications_enable, SIGNAL(clicked()), this, SLOT(OnUpdateSoundNotifications()));
#endif
		connect(m_checkbox_hotkey_ctrl, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_checkbox_hotkey_shift, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_checkbox_hotkey_alt, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_checkbox_hotkey_super, SIGNAL(clicked()), this, SLOT(OnUpdateHotkey()));
		connect(m_combobox_hotkey_key, SIGNAL(activated(int)), this, SLOT(OnUpdateHotkey()));

		QVBoxLayout *layout = new QVBoxLayout(groupbox_recording);
		layout->addWidget(m_pushbutton_start_pause);
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(m_checkbox_hotkey_enable);
#if SSR_USE_ALSA
			layout2->addWidget(m_checkbox_sound_notifications_enable);
#endif
		}
		{
			QHBoxLayout *layout2 = new QHBoxLayout();
			layout->addLayout(layout2);
			layout2->addWidget(label_hotkey);
			layout2->addWidget(m_checkbox_hotkey_ctrl);
			layout2->addWidget(m_checkbox_hotkey_shift);
			layout2->addWidget(m_checkbox_hotkey_alt);
			layout2->addWidget(m_checkbox_hotkey_super);
			layout2->addWidget(m_combobox_hotkey_key);
		}
	}
	QSplitter *splitter_vertical = new QSplitter(Qt::Vertical, this);
	{
		QSplitter *splitter_horizontal = new QSplitter(Qt::Horizontal, splitter_vertical);
		{
			QGroupBox *groupbox_information = new QGroupBox(tr("Information"), splitter_horizontal);
			{
				QLabel *label_total_time = new QLabel(tr("Total time:"), groupbox_information);
				m_label_info_total_time = new QLabel(groupbox_information);
				QLabel *label_frame_rate_in = new QLabel(tr("FPS in:"), groupbox_information);
				m_label_info_frame_rate_in = new QLabel(groupbox_information);
				QLabel *label_frame_rate_out = new QLabel(tr("FPS out:"), groupbox_information);
				m_label_info_frame_rate_out = new QLabel(groupbox_information);
				QLabel *label_size_in = new QLabel(tr("Size in:"), groupbox_information);
				m_label_info_size_in = new QLabel(groupbox_information);
				QLabel *label_size_out = new QLabel(tr("Size out:"), groupbox_information);
				m_label_info_size_out = new QLabel(groupbox_information);
				QLabel *label_file_name = new QLabel(tr("File name:"), groupbox_information);
				m_label_info_file_name = new ElidedLabel(QString(), Qt::ElideMiddle, groupbox_information);
				m_label_info_file_name->setMinimumWidth(100);
				QLabel *label_file_size = new QLabel(tr("File size:"), groupbox_information);
				m_label_info_file_size = new QLabel(groupbox_information);
				QLabel *label_bit_rate = new QLabel(tr("Bit rate:"), groupbox_information);
				m_label_info_bit_rate = new QLabel(groupbox_information);

				QGridLayout *layout = new QGridLayout(groupbox_information);
				layout->addWidget(label_total_time, 0, 0);
				layout->addWidget(m_label_info_total_time, 0, 1);
				layout->addWidget(label_frame_rate_in, 1, 0);
				layout->addWidget(m_label_info_frame_rate_in, 1, 1);
				layout->addWidget(label_frame_rate_out, 2, 0);
				layout->addWidget(m_label_info_frame_rate_out, 2, 1);
				layout->addWidget(label_size_in, 3, 0);
				layout->addWidget(m_label_info_size_in, 3, 1);
				layout->addWidget(label_size_out, 4, 0);
				layout->addWidget(m_label_info_size_out, 4, 1);
				layout->addWidget(label_file_name, 5, 0);
				layout->addWidget(m_label_info_file_name, 5, 1);
				layout->addWidget(label_file_size, 6, 0);
				layout->addWidget(m_label_info_file_size, 6, 1);
				layout->addWidget(label_bit_rate, 7, 0);
				layout->addWidget(m_label_info_bit_rate, 7, 1);
				layout->setColumnStretch(1, 1);
				layout->setRowStretch(8, 1);
			}
			QGroupBox *groupbox_preview = new QGroupBox(tr("Preview"), splitter_horizontal);
			{
				m_preview_page1 = new QWidget(groupbox_preview);
				{
					QLabel *label_preview_frame_rate = new QLabel(tr("Preview frame rate:"), m_preview_page1);
					m_spinbox_preview_frame_rate = new QSpinBox(m_preview_page1);
					m_spinbox_preview_frame_rate->setRange(1, 1000);
					m_spinbox_preview_frame_rate->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
					QLabel *label_preview_note = new QLabel(tr("Note: Previewing requires extra CPU time (especially at high frame rates)."), m_preview_page1);
					label_preview_note->setWordWrap(true);
					label_preview_note->setAlignment(Qt::AlignLeft | Qt::AlignTop);
					label_preview_note->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::MinimumExpanding);

					QGridLayout *layout = new QGridLayout(m_preview_page1);
					layout->setMargin(0);
					layout->addWidget(label_preview_frame_rate, 0, 0);
					layout->addWidget(m_spinbox_preview_frame_rate, 0, 1);
					layout->addWidget(label_preview_note, 1, 0, 1, 2);
				}
				m_preview_page2 = new QWidget(groupbox_preview);
				{
					m_video_previewer = new VideoPreviewer(m_preview_page2);
					m_label_mic_icon = new QLabel(m_preview_page2);
					m_label_mic_icon->setPixmap(g_icon_microphone.pixmap(24, 24));
					m_audio_previewer = new AudioPreviewer(m_preview_page2);

					QVBoxLayout *layout = new QVBoxLayout(m_preview_page2);
					layout->setMargin(0);
					layout->addWidget(m_video_previewer);
					{
						QHBoxLayout *layout2 = new QHBoxLayout();
						layout->addLayout(layout2);
						layout2->addStretch();
						layout2->addWidget(m_label_mic_icon);
						layout2->addWidget(m_audio_previewer);
						layout2->addStretch();
					}
				}
				m_pushbutton_preview_start_stop = new QPushButton(groupbox_preview);

				connect(m_pushbutton_preview_start_stop, SIGNAL(clicked()), this, SLOT(OnPreviewStartStop()));

				QVBoxLayout *layout = new QVBoxLayout(groupbox_preview);
				{
					m_stacked_layout_preview = new QStackedLayout();
					layout->addLayout(m_stacked_layout_preview);
					m_stacked_layout_preview->addWidget(m_preview_page1);
					m_stacked_layout_preview->addWidget(m_preview_page2);
				}
				layout->addWidget(m_pushbutton_preview_start_stop);
			}

			splitter_horizontal->addWidget(groupbox_information);
			splitter_horizontal->addWidget(groupbox_preview);
			splitter_horizontal->setStretchFactor(0, 1);
			splitter_horizontal->setStretchFactor(1, 3);
		}
		QGroupBox *groupbox_log = new QGroupBox(tr("Log"), splitter_vertical);
		{
			m_textedit_log = new QTextEditSmall(groupbox_log);
			m_textedit_log->setReadOnly(true);

			QVBoxLayout *layout = new QVBoxLayout(groupbox_log);
			layout->addWidget(m_textedit_log);
		}

		splitter_vertical->addWidget(splitter_horizontal);
		splitter_vertical->addWidget(groupbox_log);
		splitter_vertical->setStretchFactor(0, 3);
		splitter_vertical->setStretchFactor(1, 1);
	}

	QPushButton *button_cancel = new QPushButton(g_icon_cancel, tr("Cancel recording"), this);
	QPushButton *button_save = new QPushButton(g_icon_save, tr("Save recording"), this);

	if(g_option_systray) {
		m_systray_icon = new QSystemTrayIcon(g_icon_ssr_idle, m_main_window);
		QMenu *menu = new QMenu(m_main_window);
		m_systray_action_start_pause = menu->addAction(QString(), this, SLOT(OnRecordStartPause()));
		m_systray_action_start_pause->setIconVisibleInMenu(true);
		m_systray_action_cancel = menu->addAction(g_icon_cancel, tr("Cancel recording"), this, SLOT(OnCancel()));
		m_systray_action_cancel->setIconVisibleInMenu(true);
		m_systray_action_save = menu->addAction(g_icon_save, tr("Save recording"), this, SLOT(OnSave()));
		m_systray_action_save->setIconVisibleInMenu(true);
		menu->addSeparator();
		m_systray_action_show_hide = menu->addAction(QString(), m_main_window, SLOT(OnShowHide()));
		m_systray_action_show_hide->setIconVisibleInMenu(true);
		m_systray_action_quit = menu->addAction(g_icon_quit, tr("Quit"), m_main_window, SLOT(close()));
		m_systray_action_quit->setIconVisibleInMenu(true);
		m_systray_icon->setContextMenu(menu);
	} else {
		m_systray_icon = NULL;
	}

	connect(button_cancel, SIGNAL(clicked()), this, SLOT(OnCancel()));
	connect(button_save, SIGNAL(clicked()), this, SLOT(OnSave()));
	if(m_systray_icon != NULL)
		connect(m_systray_icon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), m_main_window, SLOT(OnSysTrayActivated(QSystemTrayIcon::ActivationReason)));

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(groupbox_recording);
	layout->addWidget(splitter_vertical);
	{
		QHBoxLayout *layout2 = new QHBoxLayout();
		layout->addLayout(layout2);
		layout2->addWidget(button_cancel);
		layout2->addWidget(button_save);
	}

	UpdateSysTray();
	UpdateRecordPauseButton();
	UpdatePreview();

	m_timer_update_info = new QTimer(this);
	connect(m_timer_update_info, SIGNAL(timeout()), this, SLOT(OnUpdateInformation()));
	connect(&m_hotkey_start_pause, SIGNAL(Triggered()), this, SLOT(OnRecordStartPause()), Qt::QueuedConnection);
	connect(Logger::GetInstance(), SIGNAL(NewLine(Logger::enum_type,QString)), this, SLOT(OnNewLogLine(Logger::enum_type,QString)), Qt::QueuedConnection);

	if(m_systray_icon != NULL)
		m_systray_icon->show();

}
コード例 #15
0
OptionsRasterElementImporter::OptionsRasterElementImporter() :
   QWidget(NULL),
   mpAutoGeorefGroup(NULL),
   mpImporterPlugInRadio(NULL),
   mpPlugInList(NULL),
   mpLatLonLayerCheck(NULL)
{
   // Georeference
   mpAutoGeorefGroup = new QGroupBox("Automatically georeference on import", this);
   mpAutoGeorefGroup->setCheckable(true);

   mpImporterPlugInRadio = new QRadioButton("Use plug-in determined by the importer", mpAutoGeorefGroup);
   QRadioButton* pPlugInRadio = new QRadioButton("Use best available plug-in:", mpAutoGeorefGroup);
   mpPlugInList = new MutuallyExclusiveListWidget(mpAutoGeorefGroup);

   mpLatLonLayerCheck = new QCheckBox("Display latitude/longitude layer", mpAutoGeorefGroup);

   LabeledSection* pGeoreferenceSection = new LabeledSection(mpAutoGeorefGroup, "Georeference", this);

   // Layout
   QGridLayout* pAutoGeorefGrid = new QGridLayout(mpAutoGeorefGroup);
   pAutoGeorefGrid->setMargin(10);
   pAutoGeorefGrid->setSpacing(10);
   pAutoGeorefGrid->addWidget(mpImporterPlugInRadio, 0, 0, 1, 2);
   pAutoGeorefGrid->addWidget(pPlugInRadio, 1, 0, 1, 2);
   pAutoGeorefGrid->addWidget(mpPlugInList, 2, 1);
   pAutoGeorefGrid->addWidget(mpLatLonLayerCheck, 3, 0, 1, 2);
   pAutoGeorefGrid->setColumnMinimumWidth(0, 12);
   pAutoGeorefGrid->setRowStretch(2, 10);
   pAutoGeorefGrid->setColumnStretch(1, 10);

   QVBoxLayout* pLayout = new QVBoxLayout(this);
   pLayout->setMargin(0);
   pLayout->setSpacing(10);
   pLayout->addWidget(pGeoreferenceSection, 10);

   // Initialization
   mpAutoGeorefGroup->setChecked(RasterElementImporterShell::getSettingAutoGeoreference());
   mpImporterPlugInRadio->setChecked(RasterElementImporterShell::getSettingImporterGeoreferencePlugIn());
   pPlugInRadio->setChecked(!RasterElementImporterShell::getSettingImporterGeoreferencePlugIn());
   mpPlugInList->setDisabled(RasterElementImporterShell::getSettingImporterGeoreferencePlugIn());
   mpLatLonLayerCheck->setChecked(RasterElementImporterShell::getSettingDisplayLatLonLayer());

   Service<PlugInManagerServices> pManager;
   QStringList plugInNames;

   std::vector<PlugInDescriptor*> descriptors = pManager->getPlugInDescriptors("Georeference");
   for (std::vector<PlugInDescriptor*>::const_iterator iter = descriptors.begin(); iter != descriptors.end(); ++iter)
   {
      PlugInDescriptor* pDescriptor = *iter;
      if (pDescriptor != NULL)
      {
         const std::string& plugInName = pDescriptor->getName();
         if (plugInName.empty() == false)
         {
            plugInNames.append(QString::fromStdString(plugInName));
         }
      }
   }

   QStringList selectedPlugInNames;

   std::vector<std::string> geoPlugIns = RasterElementImporterShell::getSettingGeoreferencePlugIns();
   for (std::vector<std::string>::const_iterator iter = geoPlugIns.begin(); iter != geoPlugIns.end(); ++iter)
   {
      std::string plugInName = *iter;
      if (plugInName.empty() == false)
      {
         selectedPlugInNames.append(QString::fromStdString(plugInName));
      }
   }

   mpPlugInList->setAvailableItemsLabel("Available Plug-Ins:");
   mpPlugInList->setAvailableItems(plugInNames);
   mpPlugInList->setSelectedItemsLabel("Preferred Plug-Ins:");
   mpPlugInList->selectItems(selectedPlugInNames);

   // Connections
   VERIFYNR(connect(pPlugInRadio, SIGNAL(toggled(bool)), mpPlugInList, SLOT(setEnabled(bool))));
}
コード例 #16
0
FeatureClassWidget::FeatureClassWidget(QWidget* pParent) :
   ModifierWidget(pParent),
   mpEditFeatureClass(NULL),
   mpFeatureClass(NULL),
   mbDisplayOnlyChanges(true)
{
   QTabWidget* pTabWidget = new QTabWidget(this);

   QWidget* pConnectionTab = new QWidget(this);
   QGridLayout* pConnectionLayout = new QGridLayout(pConnectionTab);
   QLabel* pLayerNameLabel = new QLabel("Layer name:", pConnectionTab);
   mpLayerNameEdit = new QLineEdit(pConnectionTab);
   mpConnection = new ConnectionParametersWidget(pConnectionTab);

   pConnectionLayout->addWidget(pLayerNameLabel, 0, 0);
   pConnectionLayout->addWidget(mpLayerNameEdit, 0, 1);
   pConnectionLayout->addWidget(mpConnection, 1, 0, 1, 2);

   QueryOptionsWidget* pInspector = new QueryOptionsWidget(this);
   mpDisplay = new ListInspectorWidget(pInspector, this);

   mpClipping = new QWidget(this);
   mpNoClipButton = new QRadioButton("No clip", mpClipping);
   mpSceneClipButton = new QRadioButton("Clip to scene", mpClipping);
   mpSpecifiedClipButton = new QRadioButton("Specified clip", mpClipping);
   mpNorthEdit = new LatLonLineEdit(mpClipping);
   mpSouthEdit = new LatLonLineEdit(mpClipping);
   mpEastEdit = new LatLonLineEdit(mpClipping);
   mpWestEdit = new LatLonLineEdit(mpClipping);
   QLabel* pNorthLabel = new QLabel("North:", mpClipping);
   QLabel* pSouthLabel = new QLabel("South:", mpClipping);
   QLabel* pEastLabel = new QLabel("East:", mpClipping);
   QLabel* pWestLabel = new QLabel("West:", mpClipping);

   mSpecifiedClipWidgets.push_back(mpNorthEdit);
   mSpecifiedClipWidgets.push_back(mpSouthEdit);
   mSpecifiedClipWidgets.push_back(mpEastEdit);
   mSpecifiedClipWidgets.push_back(mpWestEdit);
   mSpecifiedClipWidgets.push_back(pNorthLabel);
   mSpecifiedClipWidgets.push_back(pSouthLabel);
   mSpecifiedClipWidgets.push_back(pEastLabel);
   mSpecifiedClipWidgets.push_back(pWestLabel);

   QGridLayout* pClipLayout = new QGridLayout(mpClipping);
   pClipLayout->setColumnStretch(2, 10);
   pClipLayout->setColumnMinimumWidth(0, 15);
   pClipLayout->addWidget(mpNoClipButton, 0, 0, 1, 3);
   pClipLayout->addWidget(mpSceneClipButton, 1, 0, 1, 3);
   pClipLayout->addWidget(mpSpecifiedClipButton, 2, 0, 1, 3);
   pClipLayout->addWidget(pNorthLabel, 3, 1);
   pClipLayout->addWidget(mpNorthEdit, 3, 2);
   pClipLayout->addWidget(pSouthLabel, 4, 1);
   pClipLayout->addWidget(mpSouthEdit, 4, 2);
   pClipLayout->addWidget(pEastLabel, 5, 1);
   pClipLayout->addWidget(mpEastEdit, 5, 2);
   pClipLayout->addWidget(pWestLabel, 6, 1);
   pClipLayout->addWidget(mpWestEdit, 6, 2);
   pClipLayout->setRowStretch(7, 10);

   pTabWidget->addTab(pConnectionTab, "Connection");
   pTabWidget->addTab(mpDisplay, "Display");
   pTabWidget->addTab(mpClipping, "Clipping");

   mpErrorLabel = new QLabel(this);
   // Font
   QFont errorFont = mpErrorLabel->font();
   errorFont.setBold(true);
   mpErrorLabel->setFont(errorFont);

   // Text color
   QPalette errorPalette = mpErrorLabel->palette();
   errorPalette.setColor(QPalette::WindowText, Qt::red);
   mpErrorLabel->setPalette(errorPalette);

   // Word wrap
   mpErrorLabel->setWordWrap(true);

   QPushButton* pTestConnectionButton = new QPushButton("Test Connection", this);

   mpProgressBar = new QProgressBar(this);
   mpProgressBar->setRange(0, 0);
   mpProgressBar->setHidden(true);
   
   QGridLayout* pLayout = new QGridLayout(this);
   pLayout->setMargin(0);
   pLayout->setSpacing(5);
   pLayout->setColumnStretch(1, 10);

   pLayout->addWidget(pTabWidget, 0, 0, 1, 3);
   pLayout->addWidget(mpProgressBar, 1, 0);
   pLayout->addWidget(mpErrorLabel, 1, 1);
   pLayout->addWidget(pTestConnectionButton, 1, 2);

   // Initialization
   setWindowTitle("Shape File");

   // Connections
   VERIFYNR(connect(pTabWidget, SIGNAL(currentChanged(int)), this, SLOT(testConnection())));
   VERIFYNR(connect(pTestConnectionButton, SIGNAL(clicked()), this, SLOT(testConnection())));

   VERIFYNR(connect(mpConnection, SIGNAL(modified()), this, SLOT(updateConnectionParameters())));
   VERIFYNR(attachSignal(mpConnection, SIGNAL(modified())));

   VERIFYNR(connect(mpDisplay, SIGNAL(addItems()), this, SLOT(addDisplayItems())));
   VERIFYNR(connect(mpDisplay, SIGNAL(saveInspector(QWidget*, QListWidgetItem*)),
      this, SLOT(saveDisplayInspector(QWidget*, QListWidgetItem*))));
   VERIFYNR(connect(mpDisplay, SIGNAL(loadInspector(QWidget*, QListWidgetItem*)),
      this, SLOT(loadDisplayInspector(QWidget*, QListWidgetItem*))));
   VERIFYNR(connect(mpDisplay, SIGNAL(removeItem(QListWidgetItem*)),
      this, SLOT(removeDisplayItem(QListWidgetItem*))));

   VERIFYNR(connect(mpNoClipButton, SIGNAL(toggled(bool)), this, SLOT(clipButtonClicked())));
   VERIFYNR(connect(mpSceneClipButton, SIGNAL(toggled(bool)), this, SLOT(clipButtonClicked())));
   VERIFYNR(connect(mpSpecifiedClipButton, SIGNAL(toggled(bool)), this, SLOT(clipButtonClicked())));
}
コード例 #17
0
void ApplicationWindow::addTabs()
{
	v4l2_queryctrl qctrl;
	unsigned ctrl_class;
	unsigned i;
	int id;

	memset(&qctrl, 0, sizeof(qctrl));
	qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
	while (queryctrl(qctrl)) {
		if (is_valid_type(qctrl.type) &&
		    (qctrl.flags & V4L2_CTRL_FLAG_DISABLED) == 0) {
			m_ctrlMap[qctrl.id] = qctrl;
			if (qctrl.type != V4L2_CTRL_TYPE_CTRL_CLASS)
				m_classMap[V4L2_CTRL_ID2CLASS(qctrl.id)].push_back(qctrl.id);
		}
		qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
	}
	if (qctrl.id == V4L2_CTRL_FLAG_NEXT_CTRL) {
		strcpy((char *)qctrl.name, "User Controls");
		qctrl.id = V4L2_CTRL_CLASS_USER | 1;
		qctrl.type = V4L2_CTRL_TYPE_CTRL_CLASS;
		m_ctrlMap[qctrl.id] = qctrl;
		for (id = V4L2_CID_USER_BASE; id < V4L2_CID_LASTP1; id++) {
			qctrl.id = id;
			if (!queryctrl(qctrl))
				continue;
			if (!is_valid_type(qctrl.type))
				continue;
			if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED)
				continue;
			m_ctrlMap[qctrl.id] = qctrl;
			m_classMap[V4L2_CTRL_CLASS_USER].push_back(qctrl.id);
		}
		for (qctrl.id = V4L2_CID_PRIVATE_BASE;
				queryctrl(qctrl); qctrl.id++) {
			if (!is_valid_type(qctrl.type))
				continue;
			if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED)
				continue;
			m_ctrlMap[qctrl.id] = qctrl;
			m_classMap[V4L2_CTRL_CLASS_USER].push_back(qctrl.id);
		}
	}
	
	m_haveExtendedUserCtrls = false;
	for (unsigned i = 0; i < m_classMap[V4L2_CTRL_CLASS_USER].size(); i++) {
		unsigned id = m_classMap[V4L2_CTRL_CLASS_USER][i];

		if (m_ctrlMap[id].type == V4L2_CTRL_TYPE_INTEGER64 ||
		    m_ctrlMap[id].type == V4L2_CTRL_TYPE_STRING ||
		    V4L2_CTRL_DRIVER_PRIV(id)) {
			m_haveExtendedUserCtrls = true;
			break;
		}
	}

	for (ClassMap::iterator iter = m_classMap.begin(); iter != m_classMap.end(); ++iter) {
		if (iter->second.size() == 0)
			continue;
		ctrl_class = V4L2_CTRL_ID2CLASS(iter->second[0]);
		id = ctrl_class | 1;
		m_col = m_row = 0;
		m_cols = 4;

		const v4l2_queryctrl &qctrl = m_ctrlMap[id];
		QWidget *t = new QWidget(m_tabs);
		QVBoxLayout *vbox = new QVBoxLayout(t);
		QWidget *w = new QWidget(t);

		vbox->addWidget(w);

		QGridLayout *grid = new QGridLayout(w);

		grid->setSpacing(3);
		m_tabs->addTab(t, (char *)qctrl.name);
		for (i = 0; i < iter->second.size(); i++) {
			if (i & 1)
				id = iter->second[(1+iter->second.size()) / 2 + i / 2];
			else
				id = iter->second[i / 2];
			addCtrl(grid, m_ctrlMap[id]);
		}
		grid->addWidget(new QWidget(w), grid->rowCount(), 0, 1, m_cols);
		grid->setRowStretch(grid->rowCount() - 1, 1);
		w = new QWidget(t);
		vbox->addWidget(w);
		grid = new QGridLayout(w);
		finishGrid(grid, ctrl_class);
	}
}
コード例 #18
0
ファイル: info_panels.cpp プロジェクト: mingyueqingquan/vlc
/**
 * First Panel - Meta Info
 * All the usual MetaData are displayed and can be changed.
 **/
MetaPanel::MetaPanel( QWidget *parent,
                      intf_thread_t *_p_intf )
    : QWidget( parent ), p_intf( _p_intf )
{
    QGridLayout *metaLayout = new QGridLayout( this );
    metaLayout->setVerticalSpacing( 0 );

    QFont smallFont = QApplication::font();
    smallFont.setPointSize( smallFont.pointSize() - 1 );
    smallFont.setBold( true );

    int line = 0; /* Counter for GridLayout */
    p_input = NULL;
    QLabel *label;

#define ADD_META( string, widget, col, colspan ) {                        \
    label = new QLabel( qtr( string ) ); label->setFont( smallFont );     \
    label->setContentsMargins( 3, 2, 0, 0 );                              \
    metaLayout->addWidget( label, line++, col, 1, colspan );              \
    widget = new QLineEdit;                                               \
    metaLayout->addWidget( widget, line, col, 1, colspan );               \
    CONNECT( widget, textEdited( QString ), this, enterEditMode() );      \
}

    /* Title, artist and album*/
    ADD_META( VLC_META_TITLE, title_text, 0, 10 );
    line++;
    ADD_META( VLC_META_ARTIST, artist_text, 0, 10 );
    line++;
    ADD_META( VLC_META_ALBUM, collection_text, 0, 7 );

    /* Date */
    label = new QLabel( qtr( VLC_META_DATE ) );
    label->setFont( smallFont );
    label->setContentsMargins( 3, 2, 0, 0 );
    metaLayout->addWidget( label, line - 1, 7, 1, 2 );

    /* Date (Should be in years) */
    date_text = new QLineEdit;
    date_text->setAlignment( Qt::AlignRight );
    date_text->setInputMask("0000");
    date_text->setMaximumWidth( 140 );
    metaLayout->addWidget( date_text, line, 7, 1, -1 );
    line++;

    /* Genre Name */
    /* TODO List id3genres.h is not includable yet ? */
    ADD_META( VLC_META_GENRE, genre_text, 0, 7 );

    /* Number - on the same line */
    label = new QLabel( qtr( VLC_META_TRACK_NUMBER ) );
    label->setFont( smallFont );
    label->setContentsMargins( 3, 2, 0, 0 );
    metaLayout->addWidget( label, line - 1, 7, 1, 3  );

    seqnum_text = new QLineEdit;
    seqnum_text->setMaximumWidth( 64 );
    seqnum_text->setAlignment( Qt::AlignRight );
    metaLayout->addWidget( seqnum_text, line, 7, 1, 1 );

    label = new QLabel( "/" );
    label->setFont( smallFont );
    metaLayout->addWidget( label, line, 8, 1, 1 );

    seqtot_text = new QLineEdit;
    seqtot_text->setMaximumWidth( 64 );
    seqtot_text->setAlignment( Qt::AlignRight );
    metaLayout->addWidget( seqtot_text, line, 9, 1, 1 );
    line++;

    /* Rating - on the same line */
    /*
    metaLayout->addWidget( new QLabel( qtr( VLC_META_RATING ) ), line, 4, 1, 2 );
    rating_text = new QSpinBox; setSpinBounds( rating_text );
    metaLayout->addWidget( rating_text, line, 6, 1, 1 );
    */

    /* Now Playing - Useful for live feeds (HTTP, DVB, ETC...) */
    ADD_META( VLC_META_NOW_PLAYING, nowplaying_text, 0, 7 );
    nowplaying_text->setReadOnly( true );
    line--;

    /* Language on the same line */
    ADD_META( VLC_META_LANGUAGE, language_text, 7, -1 );
    line++;
    ADD_META( VLC_META_PUBLISHER, publisher_text, 0, 7 );

    fingerprintButton = new QPushButton( qtr("&Fingerprint") );
    fingerprintButton->setToolTip( qtr( "Find meta data using audio fingerprinting" ) );
    fingerprintButton->setVisible( false );
    metaLayout->addWidget( fingerprintButton, line, 7 , 3, -1 );
    CONNECT( fingerprintButton, clicked(), this, fingerprint() );

    line++;

    lblURL = new QLabel;
    lblURL->setOpenExternalLinks( true );
    lblURL->setTextFormat( Qt::RichText );
    lblURL->setMaximumWidth( 128 );
    metaLayout->addWidget( lblURL, line -1, 7, 1, -1 );

    ADD_META( VLC_META_COPYRIGHT, copyright_text, 0,  7 );
    line++;

    /* ART_URL */
    art_cover = new CoverArtLabel( this, p_intf );
    metaLayout->addWidget( art_cover, line, 7, 6, 3, Qt::AlignLeft );

    ADD_META( VLC_META_ENCODED_BY, encodedby_text, 0, 7 );
    line++;

    label = new QLabel( qtr( N_("Comments") ) );
    label->setFont( smallFont );
    label->setContentsMargins( 3, 2, 0, 0 );
    metaLayout->addWidget( label, line++, 0, 1, 7 );
    description_text = new QTextEdit;
    description_text->setAcceptRichText( false );
    metaLayout->addWidget( description_text, line, 0, 1, 7 );
    CONNECT( description_text, textChanged(), this, enterEditMode() );
    line++;

    /* VLC_META_SETTING: Useless */
    /* ADD_META( TRACKID )  Useless ? */
    /* ADD_URI - Do not show it, done outside */

    metaLayout->setColumnStretch( 1, 20 );
    metaLayout->setColumnMinimumWidth ( 1, 80 );
    metaLayout->setRowStretch( line, 10 );
#undef ADD_META

    CONNECT( seqnum_text, textEdited( QString ), this, enterEditMode() );
    CONNECT( seqtot_text, textEdited( QString ), this, enterEditMode() );

    CONNECT( date_text, textEdited( QString ), this, enterEditMode() );
//    CONNECT( THEMIM->getIM(), artChanged( QString ), this, enterEditMode() );
    /*    CONNECT( rating_text, valueChanged( QString ), this, enterEditMode( QString ) );*/

    /* We are not yet in Edit Mode */
    b_inEditMode = false;
}
コード例 #19
0
ファイル: basictab.cpp プロジェクト: serghei/kde3-kdebase
BasicTab::BasicTab(QWidget *parent, const char *name) : QWidget(parent, name)
{
    _menuFolderInfo = 0;
    _menuEntryInfo = 0;

    QGridLayout *layout = new QGridLayout(this, 6, 2, KDialog::marginHint(), KDialog::spacingHint());

    // general group
    QGroupBox *general_group = new QGroupBox(this);
    QGridLayout *grid = new QGridLayout(general_group, 5, 2, KDialog::marginHint(), KDialog::spacingHint());

    general_group->setAcceptDrops(false);

    // setup line inputs
    _nameEdit = new KLineEdit(general_group);
    _nameEdit->setAcceptDrops(false);
    _descriptionEdit = new KLineEdit(general_group);
    _descriptionEdit->setAcceptDrops(false);
    _commentEdit = new KLineEdit(general_group);
    _commentEdit->setAcceptDrops(false);
    _execEdit = new KURLRequester(general_group);
    _execEdit->lineEdit()->setAcceptDrops(false);
    QWhatsThis::add(_execEdit, i18n("Following the command, you can have several place holders which will be replaced "
                                    "with the actual values when the actual program is run:\n"
                                    "%f - a single file name\n"
                                    "%F - a list of files; use for applications that can open several local files at once\n"
                                    "%u - a single URL\n"
                                    "%U - a list of URLs\n"
                                    "%d - the folder of the file to open\n"
                                    "%D - a list of folders\n"
                                    "%i - the icon\n"
                                    "%m - the mini-icon\n"
                                    "%c - the caption"));

    _launchCB = new QCheckBox(i18n("Enable &launch feedback"), general_group);
    _systrayCB = new QCheckBox(i18n("&Place in system tray"), general_group);

    // setup labels
    _nameLabel = new QLabel(_nameEdit, i18n("&Name:"), general_group);
    _descriptionLabel = new QLabel(_descriptionEdit, i18n("&Description:"), general_group);
    _commentLabel = new QLabel(_commentEdit, i18n("&Comment:"), general_group);
    _execLabel = new QLabel(_execEdit, i18n("Co&mmand:"), general_group);
    grid->addWidget(_nameLabel, 0, 0);
    grid->addWidget(_descriptionLabel, 1, 0);
    grid->addWidget(_commentLabel, 2, 0);
    grid->addWidget(_execLabel, 3, 0);

    // connect line inputs
    connect(_nameEdit, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));
    connect(_descriptionEdit, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));
    connect(_commentEdit, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));
    connect(_execEdit, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));
    connect(_execEdit, SIGNAL(urlSelected(const QString &)), SLOT(slotExecSelected()));
    connect(_launchCB, SIGNAL(clicked()), SLOT(launchcb_clicked()));
    connect(_systrayCB, SIGNAL(clicked()), SLOT(systraycb_clicked()));

    // add line inputs to the grid
    grid->addMultiCellWidget(_nameEdit, 0, 0, 1, 1);
    grid->addMultiCellWidget(_descriptionEdit, 1, 1, 1, 1);
    grid->addMultiCellWidget(_commentEdit, 2, 2, 1, 2);
    grid->addMultiCellWidget(_execEdit, 3, 3, 1, 2);
    grid->addMultiCellWidget(_launchCB, 4, 4, 0, 2);
    grid->addMultiCellWidget(_systrayCB, 5, 5, 0, 2);

    // setup icon button
    _iconButton = new KIconButton(general_group);
    _iconButton->setFixedSize(56, 56);
    _iconButton->setIconSize(48);
    connect(_iconButton, SIGNAL(iconChanged(QString)), SLOT(slotChanged()));
    grid->addMultiCellWidget(_iconButton, 0, 1, 2, 2);

    // add the general group to the main layout
    layout->addMultiCellWidget(general_group, 0, 0, 0, 1);

    // path group
    _path_group = new QGroupBox(this);
    QVBoxLayout *vbox = new QVBoxLayout(_path_group, KDialog::marginHint(), KDialog::spacingHint());

    QHBox *hbox = new QHBox(_path_group);
    hbox->setSpacing(KDialog::spacingHint());

    _pathLabel = new QLabel(i18n("&Work path:"), hbox);

    _pathEdit = new KURLRequester(hbox);
    _pathEdit->setMode(KFile::Directory | KFile::LocalOnly);
    _pathEdit->lineEdit()->setAcceptDrops(false);

    _pathLabel->setBuddy(_pathEdit);

    connect(_pathEdit, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));
    vbox->addWidget(hbox);
    layout->addMultiCellWidget(_path_group, 1, 1, 0, 1);

    // terminal group
    _term_group = new QGroupBox(this);
    vbox = new QVBoxLayout(_term_group, KDialog::marginHint(), KDialog::spacingHint());

    _terminalCB = new QCheckBox(i18n("Run in term&inal"), _term_group);
    connect(_terminalCB, SIGNAL(clicked()), SLOT(termcb_clicked()));
    vbox->addWidget(_terminalCB);

    hbox = new QHBox(_term_group);
    hbox->setSpacing(KDialog::spacingHint());
    _termOptLabel = new QLabel(i18n("Terminal &options:"), hbox);
    _termOptEdit = new KLineEdit(hbox);
    _termOptEdit->setAcceptDrops(false);
    _termOptLabel->setBuddy(_termOptEdit);

    connect(_termOptEdit, SIGNAL(textChanged(const QString &)), SLOT(slotChanged()));
    vbox->addWidget(hbox);
    layout->addMultiCellWidget(_term_group, 2, 2, 0, 1);

    _termOptEdit->setEnabled(false);

    // uid group
    _uid_group = new QGroupBox(this);
    vbox = new QVBoxLayout(_uid_group, KDialog::marginHint(), KDialog::spacingHint());

    _uidCB = new QCheckBox(i18n("&Run as a different user"), _uid_group);
    connect(_uidCB, SIGNAL(clicked()), SLOT(uidcb_clicked()));
    vbox->addWidget(_uidCB);

    hbox = new QHBox(_uid_group);
    hbox->setSpacing(KDialog::spacingHint());
    _uidLabel = new QLabel(i18n("&Username:"******"" );
    // QPushButton* _keyButton = new QPushButton( i18n( "Change" ),
    //                                           general_group_keybind );
    // connect( _keyButton, SIGNAL( clicked()), this, SLOT( keyButtonPressed()));
    _keyEdit = new KKeyButton(general_group_keybind);
    grid_keybind->addWidget(new QLabel(_keyEdit, i18n("Current shortcut &key:"), general_group_keybind), 0, 0);
    connect(_keyEdit, SIGNAL(capturedShortcut(const KShortcut &)), this, SLOT(slotCapturedShortcut(const KShortcut &)));
    grid_keybind->addWidget(_keyEdit, 0, 1);
    // grid_keybind->addWidget(_keyButton, 0, 2 );

    if(!KHotKeys::present())
        general_group_keybind->hide();

    slotDisableAction();
}
コード例 #20
0
ファイル: kdm-conv.cpp プロジェクト: aarontc/kde-workspace
KDMConvenienceWidget::KDMConvenienceWidget(QWidget *parent)
    : QWidget(parent)
{
    QString wtstr;

    QLabel *paranoia = new QLabel(
        i18n("<big><b><center>Attention<br/>"
             "Read help</center></b></big>"), this);
    QPalette p;
    p.setBrush(QPalette::WindowText,
        KColorScheme(QPalette::Active, KColorScheme::Window)
            .foreground(KColorScheme::NegativeText));
    paranoia->setPalette(p);

    QSizePolicy vpref(QSizePolicy::Minimum, QSizePolicy::Fixed);

    alGroup = new QGroupBox(i18n("Enable Au&to-Login"), this);
    alGroup->setCheckable(true);
    alGroup->setSizePolicy(vpref);
    QVBoxLayout *laygroup2 = new QVBoxLayout(alGroup);
    laygroup2->setSpacing(KDialog::spacingHint());

    alGroup->setWhatsThis(i18n("Turn on the auto-login feature."
                               " This applies only to KDM's graphical login."
                               " Think twice before enabling this!"));
    connect(alGroup, SIGNAL(toggled(bool)), SIGNAL(changed()));

    userlb = new KComboBox(alGroup);

    QLabel *u_label = new QLabel(i18n("Use&r:"), alGroup);
    u_label->setBuddy(userlb);
    QHBoxLayout *hlpl1 = new QHBoxLayout();
    laygroup2->addItem(hlpl1);
    hlpl1->setSpacing(KDialog::spacingHint());
    hlpl1->addWidget(u_label);
    hlpl1->addWidget(userlb);
    hlpl1->addStretch(1);
    connect(userlb, SIGNAL(highlighted(int)), SIGNAL(changed()));
    wtstr = i18n("Select the user to be logged in automatically.");
    u_label->setWhatsThis(wtstr);
    userlb->setWhatsThis(wtstr);
    autoLockCheck = new QCheckBox(i18n("Loc&k session"), alGroup);
    laygroup2->addWidget(autoLockCheck);
    connect(autoLockCheck, SIGNAL(toggled(bool)), SIGNAL(changed()));
    autoLockCheck->setWhatsThis(i18n(
        "The automatically started session "
        "will be locked immediately (provided it is a KDE session). This can "
        "be used to obtain a super-fast login restricted to one user."));

    puGroup = new QGroupBox(i18nc("@title:group", "Preselect User"), this);

    puGroup->setSizePolicy(vpref);

    npRadio = new QRadioButton(i18nc("@option:radio preselected user", "&None"), puGroup);
    ppRadio = new QRadioButton(i18nc("@option:radio preselected user", "Prev&ious"), puGroup);
    ppRadio->setWhatsThis(i18n(
        "Preselect the user that logged in previously. "
        "Use this if this computer is usually used several consecutive times by one user."));
    spRadio = new QRadioButton(i18nc("@option:radio preselected user", "Specifi&ed:"), puGroup);
    spRadio->setWhatsThis(i18n(
        "Preselect the user specified in the combo box to the right. "
        "Use this if this computer is predominantly used by a certain user."));
    QButtonGroup *buttonGroup = new QButtonGroup(puGroup);
    connect(buttonGroup, SIGNAL(buttonClicked(int)), SLOT(slotPresChanged()));
    connect(buttonGroup, SIGNAL(buttonClicked(int)), SIGNAL(changed()));
    buttonGroup->addButton(npRadio);
    buttonGroup->addButton(ppRadio);
    buttonGroup->addButton(spRadio);
    QVBoxLayout *laygroup5 = new QVBoxLayout(puGroup);
    laygroup5->setSpacing(KDialog::spacingHint());
    laygroup5->addWidget(npRadio);
    laygroup5->addWidget(ppRadio);

    puserlb = new KComboBox(true, puGroup);

    connect(puserlb, SIGNAL(editTextChanged(QString)), SIGNAL(changed()));
    wtstr = i18n(
        "Select the user to be preselected for login. "
        "This box is editable, so you can specify an arbitrary non-existent "
        "user to mislead possible attackers.");
    puserlb->setWhatsThis(wtstr);
    QBoxLayout *hlpl = new QHBoxLayout();
    laygroup5->addItem(hlpl);
    hlpl->setSpacing(KDialog::spacingHint());
    hlpl->setMargin(0);
    hlpl->addWidget(spRadio);
    hlpl->addWidget(puserlb);
    hlpl->addStretch(1);
    // This is needed before the abuse below to ensure the combo is enabled in time
    connect(spRadio, SIGNAL(clicked(bool)), SLOT(slotPresChanged()));
    // Abuse the radio button text as a label for the combo
    connect(spRadio, SIGNAL(clicked(bool)), puserlb, SLOT(setFocus()));
    cbjumppw = new QCheckBox(i18nc("@option:check action", "Focus pass&word"), puGroup);
    laygroup5->addWidget(cbjumppw);
    cbjumppw->setWhatsThis(i18n(
        "When this option is on, KDM will place the cursor "
        "in the password field instead of the user field after preselecting a user. "
        "Use this to save one key press per login, if the preselection usually "
        "does not need to be changed."));
    connect(cbjumppw, SIGNAL(toggled(bool)), SIGNAL(changed()));

    npGroup = new QGroupBox(i18n("Enable Password-&Less Logins"), this);
    QVBoxLayout *laygroup3 = new QVBoxLayout(npGroup);
    laygroup3->setSpacing(KDialog::spacingHint());

    npGroup->setCheckable(true);

    npGroup->setWhatsThis(i18n(
        "When this option is checked, the checked users from "
        "the list below will be allowed to log in without entering their "
        "password. This applies only to KDM's graphical login. "
        "Think twice before enabling this!"));

    connect(npGroup, SIGNAL(toggled(bool)), SIGNAL(changed()));

    QLabel *pl_label = new QLabel(i18n("No password re&quired for:"), npGroup);
    laygroup3->addWidget(pl_label);
    npuserlv = new QListWidget(npGroup);
    laygroup3->addWidget(npuserlv);
    pl_label->setBuddy(npuserlv);
    npuserlv->setWhatsThis(i18n(
        "Check all users you want to allow a password-less login for. "
        "Entries denoted with '@' are user groups. Checking a group is like "
        "checking all users in that group."));

    btGroup = new QGroupBox(i18nc("@title:group", "Miscellaneous"), this);
    QVBoxLayout *laygroup4 = new QVBoxLayout(btGroup);
    laygroup4->setSpacing(KDialog::spacingHint());

    cbarlen = new QCheckBox(i18n("Automatically log in again after &X server crash"), btGroup);
    cbarlen->setWhatsThis(i18n(
        "When this option is on, a user will be "
        "logged in again automatically when their session is interrupted by an "
        "X server crash; note that this can open a security hole: if you use "
        "a screen locker than KDE's integrated one, this will make "
        "circumventing a password-secured screen lock possible."));
    //TODO a screen locker _other_ than
    laygroup4->addWidget(cbarlen);
    connect(cbarlen, SIGNAL(toggled(bool)), SIGNAL(changed()));

    QGridLayout *main = new QGridLayout(this);
    main->setSpacing(10);
    main->addWidget(paranoia, 0, 0);
    main->addWidget(alGroup, 1, 0);
    main->addWidget(puGroup, 2, 0);
    main->addWidget(npGroup, 0, 1, 4, 1);
    main->addWidget(btGroup, 4, 0, 1, 2);
    main->setColumnStretch(0, 1);
    main->setColumnStretch(1, 2);
    main->setRowStretch(3, 1);

    connect(userlb, SIGNAL(activated(QString)),
            SLOT(slotSetAutoUser(QString)));
    connect(puserlb, SIGNAL(editTextChanged(QString)),
            SLOT(slotSetPreselUser(QString)));
    connect(npuserlv, SIGNAL(itemClicked(QListWidgetItem*)),
            SLOT(slotUpdateNoPassUser(QListWidgetItem*)));

}
コード例 #21
0
void WindowMaterialGasInspectorView::createLayout()
{
  QWidget* hiddenWidget = new QWidget();
  this->stackedWidget()->addWidget(hiddenWidget);

  QWidget* visibleWidget = new QWidget();
  this->stackedWidget()->addWidget(visibleWidget);

  QGridLayout* mainGridLayout = new QGridLayout();
  mainGridLayout->setContentsMargins(7, 7, 7, 7);
  mainGridLayout->setSpacing(14);
  visibleWidget->setLayout(mainGridLayout);

  int row = mainGridLayout->rowCount();

  QLabel * label = nullptr;

  // Name

  label = new QLabel("Name: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label, row, 0);

  ++row;

  m_nameEdit = new OSLineEdit();
  mainGridLayout->addWidget(m_nameEdit, row, 0, 1, 3);

  ++row;

  // Standards Information

  m_standardsInformationWidget = new StandardsInformationMaterialWidget(m_isIP, mainGridLayout, row);

  ++row;

  // Gas Type

  label = new QLabel("Gas Type: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_gasType = new OSComboBox();
  m_gasType->addItem("Air");
  m_gasType->addItem("Argon");
  m_gasType->addItem("Krypton");
  m_gasType->addItem("Xenon");
  m_gasType->addItem("Custom");
  mainGridLayout->addWidget(m_gasType,row++,0,1,3);

  // Thickness

  label = new QLabel("Thickness: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_thickness = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_thickness, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_thickness,row++,0,1,3);

  // Conductivity Coefficient A

  label = new QLabel("Conductivity Coefficient A: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivityCoefficientA = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_conductivityCoefficientA, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivityCoefficientA,row++,0,1,3);

  // Conductivity Coefficient B

  label = new QLabel("Conductivity Coefficient B: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_conductivityCoefficientB = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_conductivityCoefficientB, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_conductivityCoefficientB,row++,0,1,3);

  // Viscosity Coefficient A

  label = new QLabel("Viscosity Coefficient A: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_viscosityCoefficientA = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_viscosityCoefficientA, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_viscosityCoefficientA,row++,0,1,3);

  // Viscosity Coefficient B

  label = new QLabel("Viscosity Coefficient B: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_viscosityCoefficientB = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_viscosityCoefficientB, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_viscosityCoefficientB,row++,0,1,3);

  // Specific Heat Coefficient A

  label = new QLabel("Specific Heat Coefficient A: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_specificHeatCoefficientA = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_specificHeatCoefficientA, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_specificHeatCoefficientA,row++,0,1,3);

  // Specific Heat Coefficient B

  label = new QLabel("Specific Heat Coefficient B: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_specificHeatCoefficientB = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_specificHeatCoefficientB, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_specificHeatCoefficientB,row++,0,1,3);

  // Molecular Weight

  label = new QLabel("Molecular Weight: ");
  label->setObjectName("H2");
  mainGridLayout->addWidget(label,row++,0);

  m_molecularWeight = new OSQuantityEdit(m_isIP);
  connect(this, &WindowMaterialGasInspectorView::toggleUnitsClicked, m_molecularWeight, &OSQuantityEdit::onUnitSystemChange);
  mainGridLayout->addWidget(m_molecularWeight,row++,0,1,3);

  // Stretch

  mainGridLayout->setRowStretch(100,100);

  mainGridLayout->setColumnStretch(100,100);
}
コード例 #22
0
ファイル: ChannelsJoinDialog.cpp プロジェクト: Cizzle/KVIrc
ChannelsJoinDialog::ChannelsJoinDialog(const char * name)
    : QDialog(g_pMainWindow)
{
	setObjectName(name);
	setWindowTitle(__tr2qs("Join Channels - KVIrc"));
	setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Channel)));

	m_pConsole = nullptr;

	QGridLayout * g = new QGridLayout(this);

	m_pTreeWidget = new ChannelsJoinDialogTreeWidget(this);
	m_pTreeWidget->setHeaderLabel(__tr2qs("Channel"));
	m_pTreeWidget->setRootIsDecorated(true);
	m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
	g->addWidget(m_pTreeWidget, 0, 0, 1, 2);

	m_pGroupBox = new KviTalGroupBox(Qt::Horizontal, __tr2qs("Channel"), this);
	QString szMsg = __tr2qs("Name");
	szMsg.append(":");

	new QLabel(szMsg, m_pGroupBox);

	m_pChannelEdit = new QLineEdit(m_pGroupBox);
	connect(m_pChannelEdit, SIGNAL(returnPressed()), this, SLOT(editReturnPressed()));
	connect(m_pChannelEdit, SIGNAL(textChanged(const QString &)), this, SLOT(editTextChanged(const QString &)));

	szMsg = __tr2qs("Password");
	szMsg.append(":");

	new QLabel(szMsg, m_pGroupBox);

	m_pPass = new QLineEdit(m_pGroupBox);
	m_pPass->setEchoMode(QLineEdit::Password);

	g->addWidget(m_pGroupBox, 1, 0, 1, 2);

	KviTalHBox * hb = new KviTalHBox(this);
	hb->setSpacing(4);

	g->addWidget(hb, 2, 0, 1, 2);

	m_pJoinButton = new QPushButton(__tr2qs("&Join"), hb);
	// Join on return pressed
	m_pJoinButton->setDefault(true);
	connect(m_pJoinButton, SIGNAL(clicked()), this, SLOT(joinClicked()));

	m_pRegButton = new QPushButton(__tr2qs("&Register"), hb);
	// Join on return pressed
	connect(m_pRegButton, SIGNAL(clicked()), this, SLOT(regClicked()));

	m_pClearButton = new QPushButton(__tr2qs("Clear Recent"), hb);
	connect(m_pClearButton, SIGNAL(clicked()), this, SLOT(clearClicked()));

	m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show this window after connecting"), this);
	m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc));
	g->addWidget(m_pShowAtStartupCheck, 3, 0);

	QPushButton * cancelButton = new QPushButton(__tr2qs("Close"), this);
	connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));

	g->addWidget(cancelButton, 3, 1, Qt::AlignRight);

	g->setRowStretch(0, 1);
	g->setColumnStretch(0, 1);

	fillListView();

	if(g_rectChannelsJoinGeometry.y() < 5)
		g_rectChannelsJoinGeometry.setY(5);

	resize(g_rectChannelsJoinGeometry.width(), g_rectChannelsJoinGeometry.height());

	QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow);
	move(rect.x() + ((rect.width() - g_rectChannelsJoinGeometry.width()) / 2), rect.y() + ((rect.height() - g_rectChannelsJoinGeometry.height()) / 2));

	enableJoin();
}
コード例 #23
0
KarbonCalligraphyOptionWidget::KarbonCalligraphyOptionWidget()
        : m_changingProfile(false)
{
    QGridLayout *layout = new QGridLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);

    m_comboBox = new KComboBox(this);
    layout->addWidget(m_comboBox, 0, 0);

    m_saveButton = new QToolButton(this);
    m_saveButton->setToolTip(i18n("Save profile as..."));
    m_saveButton->setIcon(koIcon("document-save-as"));
    layout->addWidget(m_saveButton, 0, 1);

    m_removeButton = new QToolButton(this);
    m_removeButton->setToolTip(i18n("Remove profile"));
    m_removeButton->setIcon(koIcon("list-remove"));
    layout->addWidget(m_removeButton, 0, 2);

    QGridLayout *detailsLayout = new QGridLayout();
    detailsLayout->setContentsMargins(0, 0, 0, 0);
    detailsLayout->setVerticalSpacing(0);

    m_usePath = new QCheckBox(i18n("&Follow selected path"), this);
    detailsLayout->addWidget(m_usePath, 0, 0, 1, 4);

    m_usePressure = new QCheckBox(i18n("Use tablet &pressure"), this);
    detailsLayout->addWidget(m_usePressure, 1, 0, 1, 4);

    QLabel *widthLabel = new QLabel(i18n("Width:"), this);
    widthLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_widthBox = new QDoubleSpinBox(this);
    m_widthBox->setRange(0.0, 999.0);
    widthLabel->setBuddy(m_widthBox);
    detailsLayout->addWidget(widthLabel, 2, 2);
    detailsLayout->addWidget(m_widthBox, 2, 3);

    QLabel *thinningLabel = new QLabel(i18n("Thinning:"), this);
    thinningLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_thinningBox = new QDoubleSpinBox(this);
    m_thinningBox->setRange(-1.0, 1.0);
    m_thinningBox->setSingleStep(0.1);
    thinningLabel->setBuddy(m_thinningBox);
    detailsLayout->addWidget(thinningLabel, 2, 0);
    detailsLayout->addWidget(m_thinningBox, 2, 1);

    m_useAngle = new QCheckBox(i18n("Use tablet &angle"), this);
    detailsLayout->addWidget(m_useAngle, 3, 0, 1, 4);

    QLabel *angleLabel = new QLabel(i18n("Angle:"), this);
    angleLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_angleBox = new QSpinBox(this);
    m_angleBox->setRange(0, 179);
    m_angleBox->setWrapping(true);
    angleLabel->setBuddy(m_angleBox);
    detailsLayout->addWidget(angleLabel, 4, 0);
    detailsLayout->addWidget(m_angleBox, 4, 1);

    QLabel *fixationLabel = new QLabel(i18n("Fixation:"), this);
    fixationLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_fixationBox = new QDoubleSpinBox(this);
    m_fixationBox->setRange(0.0, 1.0);
    m_fixationBox->setSingleStep(0.1);
    fixationLabel->setBuddy(m_fixationBox);
    detailsLayout->addWidget(fixationLabel, 5, 0);
    detailsLayout->addWidget(m_fixationBox, 5, 1);

    QLabel *capsLabel = new QLabel(i18n("Caps:"), this);
    capsLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_capsBox = new QDoubleSpinBox(this);
    m_capsBox->setRange(0.0, 2.0);
    m_capsBox->setSingleStep(0.03);
    capsLabel->setBuddy(m_capsBox);
    detailsLayout->addWidget(capsLabel, 5, 2);
    detailsLayout->addWidget(m_capsBox, 5, 3);

    QLabel *massLabel = new QLabel(i18n("Mass:"), this);
    massLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_massBox = new QDoubleSpinBox(this);
    m_massBox->setRange(0.0, 20.0);
    m_massBox->setDecimals(1);
    massLabel->setBuddy(m_massBox);
    detailsLayout->addWidget(massLabel, 6, 0);
    detailsLayout->addWidget(m_massBox, 6, 1);

    QLabel *dragLabel = new QLabel(i18n("Drag:"), this);
    dragLabel->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    m_dragBox = new QDoubleSpinBox(this);
    m_dragBox->setRange(0.0, 1.0);
    m_dragBox->setSingleStep(0.1);
    dragLabel->setBuddy(m_dragBox);
    detailsLayout->addWidget(dragLabel, 6, 2);
    detailsLayout->addWidget(m_dragBox, 6, 3);

    layout->addLayout(detailsLayout, 1, 0, 1, 3);
    layout->setRowStretch(2, 1);

    createConnections();
    addDefaultProfiles(); // if they are already added does nothing
    loadProfiles();
}
コード例 #24
0
void KoUniColorChooser::doSimpleLayout()
{
    m_HRB->setVisible( false );
    m_SRB->setVisible( false );
    m_VRB->setVisible( false );

    m_RRB->setVisible( false );
    m_GRB->setVisible( false );
    m_BRB->setVisible( false );

    m_LRB->setVisible( false );
    m_aRB->setVisible( false );
    m_bRB->setVisible( false );

    m_HLabel->setVisible( false );
    m_SLabel->setVisible( false );
    m_VLabel->setVisible( false );

    m_RLabel->setVisible( false );
    m_GLabel->setVisible( false );
    m_BLabel->setVisible( false );

    if ( cmykColorSpace() ) {
        m_CLabel->setVisible( false );
        m_MLabel->setVisible( false );
        m_YLabel->setVisible( false );
        m_KLabel->setVisible( false );

    }

    m_LLabel->setVisible( false );
    m_aLabel->setVisible( false );
    m_bLabel->setVisible( false );

    m_HIn->setVisible( false );
    m_SIn->setVisible( false );
    m_VIn->setVisible( false );

    m_RIn->setVisible( false );
    m_GIn->setVisible( false );
    m_BIn->setVisible( false );

    if ( cmykColorSpace() ) {
        m_CIn->setVisible( false );
        m_MIn->setVisible( false );
        m_YIn->setVisible( false );
        m_KIn->setVisible( false );
    }

    m_LIn->setVisible( false );
    m_aIn->setVisible( false );
    m_bIn->setVisible( false );

    if(m_showOpacitySlider)
    {
        m_opacityLabel->setVisible( false );
        m_opacityIn->setVisible( false );
    }

    QGridLayout * layout = new QGridLayout;

    layout->setSpacing( 5 );

    if( m_showOpacitySlider )
    {
        m_opacitySlider->setFixedSize( 137, 25 );
        m_opacitySlider->setToolTip( i18n( "Opacity" ) );
        m_colorSlider->setFixedSize( 25, 137 );

        layout->addWidget(m_xycolorselector, 0, 0, 1, 1 );
        layout->addWidget(m_colorSlider, 0, 1, 1, 1 );
        layout->addWidget(m_colorpatch, 1, 1, 1, 1, Qt::AlignLeft|Qt::AlignTop);
        layout->addWidget(m_opacitySlider, 1, 0, 1, 1);
    }
    else
    {
        m_colorSlider->setFixedSize( 25, 115 );
        layout->addWidget(m_xycolorselector, 0, 0, 2, 1 );
        layout->addWidget(m_colorSlider, 0, 1, 1, 1 );
        layout->addWidget(m_colorpatch, 1, 1, 1, 1, Qt::AlignLeft|Qt::AlignTop);
    }

    layout->setColumnStretch( 0, 1 );
    layout->setColumnStretch( 1, 0 );
    layout->setColumnStretch( 2, 1 );
    layout->setRowStretch( 0, 1 );
    layout->setRowStretch( 1, 0 );
    layout->setRowStretch( 2, 1 );

    setLayout( layout );
}
コード例 #25
0
RegExpTester::RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip,
   const QString& historyStartRegExpToolTip, const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip )
: QDialog( pParent)
{
   int line=0;
   setWindowTitle(i18n("Regular Expression Tester"));
   QGridLayout* pGrid = new QGridLayout( this );
   pGrid->setSpacing(5);
   pGrid->setMargin(5);

   QLabel* l = new QLabel(i18n("Auto merge regular expression:"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( autoMergeRegExpToolTip );
   m_pAutoMergeRegExpEdit = new QLineEdit(this);
   pGrid->addWidget(m_pAutoMergeRegExpEdit,line,1);
   connect( m_pAutoMergeRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("Example auto merge line:"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( i18n("To test auto merge, copy a line as used in your files.") );
   m_pAutoMergeExampleEdit = new QLineEdit(this);
   pGrid->addWidget(m_pAutoMergeExampleEdit,line,1);
   connect( m_pAutoMergeExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("Match result:"), this);
   pGrid->addWidget(l,line,0);
   m_pAutoMergeMatchResult = new QLineEdit(this);
   m_pAutoMergeMatchResult->setReadOnly(true);
   pGrid->addWidget(m_pAutoMergeMatchResult,line,1);
   ++line;

   pGrid->addItem( new QSpacerItem(100,20), line, 0 );
   pGrid->setRowStretch( line, 5);
   ++line;

   l = new QLabel(i18n("History start regular expression:"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( historyStartRegExpToolTip );
   m_pHistoryStartRegExpEdit = new QLineEdit(this);
   pGrid->addWidget(m_pHistoryStartRegExpEdit,line,1);
   connect( m_pHistoryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("Example history start line (with leading comment):"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( i18n("Copy a history start line as used in your files,\n"
                          "including the leading comment.") );
   m_pHistoryStartExampleEdit = new QLineEdit(this);
   pGrid->addWidget(m_pHistoryStartExampleEdit,line,1);
   connect( m_pHistoryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("Match result:"), this);
   pGrid->addWidget(l,line,0);
   m_pHistoryStartMatchResult = new QLineEdit(this);
   m_pHistoryStartMatchResult->setReadOnly(true);
   pGrid->addWidget(m_pHistoryStartMatchResult,line,1);
   ++line;

   pGrid->addItem( new QSpacerItem(100,20), line, 0 );
   pGrid->setRowStretch( line, 5);
   ++line;

   l = new QLabel(i18n("History entry start regular expression:"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( historyEntryStartRegExpToolTip );
   m_pHistoryEntryStartRegExpEdit = new QLineEdit(this);
   pGrid->addWidget(m_pHistoryEntryStartRegExpEdit,line,1);
   connect( m_pHistoryEntryStartRegExpEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("History sort key order:"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( historySortKeyOrderToolTip );
   m_pHistorySortKeyOrderEdit = new QLineEdit(this);
   pGrid->addWidget(m_pHistorySortKeyOrderEdit,line,1);
   connect( m_pHistorySortKeyOrderEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("Example history entry start line (without leading comment):"), this);
   pGrid->addWidget(l,line,0);
   l->setToolTip( i18n("Copy a history entry start line as used in your files,\n"
                          "but omit the leading comment.") );
   m_pHistoryEntryStartExampleEdit = new QLineEdit(this);
   pGrid->addWidget(m_pHistoryEntryStartExampleEdit,line,1);
   connect( m_pHistoryEntryStartExampleEdit, SIGNAL(textChanged(const QString&)), this, SLOT(slotRecalc()));
   ++line;

   l = new QLabel(i18n("Match result:"), this);
   pGrid->addWidget(l,line,0);
   m_pHistoryEntryStartMatchResult = new QLineEdit(this);
   m_pHistoryEntryStartMatchResult->setReadOnly(true);
   pGrid->addWidget(m_pHistoryEntryStartMatchResult,line,1);
   ++line;

   l = new QLabel(i18n("Sort key result:"), this);
   pGrid->addWidget(l,line,0);
   m_pHistorySortKeyResult = new QLineEdit(this);
   m_pHistorySortKeyResult->setReadOnly(true);
   pGrid->addWidget(m_pHistorySortKeyResult,line,1);
   ++line;

   QPushButton* pButton = new QPushButton(i18n("OK"), this);
   pGrid->addWidget(pButton,line,0);
   connect( pButton, SIGNAL(clicked()), this, SLOT(accept()));

   pButton = new QPushButton(i18n("Cancel"), this);
   pGrid->addWidget(pButton,line,1);
   connect( pButton, SIGNAL(clicked()), this, SLOT(reject()));

   resize( 800, sizeHint().height() );
}
コード例 #26
0
void EnrichmentDialog::initFramePage()
{
    framePage = new QWidget();

	QGroupBox *gb = new QGroupBox();
	QGridLayout *gl = new QGridLayout(gb);
    gl->addWidget(new QLabel( tr("Shape")), 0, 0);

	frameBox = new QComboBox();
	frameBox->addItem(tr("None"));
	if (d_widget_type == Ellipse)
		frameBox->addItem(tr("Line"));
	else {
		frameBox->addItem(tr("Rectangle"));
		frameBox->addItem(tr("Shadow"));
	}
	connect(frameBox, SIGNAL(activated(int)), this, SLOT(frameApplyTo()));
    gl->addWidget(frameBox, 0, 1);

    gl->addWidget(new QLabel(tr("Color")), 1, 0);
	frameColorBtn = new ColorButton();
	connect(frameColorBtn, SIGNAL(colorChanged()), this, SLOT(frameApplyTo()));
    gl->addWidget(frameColorBtn, 1, 1);

	gl->addWidget(new QLabel(tr( "Line Style" )), 2, 0);
	boxFrameLineStyle = new PenStyleBox();
	connect(boxFrameLineStyle, SIGNAL(activated(int)), this, SLOT(frameApplyTo()));
	gl->addWidget(boxFrameLineStyle, 2, 1);

	gl->setColumnStretch(1, 1);
	gl->addWidget(new QLabel(tr("Width")), 3, 0);
	boxFrameWidth = new DoubleSpinBox();
	if(d_widget_type == Ellipse){
		boxFrameWidth->setDecimals(2);
		boxFrameWidth->setLocale(((ApplicationWindow *)parent())->locale());
		boxFrameWidth->setSingleStep(0.1);
		boxFrameWidth->setRange(0.1, 100);
	} else {
		boxFrameWidth->setRange(1, 100);
		boxFrameWidth->setDecimals(0);
		boxFrameWidth->setSingleStep(1.0);
	}

	connect(boxFrameWidth, SIGNAL(valueChanged(double)), this, SLOT(frameApplyTo()));
	gl->addWidget(boxFrameWidth, 3, 1);
	gl->setRowStretch(4, 1);

	QVBoxLayout *vl = new QVBoxLayout();

	frameDefaultBtn = new QPushButton(tr("Set As &Default"));
	connect(frameDefaultBtn, SIGNAL(clicked()), this, SLOT(setFrameDefaultValues()));
	vl->addWidget(frameDefaultBtn);

	QLabel *l = new QLabel(tr("Apply t&o..."));
	vl->addWidget(l);

	frameApplyToBox = new QComboBox();
	frameApplyToBox->insertItem(tr("Object"));
	frameApplyToBox->insertItem(tr("Layer"));
    frameApplyToBox->insertItem(tr("Window"));
    frameApplyToBox->insertItem(tr("All Windows"));
	vl->addWidget(frameApplyToBox);
	vl->addStretch();
	l->setBuddy(frameApplyToBox);

	QHBoxLayout *hl = new QHBoxLayout(framePage);
	hl->addWidget(gb);
	hl->addLayout(vl);

	tabWidget->addTab(framePage, tr( "&Frame" ) );
}
コード例 #27
0
ファイル: HeartDock.cpp プロジェクト: behollis/muViewBranch
HeartDock::HeartDock(SCI::ThirdPersonCameraControls * pView, Data::Mesh::PointMesh * _pmesh, Data::Mesh::SolidMesh * _smesh, Data::FiberDirectionData *_fdata, QWidget *parent) : QDockWidget(parent), render_engine( pView ) {

    vp_widget = new QSplitter( Qt::Vertical );
    sp_widget = new QSplitter( Qt::Horizontal );

    QSplitter * sp0 = new QSplitter( Qt::Horizontal );
    QSplitter * sp1 = new QSplitter( Qt::Horizontal );

    pr_widget = new ParallelCoordinates( 0 );
    tb_widget = new QTabWidget( );

    sp0->addWidget( &(render_engine.re) );
    sp0->addWidget( &(render_engine.pca) );

    sp1->addWidget( &(render_engine.re2[0]) );
    sp1->addWidget( &(render_engine.re2[1]) );
    sp1->addWidget( &(render_engine.re2[2]) );

    vp_widget->addWidget( sp0 );
    vp_widget->addWidget( sp1 );
    vp_widget->addWidget( pr_widget );

    sp_widget->addWidget( vp_widget );
    sp_widget->addWidget( tb_widget );

    setWidget( sp_widget );

    QT::QControlWidget * drawBoxWidget    = new QT::QControlWidget( );
    {
        QRadioButton * draw0 = drawBoxWidget->addRadioButton( tr("Points")           );
        QRadioButton * draw1 = drawBoxWidget->addRadioButton( tr("Network")          );
        QRadioButton * draw2 = drawBoxWidget->addRadioButton( tr("Volume Rendering") );
        QRadioButton * draw3 = drawBoxWidget->addRadioButton( tr("Isosurfacing")     );
        QRadioButton * draw4 = drawBoxWidget->addRadioButton( tr("Distance Field")   );

        draw0->setChecked(true);

        connect( draw0, SIGNAL(clicked()), &(render_engine), SLOT(setDrawModePoints()) );
        connect( draw1, SIGNAL(clicked()), &(render_engine), SLOT(setDrawModeNetwork()) );
        connect( draw2, SIGNAL(clicked()), &(render_engine), SLOT(setDrawModeVolumeRendering()) );
        connect( draw3, SIGNAL(clicked()), &(render_engine), SLOT(setDrawModeIsosurfacing()) );
        connect( draw4, SIGNAL(clicked()), &(render_engine), SLOT(setDrawModeDistanceField()) );
    }

    QWidget   * colorBoxWidget    = new QWidget( );
    {
        QRadioButton * color0 = new QRadioButton( tr("Dimension Value") );
        QRadioButton * color7 = new QRadioButton( tr("Min Value") );
        QRadioButton * color1 = new QRadioButton( tr("Mean Value") );
        QRadioButton * color8 = new QRadioButton( tr("Max Value") );
        QRadioButton * color2 = new QRadioButton( tr("St Dev") );
        QRadioButton * color3 = new QRadioButton( tr("Clustering") );
        QRadioButton * color4 = new QRadioButton( tr("Isovalue") );
        QRadioButton * color5 = new QRadioButton( tr("PCA Painting") );
        QRadioButton * color6 = new QRadioButton( tr("Fiber Direction") );
        color0->setChecked(true);

        QLabel * dimension_label = new QLabel(tr("Dimension"));
        QSpinBox * dimension_spinner = new QSpinBox( );
        dimension_spinner->setRange(0,40);
        dimension_spinner->setValue(0);

        QLabel * cluster_count_label     = new QLabel(tr("Clusters"));
        QSpinBox * cluster_count_spinner = new QSpinBox( );
        cluster_count_spinner->setRange(2,40);
        cluster_count_spinner->setValue( 12 );

        QT::QControlWidget * cluster_type = new QT::QControlWidget( );
        {
            QRadioButton * ct0 = cluster_type->addRadioButton( tr("L2 Norm") );
            QRadioButton * ct1 = cluster_type->addRadioButton( tr("Pearson Correlation") );
            QRadioButton * ct2 = cluster_type->addRadioButton( tr("Histogram Difference") );
            ct0->setChecked( true );
            connect (ct0, SIGNAL(clicked()), &(render_engine), SLOT(setClusterTypeL2Norm()) );
            connect (ct1, SIGNAL(clicked()), &(render_engine), SLOT(setClusterTypePearson()) );
            connect (ct2, SIGNAL(clicked()), &(render_engine), SLOT(setClusterTypeHistogram()) );
        }

        QLabel * cluster_iteration_label     = new QLabel(tr("Iterations"));
        QSpinBox * cluster_iteration_spinner = new QSpinBox( );
        cluster_iteration_spinner->setRange(1,40);
        cluster_iteration_spinner->setValue( 5 );

        QCheckBox * cluster_histogram    = new QCheckBox( tr("Histogram") );
        cluster_histogram->setChecked( true );

        QPushButton * cluster_recalculate   = new QPushButton( tr("Recalculate") );

        QPushButton * pca_sel_color         = new QPushButton( tr("PCA: Select Paint Color") );

        QLabel   * pca_dim0_label   = new QLabel(tr("PCA X Dimension"));
        QSpinBox * pca_dim0_spinner = new QSpinBox( );
        pca_dim0_spinner->setRange(0,100);
        pca_dim0_spinner->setValue( 0 );

        QLabel   * pca_dim1_label   = new QLabel(tr("PCA Y Dimension"));
        QSpinBox * pca_dim1_spinner = new QSpinBox( );
        pca_dim1_spinner->setRange(0,100);
        pca_dim1_spinner->setValue( 1 );

        connect( color0,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeDimension()) );
        connect( color1,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeMedian()) );
        connect( color2,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeStDev()) );
        connect( color3,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeCluster()) );
        connect( color4,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeIsovalue()) );
        connect( color5,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModePCA()) );
        connect( color6,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeFibers()) );
        connect( color7,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeMin()) );
        connect( color8,                    SIGNAL(clicked()),            &(render_engine), SLOT(setColorModeMax()) );

        connect( pca_sel_color,             SIGNAL(clicked()),            &(render_engine.pca), SLOT(selectPaintColor()) );

        connect( dimension_spinner,         SIGNAL(valueChanged(int)),    &(render_engine), SLOT(setDimension(int)) );

        connect( cluster_count_spinner,     SIGNAL(valueChanged(int)),    &(render_engine), SLOT(setClusterCount(int)) );
        connect( cluster_iteration_spinner, SIGNAL(valueChanged(int)),    &(render_engine), SLOT(setClusterIterations(int)) );
        connect( cluster_recalculate,       SIGNAL(clicked()),            &(render_engine), SLOT(setClusterRecalculate()) );
        connect( cluster_histogram,         SIGNAL(clicked(bool)),        &(render_engine), SLOT(setClusterHistogram(bool)) );

        connect( color0,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color1,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color2,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color3,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color4,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color5,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color6,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color7,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( color8,                    SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );

        connect( dimension_spinner,         SIGNAL(valueChanged(int)),    pr_widget, SLOT(Reset()) );

        connect( cluster_count_spinner,     SIGNAL(valueChanged(int)),    pr_widget, SLOT(Reset()) );
        connect( cluster_iteration_spinner, SIGNAL(valueChanged(int)),    pr_widget, SLOT(Reset()) );
        connect( cluster_recalculate,       SIGNAL(clicked()),            pr_widget, SLOT(Reset()) );
        connect( cluster_histogram,         SIGNAL(clicked(bool)),        pr_widget, SLOT(Reset()) );

        connect( pca_dim0_spinner, SIGNAL(valueChanged(int)), &(render_engine.pca), SLOT(ModifyPCADim0(int)) );
        connect( pca_dim1_spinner, SIGNAL(valueChanged(int)), &(render_engine.pca), SLOT(ModifyPCADim1(int)) );

        int row = 0;
        QGridLayout * colorLayout = new QGridLayout( );
        colorLayout->addWidget( color0,                     row++, 0, 1, 3 );
        colorLayout->addWidget( dimension_label,            row,   1, 1, 1 );
        colorLayout->addWidget( dimension_spinner,          row++, 2, 1, 1 );
        colorLayout->addWidget( color1,                     row++, 0, 1, 3 );
        colorLayout->addWidget( color7,                     row++, 0, 1, 3 );
        colorLayout->addWidget( color8,                     row++, 0, 1, 3 );
        colorLayout->addWidget( color2,                     row++, 0, 1, 3 );
        colorLayout->addWidget( color3,                     row++, 0, 1, 3 );
        colorLayout->addWidget( cluster_histogram,          row++, 1, 1, 2 );
        colorLayout->addWidget( cluster_count_label,        row,   1, 1, 1 );
        colorLayout->addWidget( cluster_count_spinner,      row++, 2, 1, 1 );
        colorLayout->addWidget( cluster_type,               row++, 1, 1, 1 );
        colorLayout->addWidget( cluster_iteration_label,    row,   1, 1, 1 );
        colorLayout->addWidget( cluster_iteration_spinner,  row++, 2, 1, 1 );
        colorLayout->addWidget( cluster_recalculate,        row++, 1, 1, 2 );
        colorLayout->addWidget( color4,                     row++, 0, 1, 3 );
        colorLayout->addWidget( color5,                     row++, 0, 1, 3 );
        colorLayout->addWidget( pca_sel_color,              row++, 0, 1, 3 );
        colorLayout->addWidget( color6,                     row++, 0, 1, 3 );
        colorLayout->addWidget( pca_dim0_label,             row,   1, 1, 1 );
        colorLayout->addWidget( pca_dim0_spinner,           row++, 2, 1, 1 );
        colorLayout->addWidget( pca_dim1_label,             row,   1, 1, 1 );
        colorLayout->addWidget( pca_dim1_spinner,           row++, 2, 1, 1 );

        colorLayout->setRowStretch( row, 1 );

        colorBoxWidget->setLayout( colorLayout );
    }



    QWidget   * isoBoxWidget    = new QWidget( );
    {

        QCheckBox * show_d_iso    = new QCheckBox( tr("Dimension Isosurface") );
        QCheckBox * show_min_iso  = new QCheckBox( tr("Minimum Isosurface") );
        QCheckBox * show_mean_iso = new QCheckBox( tr("Mean Isosurface") );
        QCheckBox * show_max_iso  = new QCheckBox( tr("Maximum Isosurface") );
        QLabel * iso_label        = new QLabel(tr("Iso value"));
        QDoubleSpinBox * iso_spinner = new QDoubleSpinBox( );
        iso_spinner->setRange(-15,15);
        iso_spinner->setValue(0);
        QPushButton * volume       = new QPushButton( tr("Volume") );

        connect( show_d_iso,    SIGNAL(clicked(bool)),        &(render_engine), SLOT(setDimIsosurface(bool)) );
        connect( show_min_iso,  SIGNAL(clicked(bool)),        &(render_engine), SLOT(setMinIsosurface(bool)) );
        connect( show_mean_iso, SIGNAL(clicked(bool)),        &(render_engine), SLOT(setMeanIsosurface(bool)) );
        connect( show_max_iso,  SIGNAL(clicked(bool)),        &(render_engine), SLOT(setMaxIsosurface(bool)) );
        connect( iso_spinner,   SIGNAL(valueChanged(double)), &(render_engine), SLOT(setIsovalue(double)) );
        connect( iso_spinner,   SIGNAL(valueChanged(double)), pr_widget, SLOT(Reset()) );
        connect( volume,        SIGNAL(clicked()), &(render_engine), SLOT(calculateSubVolume()) );


        int row = 0;
        QGridLayout * isoLayout = new QGridLayout( );
        isoLayout->addWidget( show_d_iso,                 row++, 1, 1, 3 );
        isoLayout->addWidget( show_min_iso,               row++, 1, 1, 3 );
        isoLayout->addWidget( show_mean_iso,              row++, 1, 1, 3 );
        isoLayout->addWidget( show_max_iso,               row++, 1, 1, 3 );
        isoLayout->addWidget( iso_label,                  row,   1, 1, 1 );
        isoLayout->addWidget( iso_spinner,                row++, 2, 1, 1 );
        isoLayout->addWidget( volume,                     row++, 1, 1, 3 );
        isoLayout->setRowStretch( row, 1 );

        isoBoxWidget->setLayout( isoLayout );
    }


    QWidget   * clipBoxWidget    = new QWidget( );
    {
        QCheckBox * e_clipX    = new QCheckBox( tr("Clip X") );
        QCheckBox * e_clipY    = new QCheckBox( tr("Clip Y") );
        QCheckBox * e_clipZ    = new QCheckBox( tr("Clip Z") );
        QCheckBox * f_clipX    = new QCheckBox( tr("flip") );
        QCheckBox * f_clipY    = new QCheckBox( tr("flip") );
        QCheckBox * f_clipZ    = new QCheckBox( tr("flip") );
        QDoubleSpinBox * v_clipX = new QDoubleSpinBox( );
        QDoubleSpinBox * v_clipY = new QDoubleSpinBox( );
        QDoubleSpinBox * v_clipZ = new QDoubleSpinBox( );
        v_clipX->setRange(-15,15);
        v_clipX->setSingleStep(0.05f);
        v_clipX->setValue(0);
        v_clipY->setRange(-15,15);
        v_clipY->setSingleStep(0.05f);
        v_clipY->setValue(0);
        v_clipZ->setRange(-15,15);
        v_clipZ->setValue(0);
        v_clipZ->setSingleStep(0.05f);

        connect( e_clipX, SIGNAL(clicked(bool)), &(render_engine), SLOT(setClipXEnable(bool)) );
        connect( e_clipY, SIGNAL(clicked(bool)), &(render_engine), SLOT(setClipYEnable(bool)) );
        connect( e_clipZ, SIGNAL(clicked(bool)), &(render_engine), SLOT(setClipZEnable(bool)) );

        connect( v_clipX, SIGNAL(valueChanged(double)), &(render_engine), SLOT(setClipXVal(double)) );
        connect( v_clipY, SIGNAL(valueChanged(double)), &(render_engine), SLOT(setClipYVal(double)) );
        connect( v_clipZ, SIGNAL(valueChanged(double)), &(render_engine), SLOT(setClipZVal(double)) );

        connect( f_clipX, SIGNAL(clicked()), &(render_engine), SLOT(setClipXFlip()) );
        connect( f_clipY, SIGNAL(clicked()), &(render_engine), SLOT(setClipYFlip()) );
        connect( f_clipZ, SIGNAL(clicked()), &(render_engine), SLOT(setClipZFlip()) );

        int row = 0;
        QGridLayout * clipLayout = new QGridLayout( );
        clipLayout->addWidget( e_clipX, row,   0, 1, 1 );
        clipLayout->addWidget( v_clipX, row,   1, 1, 1 );
        clipLayout->addWidget( f_clipX, row++, 2, 1, 1 );
        clipLayout->addWidget( e_clipY, row,   0, 1, 1 );
        clipLayout->addWidget( v_clipY, row,   1, 1, 1 );
        clipLayout->addWidget( f_clipY, row++, 2, 1, 1 );
        clipLayout->addWidget( e_clipZ, row,   0, 1, 1 );
        clipLayout->addWidget( v_clipZ, row,   1, 1, 1 );
        clipLayout->addWidget( f_clipZ, row++, 2, 1, 1 );
        clipLayout->setRowStretch( row, 1 );

        clipBoxWidget->setLayout( clipLayout );
    }


    tb_widget->setTabPosition( tb_widget->West );
    tb_widget->addTab(  drawBoxWidget, tr( "Draw Mode" ) );
    tb_widget->addTab( colorBoxWidget, tr( "Color Mode" ) );
    tb_widget->addTab(   isoBoxWidget, tr( "Isosurfacing" ) );
    tb_widget->addTab(  clipBoxWidget, tr( "Clip Planes" ) );


    dfield = 0;
    pdata  = 0;
    pmesh  = _pmesh;
    tdata  = _smesh;
    fdata  = _fdata;

    render_engine.SetParallelCoordinateView( pr_widget );
    render_engine.SetData( pdata, pmesh, tdata );
    render_engine.SetFiberData( fdata );

}
コード例 #28
0
void EnrichmentDialog::initPatternPage()
{
	patternPage = new QWidget();

	QGroupBox *gb = new QGroupBox();
	QGridLayout *gl = new QGridLayout(gb);
    gl->addWidget(new QLabel( tr("Fill Color")), 0, 0);

	backgroundColorBtn = new ColorButton();
	connect(backgroundColorBtn, SIGNAL(colorChanged()), this, SLOT(patternApplyTo()));
    gl->addWidget(backgroundColorBtn, 0, 1);

	gl->addWidget(new QLabel(tr("Opacity")), 1, 0);
	boxTransparency = new QSpinBox();
	boxTransparency->setRange(0, 255);
    boxTransparency->setSingleStep(5);
	boxTransparency->setWrapping(true);
    boxTransparency->setSpecialValueText(tr("Transparent"));
	connect(boxTransparency, SIGNAL(valueChanged(int)), this, SLOT(patternApplyTo()));
	gl->addWidget(boxTransparency, 1, 1);

	gl->addWidget(new QLabel(tr("Pattern")), 2, 0);
	patternBox = new PatternBox();
	connect(patternBox, SIGNAL(activated(int)), this, SLOT(patternApplyTo()));
	gl->addWidget(patternBox, 2, 1);

	gl->addWidget(new QLabel(tr("Pattern Color")), 3, 0);
	patternColorBtn = new ColorButton();
	connect(patternColorBtn, SIGNAL(colorChanged()), this, SLOT(patternApplyTo()));
	gl->addWidget(patternColorBtn, 3, 1);

	useFrameColorBox = new QCheckBox(tr("Use &Frame Color"));
	connect(useFrameColorBox, SIGNAL(toggled(bool)), this, SLOT(patternApplyTo()));
	connect(useFrameColorBox, SIGNAL(toggled(bool)), patternColorBtn, SLOT(setDisabled(bool)));
	gl->addWidget(useFrameColorBox, 3, 2);

	gl->setColumnStretch(1, 1);
	gl->setRowStretch(4, 1);

	QVBoxLayout *vl = new QVBoxLayout();
	rectangleDefaultBtn = new QPushButton(tr("Set As &Default"));
	connect(rectangleDefaultBtn, SIGNAL(clicked()), this, SLOT(setRectangleDefaultValues()));
	vl->addWidget(rectangleDefaultBtn);

	QLabel *l = new QLabel(tr("Apply t&o..."));
	vl->addWidget(l);

	patternApplyToBox = new QComboBox();
	patternApplyToBox->insertItem(tr("Object"));
	patternApplyToBox->insertItem(tr("Layer"));
    patternApplyToBox->insertItem(tr("Window"));
    patternApplyToBox->insertItem(tr("All Windows"));
	vl->addWidget(patternApplyToBox);
	vl->addStretch();
	l->setBuddy(patternApplyToBox);

	QHBoxLayout *hl = new QHBoxLayout(patternPage);
	hl->addWidget(gb);
	hl->addLayout(vl);

	tabWidget->addTab(patternPage, tr("Fill &Pattern"));
}
コード例 #29
0
ファイル: box.cpp プロジェクト: Ozma1992/pokemon-online
TB_PokemonDetail::TB_PokemonDetail()
{
    setFixedSize(215,225);

    QGridLayout *gl = new QGridLayout(this);
    gl->setMargin(3);

    /* Nick layout */
    QGridLayout *nicklayout = new QGridLayout();
    nicklayout->setSpacing(0);
    nicklayout->setMargin(0);
    gl->addLayout(nicklayout, 0,0);

    QLabel *whitePokeball = new QLabel();
    whitePokeball->setPixmap(Theme::WhiteBall());
    nicklayout->addWidget(whitePokeball,0,0);
    nicklayout->addWidget(m_name = new QLabel(),0,1);
    nicklayout->addWidget(m_nick = new QLabel(),1,0,1,2);
    m_name->setObjectName("NormalText");
    m_nick->setObjectName("SmallText");

    /* Level/Gender layout */
    QGridLayout *lvlayout = new QGridLayout();
    lvlayout->setSpacing(0);
    lvlayout->setMargin(0);
    gl->addLayout(lvlayout, 0,1);

    lvlayout->addWidget(m_num = new QLabel(),0,0,1,2, Qt::AlignRight);
    lvlayout->addWidget(m_gender = new QLabel(),1,0,1,1, Qt::AlignLeft);
    lvlayout->addWidget(m_level = new QLabel(),1,1,1,1,Qt::AlignLeft);
    lvlayout->setColumnStretch(1,100);
    m_num->setObjectName("BigText");
    m_level->setObjectName("SmallText");

    /* Pokemon picture! */
    gl->addWidget(m_pic = new QLabel(),1,0);
    m_pic->setObjectName("PokemonPicture");

    /* Type / Nature / Item */
    QVBoxLayout *tnlayout = new QVBoxLayout();
    gl->addLayout(tnlayout,1,1);

    tnlayout->addStretch(100);
    QHBoxLayout *types = new QHBoxLayout();
    types->addWidget(m_type1 = new QLabel(),0,Qt::AlignLeft);
    types->addWidget(m_type2 = new QLabel(),100,Qt::AlignLeft);
    tnlayout->addLayout(types);
    tnlayout->addWidget(m_nature = new QLabel());
    m_nature->setObjectName("SmallText");
    QHBoxLayout *items = new QHBoxLayout();
    QLabel *item;
    items->addWidget(item = new QLabel(tr("Item: ")));
    items->addWidget(m_item=new QLabel(), 100, Qt::AlignLeft);
    tnlayout->addLayout(items);
    item->setObjectName("SmallText");
    tnlayout->addStretch(100);

    //Moves
    QGridLayout *moves = new QGridLayout();
    QLabel *lw;
    moves->addWidget(lw = new QLabel(tr("Moves:")),0,0,1,1,Qt::AlignLeft);
    for (int i = 0; i < 4; i++) {
        moves->addWidget(m_moves[i] = new QLabel(), 1+i,1,1,1,Qt::AlignLeft|Qt::AlignTop);
        m_moves[i]->setObjectName("SmallText");
    }
    lw->setObjectName("NormalText");
    moves->setColumnStretch(1,100);
    gl->addLayout(moves,2,0,1,2);

    gl->setRowStretch(2,200);
}
コード例 #30
0
void ToolOptionWidget::createUI()
{
    setMinimumWidth( 115 );

    QFrame* optionGroup = new QFrame();
    QGridLayout* pLayout = new QGridLayout();
    pLayout->setMargin( 8 );
    pLayout->setSpacing( 8 );

    QSettings settings( "Pencil", "Pencil" );

    mSizeSlider = new SpinSlider( tr( "Brush" ), SpinSlider::LOG, SpinSlider::INTEGER, 1, 200, this );
    mSizeSlider->setValue( settings.value( "brushWidth" ).toDouble() );
    mSizeSlider->setToolTip( tr( "Set Pen Width <br><b>[SHIFT]+drag</b><br>for quick adjustment" ) );

    mBrushSpinBox = new QSpinBox(this);
    mBrushSpinBox->setRange(1,200);
    mBrushSpinBox->setValue(settings.value( "brushWidth" ).toDouble() );

    mFeatherSlider = new SpinSlider( tr( "Feather" ), SpinSlider::LOG, SpinSlider::INTEGER, 2, 64, this );
    mFeatherSlider->setValue( settings.value( "brushFeather" ).toDouble() );
    mFeatherSlider->setToolTip( tr( "Set Pen Feather <br><b>[CTRL]+drag</b><br>for quick adjustment" ) );

    mFeatherSpinBox = new QSpinBox(this);
    mFeatherSpinBox->setRange(2,64);
    mFeatherSpinBox->setValue(settings.value( "brushFeather" ).toDouble() );

    mUseFeatherBox = new QCheckBox( tr( "Use Feather?" ) );
    mUseFeatherBox->setToolTip( tr( "Enable or disable feathering" ) );
    mUseFeatherBox->setFont( QFont( "Helvetica", 10 ) );
    mUseFeatherBox->setChecked( settings.value( "brushUseFeather" ).toBool() );

    mUseBezierBox = new QCheckBox( tr( "Bezier" ) );
    mUseBezierBox->setToolTip( tr( "Bezier curve fitting" ) );
    mUseBezierBox->setFont( QFont( "Helvetica", 10 ) );
    mUseBezierBox->setChecked( false );

    mUsePressureBox = new QCheckBox( tr( "Pressure" ) );
    mUsePressureBox->setToolTip( tr( "Size with pressure" ) );
    mUsePressureBox->setFont( QFont( "Helvetica", 10 ) );
    mUsePressureBox->setChecked( true );

    mMakeInvisibleBox = new QCheckBox( tr( "Invisible" ) );
    mMakeInvisibleBox->setToolTip( tr( "Make invisible" ) );
    mMakeInvisibleBox->setFont( QFont( "Helvetica", 10 ) );
    mMakeInvisibleBox->setChecked( false );

    mPreserveAlphaBox = new QCheckBox( tr( "Alpha" ) );
    mPreserveAlphaBox->setToolTip( tr( "Preserve Alpha" ) );
    mPreserveAlphaBox->setFont( QFont( "Helvetica", 10 ) );
    mPreserveAlphaBox->setChecked( false );

    pLayout->addWidget( mSizeSlider, 8, 0, 1, 2 );
    pLayout->addWidget( mBrushSpinBox, 8, 10, 1, 2);
    pLayout->addWidget( mFeatherSlider, 9, 0, 1, 2 );
    pLayout->addWidget( mFeatherSpinBox, 9, 10, 1, 2 );
    pLayout->addWidget( mUseBezierBox, 10, 0, 1, 2 );
    pLayout->addWidget( mUsePressureBox, 11, 0, 1, 2 );
    pLayout->addWidget( mPreserveAlphaBox, 12, 0, 1, 2 );
    pLayout->addWidget( mUseFeatherBox, 13, 0, 1, 2 );
    pLayout->addWidget( mMakeInvisibleBox, 14, 0, 1, 2 );

    pLayout->setRowStretch( 15, 1 );

    optionGroup->setLayout( pLayout );

    setWidget( optionGroup );
}