Example #1
0
File: gui.cpp Project: Glyth/xoreos
void GUI::createWidget(WidgetContext &ctx) {
	// ...BioWare...
	fixWidgetType(ctx.tag, ctx.type);

	if      (ctx.type == kWidgetTypeFrame)
		ctx.widget = new WidgetFrame(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypeCloseButton)
		ctx.widget = new WidgetClose(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypeCheckBox)
		ctx.widget = new WidgetCheckBox(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypePanel)
		ctx.widget = new WidgetPanel(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypeLabel)
		ctx.widget = new WidgetLabel(*this, ctx.tag, ctx.font, ctx.text);
	else if (ctx.type == kWidgetTypeSlider)
		ctx.widget = new WidgetSlider(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypeEditBox)
		ctx.widget = new WidgetEditBox(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypeButton)
		ctx.widget = new WidgetButton(*this, ctx.tag, ctx.model);
	else if (ctx.type == kWidgetTypeListBox)
		ctx.widget = new WidgetListBox(*this, ctx.tag, ctx.model);
	else
		throw Common::Exception("No such widget type %d", ctx.type);

	ModelWidget *widgetModel = dynamic_cast<ModelWidget *>(ctx.widget);
	if (widgetModel)
		initWidget(ctx, *widgetModel);

	TextWidget  *widgetText  = dynamic_cast<TextWidget  *>(ctx.widget);
	if (widgetText)
		initWidget(ctx, *widgetText);
}
Example #2
0
SliderSpin::SliderSpin(QWidget* parent,const char* name,Qt::WFlags f,bool allowLines)
           :Q3VBox(parent,name,f)
#else
SliderSpin::SliderSpin(QWidget* parent,const char* name,Qt::WFlags f,bool allowLines)
           :Q3VBox(parent,name,f,allowLines)
#endif
{
  initWidget();
}

#ifdef USE_QT3
SliderSpin::SliderSpin(int minval,int maxval,int val,QString title,QWidget* parent,
                       const char* name,Qt::WFlags f,bool allowLines)
           :Q3VBox(parent,name,f)
#else
SliderSpin::SliderSpin(int minval,int maxval,int val,QString title,QWidget* parent,
                       const char* name,Qt::WFlags f,bool allowLines)
           :Q3VBox(parent,name,f,allowLines)
#endif
{
  initWidget();
  setTitle(title);
  setRange(minval,maxval);
  setValue(val);
}
ReleaseDialog::ReleaseDialog(QWidget *parent)
    : DropShadowWidget(parent)
{
    initWidget();
    initWidgetValue();

    setTitle("发布版本");
    calendarStart->setHidden(true);
    calendarEnd->setHidden(true);

    currentDate = QDateTime::currentDateTime();
    QDateTime defaultS = currentDate.addDays(-1);
    start_time->setDateTime(defaultS);
    end_time->setDateTime(currentDate);

    lineedit_start->setHidden(true);
    lineedit_end->setHidden(true);


    connect(pb_close, &QPushButton::clicked, this, &ReleaseDialog::close);
    connect(pushbutton_start, &QPushButton::clicked, this, &ReleaseDialog::calendar_start_clicked);
    connect(pushbutton_end, &QPushButton::clicked, this, &ReleaseDialog::calendar_end_clicked);
    connect(calendarStart, &QCalendarWidget::selectionChanged, this, &ReleaseDialog::setStartDateTime);
    connect(calendarEnd, &QCalendarWidget::selectionChanged, this, &ReleaseDialog::setEndDateTime);

    connect(pb_release, &QPushButton::clicked, this, &ReleaseDialog::release);


    bar = new QProgressBar(this);
//    bar->setBaseSize(80, 30);
    bar->setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);      
}
 MicroViewProgressBarBase::MicroViewProgressBarBase(uint8_t newx, uint8_t newy, int16_t min, int16_t max, uint8_t sty):
 MicroViewWidget(newx, newy, min, max) {

  style = sty;
  printLabel=true;
  switch(sty){
    case WIDGETSTYLE1:
    totalTicks=60;
    break;
    case WIDGETSTYLE2:
    totalTicks=20;
    break;
    case WIDGETSTYLE3:
    totalTicks=40;
    break;
    // If already 0 or invalid, just make sure it's 0.
    case WIDGETSTYLE0:
    default:
    style=WIDGETSTYLE0;
    totalTicks=30;
    break;
  }

  Serial.println("60");
Serial.println(printLabel);

  preInit();
  initWidget(); 
  postInit();
}
Example #5
0
Widget::CAirWidget::CAirWidget( QWidget *parent ):
    CMyWidget( parent ),
    m_pAirGroup( new QGroupBox( "Air" , this ) ),
    m_pTemperatureLabel( new QLabel( "Temperature"  , this ) ),
    m_pTemperatureSpin( new QDoubleSpinBox( this ) ),
    m_pTemperatureHLayout( new QHBoxLayout() ),
    m_pDewPointLabel( new QLabel( "Dew Point" , this ) ),
    m_pDewPointSpin( new QDoubleSpinBox( this ) ),
    m_pDewPointHLayout( new QHBoxLayout( ) ),
    m_pBarometerLabel( new QLabel( "Barometer" , this ) ),
    m_pBarometerSpin( new QDoubleSpinBox( this ) ),
    m_pBarometerHLayout( new QHBoxLayout() ),
    m_pChangeLabel( new QLabel( "Change" , this ) ),
    m_pChangeSpin( new QDoubleSpinBox( this ) ),
    m_pChangeHLayout( new QHBoxLayout() ),
    m_pHumidityLabel( new QLabel( "Humidity" , this ) ),
    m_pHumiditySpin( new QDoubleSpinBox( this ) ),
    m_pHumidityLayout( new QHBoxLayout() ),
    m_pMainLayout( new QGridLayout() ),
    m_pData( new Data::CAirData() ),
    m_pExerciseData( new CPrivateData() ),
    m_ConfigName( "air.config" )
{
    initWidget();
}
Example #6
0
void GUI::createWidget(WidgetContext &ctx) {
	if      (ctx.type == kWidgetTypePanel)
		ctx.widget = new WidgetPanel(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeLabel)
		ctx.widget = new WidgetLabel(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeProtoItem)
		ctx.widget = new WidgetProtoItem(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeButton)
		ctx.widget = new WidgetButton(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeCheckBox)
		ctx.widget = new WidgetCheckBox(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeSlider)
		ctx.widget = new WidgetSlider(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeScrollbar)
		ctx.widget = new WidgetScrollbar(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeProgressbar)
		ctx.widget = new WidgetProgressbar(*this, ctx.tag);
	else if (ctx.type == kWidgetTypeListBox)
		ctx.widget = new WidgetListBox(*this, ctx.tag);
	else
		throw Common::Exception("No such widget type %d", ctx.type);

	ctx.widget->load(*ctx.strct);

	initWidget(*ctx.widget);
}
Example #7
0
userDialog_t::userDialog_t(userInfo_t& ui, QWidget* p) : QDialog(p)
{
	QString type("Edit User");

	initWidget(type);
	signed int didx(-1);
	signed int aidx(-1);

	m_username->setText(ui.username);
	m_password->setText(ui.password);
	m_name->setText(ui.name);
	m_email->setText(ui.email);
	m_phone->setText(ui.phone);
	m_street->setText(ui.street);
	m_city->setText(ui.city);
	m_state->setText(ui.state);
	m_country->setText(ui.country);
	m_postal->setText(ui.postal);
	
	didx = m_domain->findText(ui.domain, Qt::MatchExactly);
	aidx = m_algorithm->findText(ui.algorithm, Qt::MatchExactly);

	if (-1 != didx)
		m_domain->setCurrentIndex(didx);
	if (-1 != aidx)
		m_algorithm->setCurrentIndex(aidx);

	m_domain->setDisabled(true);
	m_oldUser = ui;

	QObject::connect(m_buttons, SIGNAL(accepted()), this, SLOT(acceptEdit()));
	QObject::connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject()));

	return;
}
Example #8
0
Widget::CSunWidget::CSunWidget( QWidget *parent ):
    CMyWidget( parent ),
    m_pMainHLayout( new QHBoxLayout( this ) ),
    m_pSunGroup( new QGroupBox( this ) ),
    m_pSunMainVLayout( new QVBoxLayout() ),
    m_pLevelGroup( new QGroupBox( this ) ),
    m_pLevelMainVLayout( new QVBoxLayout() ),
    m_pManualRadio( new QRadioButton( "Manual" ,this ) ),
    m_pAutoRadio( new QRadioButton( "Auto" , this ) ),
    m_pRadioHLayout( new QHBoxLayout() ),
    m_pBearingLabel( new QLabel( "Bearing" , this ) ),
    m_pBearingSpin( new QDoubleSpinBox( this ) ),
    m_pBearingHLayout( new QHBoxLayout() ),
    m_pElevationLabel( new QLabel( "Elavation" , this ) ),
    m_pElevationSpin( new QDoubleSpinBox( this ) ),
    m_pElevationHLayout( new QHBoxLayout() ),
    m_pDarkNessLabel( new QLabel( "Darlness" , this ) ),
    m_pDarkNessSpin( new  QDoubleSpinBox( this ) ),
    m_pDarkHLayout( new QHBoxLayout() ),
    m_pMaxLabel( new QLabel( "Max" , this ) ),
    m_pMaxSpin( new QDoubleSpinBox( this ) ),
    m_pMaxHLayout( new QHBoxLayout() ),
    m_pNavigationLightsLabel( new QLabel( "Navigation Lights" , this )  ),
    m_pNavigationLightsSpin( new QDoubleSpinBox( this ) ),
    m_pNavigatLightsHLayout( new QHBoxLayout( this ) ),
    m_pCulturalLightsLabel( new QLabel( "Cultura Light" , this ) ),
    m_pCulturalLightsSpin( new QDoubleSpinBox( this ) ),
    m_pCulturalLightsHLayout( new QHBoxLayout() ),
    m_pData( new Data::CSunData() ),
    m_pExerciseData( new CPrivateData() ),
    m_ConfigName( "sun.config")
{
    initWidget();
}
ITDrawModelWidget::ITDrawModelWidget(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	initWidget();
	readIniFile();
}
Example #10
0
Widget::CWindWidget::CWindWidget( QWidget *parent ):
    CMyWidget( parent ),
    m_pGustGroup( new QGroupBox( "Gust Variation" , this ) ),
    m_pGustMainVLayout( new QVBoxLayout() ),
    m_pWindGroup( new QGroupBox( "Wind" , this ) ),
    m_pWindMainGLayout( new QGridLayout( this ) ),
    m_pManualRadio( new QRadioButton( "Manual" ,  this ) ),
    m_pChartRadio( new QRadioButton( "Chart" , this ) ),
    m_pExternalRadio( new QRadioButton( "External" , this ) ),
    m_pRadioHLayout( new QHBoxLayout() ),
    m_pDirectionLabel( new QLabel( "Direction from[deg]" , this ) ),
    m_pDirectionSpin( new QDoubleSpinBox( this ) ),
    m_pDirectionHLayout( new QHBoxLayout() ),
    m_pSpeedLabel( new QLabel( "Speed       [kn]" , this ) ),
    m_pSpeedSpin( new QDoubleSpinBox( this ) ),
    m_pSpeedHLayout( new QHBoxLayout() ),
    m_pGustDirectionLabel( new QLabel( "Direction   [deg]" , this ) ),
    m_pGustDirectionSpin( new QDoubleSpinBox( this ) ),
    m_pGustDirectionHLayout( new QHBoxLayout( this ) ),
    m_pGustSpeedLabel( new QLabel( "Speed       [kn]" , this ) ),
    m_pGustSpeedSpin( new QDoubleSpinBox( this ) ),
    m_pGustSpeedHLayout( new QHBoxLayout() ),
    m_pExerciseData( new CPrivateData() ),
    m_pData( new Data::CWindData() ),
    m_ConfigName( "wind.config" )
{
    initWidget();
}
void MusicDownloadWidget::setSongName(const QString &name, MusicDownLoadQueryThreadAbstract::QueryType type)
{
    initWidget();
    ui->downloadName->setText(QFontMetrics(font()).elidedText(name, Qt::ElideRight, 200));
    m_downloadThread->setQueryAllRecords(true);
    m_downloadThread->startSearchSong(m_queryType = type, name);
}
Example #12
0
File: gui.cpp Project: Glyth/xoreos
WidgetLabel *GUI::createCaption(const Aurora::GFF3Struct &strct, Widget *parent) {
	if (!strct.hasField("Obj_Caption"))
		return 0;

	const Aurora::GFF3Struct &caption = strct.getStruct("Obj_Caption");

	Common::UString font = caption.getString("AurString_Font");

	Common::UString text;
	uint32 strRef = caption.getUint("Obj_StrRef", Aurora::kStrRefInvalid);
	if (strRef != Aurora::kStrRefInvalid)
		text = TalkMan.getString(strRef);

	WidgetLabel *label = new WidgetLabel(*this, parent->getTag() + "#Caption", font, text);

	float pX, pY, pZ;
	parent->getPosition(pX, pY, pZ);
	label->setPosition(pX, pY, pZ - 5.0f);

	float r = caption.getDouble("AurString_ColorR", 1.0);
	float g = caption.getDouble("AurString_ColorG", 1.0);
	float b = caption.getDouble("AurString_ColorB", 1.0);
	float a = caption.getDouble("AurString_ColorA", 1.0);

	label->setColor(r, g, b, a);

	initWidget(*label);

	parent->addChild(*label);
	addWidget(label);

	return label;
}
void GraphPropertiesSelectionWidget::setWidgetParameters(Graph *graph, const std::vector<std::string> &propertiesTypes, const bool includeViewProperties) {
  this->graph = graph;
  this->propertiesTypes = propertiesTypes;
  this->includeViewProperties = includeViewProperties;

  if(graph)
    initWidget();
}
Example #14
0
void MainWindow::changeDB(const QString & dbf){
    closeDB();
    this->dbf = dbf;
    connectDB();
    initWidget();
    loadMoneyTree();
    loadEventToLog();
}
Example #15
0
SearchWidget::SearchWidget(QWidget *parent)
	: QWidget(parent)
	, mainLayout(new QGridLayout)
	, timeLine(new QTimeLine)
	, animationOrder(ShowCity)
{
	initWidget();
}
Example #16
0
    CChatWidget::CChatWidget(const QSharedPointer<CDisplayItemInfo>& vItemInfo, QWidget* vParent)
        : QWidget(vParent)
        , m_pItemInfo(vItemInfo)
    {
        initWidget();

        setGeometry(400, 300, 600, 400);
    }
Example #17
0
CControlWin::CControlWin(QWidget *parent)
    :QMainWindow(parent),
      m_pParent(parent)
{
    initWidget();
    initConnect();
    m_number = 1;
    m_tags = 1;
}
Example #18
0
SaneIntOption::SaneIntOption(QString title,QWidget* parent,
                             SANE_Value_Type type,const char* name)
              :QSaneOption(title,parent,name)
{
  mMetricSystem = QIN::NoMetricSystem;
  mSaneValueType = type;
  mSaneUnit = SANE_UNIT_NONE;
	initWidget();
}
Launcher_page::Launcher_page(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Launcher_page)
{
   // ui->setupUi(this);

    initWidget();
    disableWidget();
}
void MusicDownloadWidget::setSongName(const QString &name, MusicDownLoadQueryThreadAbstract::QueryType type)
{
    m_queryType = type;
    initWidget();

    m_ui->downloadName->setText(MusicUtils::Widget::elidedText(font(), name, Qt::ElideRight, 200));
    m_downloadThread->setQueryAllRecords(true);
    m_downloadThread->startToSearch(type, name);
}
QUnknownProgressWidget::QUnknownProgressWidget(QWidget* parent,
                                               const char* name, WFlags f)
                       :QFrame(parent,name,f)
{
  mpTimer = 0L;
  mPos = 0;
  mStep = 1;
  initWidget();
}
Example #22
0
void QgsQmlWidgetWrapper::reinitWidget( )
{
  if ( !mWidget )
    return;

  mWidget->engine()->clearComponentCache();

  initWidget( mWidget );
}
Example #23
0
KRuler::KRuler(QWidget *parent)
    : QAbstractSlider(parent)
    , d(new KRulerPrivate)
{
    setRange(INIT_MIN_VALUE, INIT_MAX_VALUE);
    setPageStep(10);
    setValue(INIT_VALUE);
    initWidget(Qt::Horizontal);
    setFixedHeight(FIX_WIDTH);
}
Example #24
0
CommonPage::CommonPage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::CommonPage)
{
    ui->setupUi(this);

    initWidget();
    disableWidget();

}
Example #25
0
BlackWidget::BlackWidget(QWidget *parent, int itemIndex)
    : QWidget(parent),
    _itemIndex(itemIndex)
{
    initWidget();
    readAndSetStyleSheet();

    setWidgetValue(_itemIndex);

}
Example #26
0
/* constructor */
InfoBar::InfoBar()
{
	initSettings();
	initWidget();
	initImageWindow();
	initStatWindow();
	initHexWindow();
	initLayout();
	initTimer();
}
void QgsEditorWidgetWrapper::setConfig( const QgsEditorWidgetConfig& config )
{
  mConfig = config;
  // If an editor widget was supplied, we can initialize this now
  if ( mWidget )
  {
    mWidget->setProperty( "EWV2Wrapper", QVariant::fromValue( this ) );
    initWidget( mWidget );
  }
}
Example #28
0
ServerWidget::ServerWidget(QWidget *parent)
	: QWidget(parent)
	, mainLayout(initWidget())
{
	if (publicInstance == nullptr){
		publicInstance = this;
	}
	g_dbEngine = DBEngine::instance();
	initData();
}
QWidget* QgsEditorWidgetWrapper::widget()
{
  if ( !mWidget )
  {
    mWidget = createWidget( mParent );
    mWidget->setProperty( "EWV2Wrapper", QVariant::fromValue( this ) );
    initWidget( mWidget );
  }

  return mWidget;
}
Example #30
0
userDialog_t::userDialog_t(QWidget* p) : QDialog(p)
{
	QString type("Add User");

	initWidget(type);
	QObject::connect(m_buttons, SIGNAL(accepted()), this, SLOT(accept()));
	QObject::connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject()));
	QObject::connect(m_show, &QCheckBox::stateChanged, this, &userDialog_t::checkboxChanged);

	return;
}